Skip to content

Add ARMv7 vabs and fix vcvt lifting - #8401

Open
zznop wants to merge 1 commit into
devfrom
test_arm_vabs_vcvt_fixes
Open

Add ARMv7 vabs and fix vcvt lifting#8401
zznop wants to merge 1 commit into
devfrom
test_arm_vabs_vcvt_fixes

Conversation

@zznop

@zznop zznop commented Aug 10, 2026

Copy link
Copy Markdown
Member

This PR adds the following:

  1. Lift scalar vabs directly with FloatAbs
  2. Use an intrinsic to lift vabs on packed/vector forms that operate on lanes
  3. Fix a bug in the existing vcvt sizing for instructions such as vcvt.f64.f32 that were previously performing an incorrect conversion
  4. Handle the vcvt fixed-point family for lane-wise fixed-point conversions using an intrinsic
  5. Continue lifting scalar vcvt directly with fconvert

All changes have been verified against these two binaries with tests added to test_lift.py

vabs-vcvt-arm.elf.zip
vabs-vcvt-thumb.elf.zip

image

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
@zznop zznop added this to the Krypton milestone Aug 10, 2026
@zznop
zznop requested review from plafosse and a lite review from Copilot August 10, 2026 17:42
@zznop zznop self-assigned this Aug 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 vabs directly with FloatAbs, and use a new __vabs intrinsic for lane-wise/vector forms.
  • Fix vcvt float-to-float conversion sizing (e.g., vcvt.f64.f32) by converting to the destination width.
  • Add a new __vcvt_fixed intrinsic for lane-wise fixed-point vcvt, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants