Repository navigation
target-arm: AArch32 VFP arithmetic and conversions - #332
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second AArch32 slice: the VFP data processing instructions of QEMU's
translate-vfp.c.vfp.decodeandvfp-uncond.decodedecode the VFP space. The dispatch follows QEMU: A32 unconditional space triesdisas_vfp_uncond, conditional space triesdisas_vfp, and T32 tries both (the conditional decoder only for0xein the top nibble).translate_a32.rsintotranslate_a32/fp.rs, which adds the half, single and double precision arithmetic (VADD to VDIV, VMLA, VMLS, VNMLA, VNMLS, VNMUL), the fused forms, VABS, VNEG, VSQRT, VCMP and VCMPE, VMOV immediate and register, VRINTR/Z/X, all the VCVT forms (integer, fixed point, f16 and precision), the half precision loads, stores and moves, and the v8 unconditional VSEL, VMAXNM, VMINNM, VRINT{A,N,P,M}, VCVT{A,N,P,M}, VMOVX and VINS.a32_vfpintcg/a32_vfp.rs, which takes the operation, element size, rounding mode and immediate in a descriptor. It uses the A64 float status pair, so FPSCR rounding, FZ, DN, AHP and the cumulative flags behave as in QEMU.Still UNDEF: Neon, the BF16 VCVT, VJCVT and the VFP short vectors.
Tested with a static armhf program that runs every arithmetic, fused, compare, rounding and conversion form over 19 special values (zeros, denormals, infinities, NaNs, rounding boundaries) and checks results and FPSCR flags under each rounding mode, FZ, DN and AHP. Its output matches QEMU 11.1's qemu-arm exactly. The static hello still runs. Workspace clippy (native and x86_64 Linux), fmt, the xtask checks, the Windows check, and the target-arm, machine-arm and linux-user tests pass.
Part of #8.