Skip to content

Fix ARM NEON VQABS and VQNEG instruction decoding - #10114

Open
OKAN-SOFTWARE wants to merge 1 commit into
NationalSecurityAgency:masterfrom
OKAN-SOFTWARE:fix/arm-neon-vqabs-vqneg
Open

OKAN-SOFTWARE wants to merge 1 commit into
NationalSecurityAgency:masterfrom
OKAN-SOFTWARE:fix/arm-neon-vqabs-vqneg

Conversation

@OKAN-SOFTWARE

@OKAN-SOFTWARE OKAN-SOFTWARE commented Nov 4, 2026 •

Copy link
Copy Markdown

Summary

Fix two ARM NEON instruction-decoding issues:

  • Correct VQABS disassembly to display two register operands.
  • Correct VQNEG decoding so it is recognized as VQNEG instead of VQABS.
  • Introduce the VectorNeg pcodeop for signed-integer VQNEG operations, replacing the inappropriate use of FloatVectorNeg.
  • Retain four focused regression tests covering ARM D/Q and Thumb Q instruction forms.

The changes adjust ARM NEON instruction constructors and pcode behavior. They do not redefine the D or Q registers.

Validation

  • Reproduced the original decoding failures before the fix.
  • git diff --check — Passed.
  • ARM SLEIGH compilation — BUILD SUCCESSFUL (16 languages compiled).
  • ARMAssemblyTest — BUILD SUCCESSFUL, including all four retained regression tests.
Instruction bytes Expected disassembly
4e c7 b0 f3 vqabs.s8 q6,q7
ce c7 b0 f3 vqneg.s8 q6,q7

Development Note

AI assistance was used during development and revision. I reviewed and applied the changes, executed the compilation and regression tests locally, and submitted the validated implementation.

Related Issues

Fixes #10110

Fixes #10111

@GhidorahRex

Copy link
Copy Markdown
Collaborator

You used FloatVectorNeg but vqneg operates on a vector of signed integers. Add a new pcodeop VectorNeg instead.

I'm confused about the comment to "Update ARM SLEIGH definitions for D and Q registers"?

I think the changes to ARMAssemblyTest are excessive. We really don't need to that many tests for two instructions. Otherwise we would have hundreds of thousands of instruction assembly tests.

@OKAN-SOFTWARE
OKAN-SOFTWARE force-pushed the fix/arm-neon-vqabs-vqneg branch from d24da02 to 85e237e Compare November 4, 2026 17:00
@OKAN-SOFTWARE

Copy link
Copy Markdown
Author

Hi @GhidorahRex,

Thank you for the detailed review.
I've updated the PR to address your feedback:

  • Added VectorNeg for the signed-integer VQNEG operations, replacing FloatVectorNeg in the relevant D/Q instruction constructors. (Thanks)
  • Clarified the PR description. I meant the ARM NEON instruction constructors and operand patterns, not the D/Q register definitions.
  • Reduced the added assembly tests from 10 to 4 representative cases covering ARM and Thumb.

I also rebuilt the ARM SLEIGH definitions and reran ARMAssemblyTest. Both completed successfully.

Thanks again for your guidance. I'm happy to make any further adjustments.

@GhidorahRex GhidorahRex added Status: Internal This is being tracked internally by the Ghidra team and removed Status: Triage Information is being gathered labels Nov 5, 2026
@ryanmkurtz ryanmkurtz added this to the 12.2.1 milestone Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature: Processor/ARM Status: Internal This is being tracked internally by the Ghidra team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARM: VQNEG decodes as VQABS ARM: VQABS display has an unexpected extra register

3 participants