Add ARMv7 vabs and fix vcvt lifting - #8401
Open
zznop wants to merge 1 commit into
Open
Conversation
Lift scalar VABS directly when the lane and register widths match, and use intrinsics for packed ARM and Thumb forms Correct Thumb F32/F64 VCVT result sizing, fix scalar fixed-point rounding and extension, and add an intrinsic for lane-wise fixed-point conversions
There was a problem hiding this comment.
Pull request overview
This PR improves ARMv7/Thumb2 NEON/VFP lifting for vabs and vcvt by lifting scalar forms directly into LLIL floating operations where possible, and introducing new intrinsics for lane-wise/vector and fixed-point conversion forms to preserve semantics.
Changes:
- Lift scalar
vabsdirectly withFloatAbs, and use a new__vabsintrinsic for lane-wise/vector forms. - Fix
vcvtfloat-to-float conversion sizing (e.g.,vcvt.f64.f32) by converting to the destination width. - Add a new
__vcvt_fixedintrinsic for lane-wise fixed-pointvcvt, and correct scalar fixed-point conversion sizing/rounding behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| arch/armv7/thumb2_disasm/il_thumb2.cpp | Adds scalar vabs lifting via FloatAbs, introduces __vabs / __vcvt_fixed intrinsics for vector/lane forms, and fixes vcvt float sizing. |
| arch/armv7/thumb2_disasm/arch_thumb2.cpp | Registers new intrinsics (__vabs, __vcvt_fixed) with names, parameter lists, and classification. |
| arch/armv7/test_lift.py | Adds/updates lift expectations for vabs and vcvt (including fixed-point and float sizing fixes). |
| arch/armv7/il.h | Extends Armv7Intrinsic enum with ARMV7_INTRIN_VABS and ARMV7_INTRIN_VCVT_FIXED. |
| arch/armv7/il.cpp | Implements ARM-mode lifting for vabs, improves vcvt fixed-point handling (including vector via intrinsic), and fixes float-to-float conversion handling. |
| arch/armv7/arch_armv7.cpp | Registers new intrinsics (__vabs, __vcvt_fixed) with names, parameter lists, and classification. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
This PR adds the following:
vabsdirectly withFloatAbsvabson packed/vector forms that operate on lanesvcvtsizing for instructions such asvcvt.f64.f32that were previously performing an incorrect conversionvcvtfixed-point family for lane-wise fixed-point conversions using an intrinsicvcvtdirectly withfconvertAll changes have been verified against these two binaries with tests added to
test_lift.pyvabs-vcvt-arm.elf.zip
vabs-vcvt-thumb.elf.zip