Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AArch32: vmvn had incorrect double-word order and number of bytes provided instead of bits in bitwise left shift #6544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sleigh-InSPECtor
Copy link
Contributor

As part of a research project testing the accuracy of the SLEIGH specifications compared to real hardware, we observed an unexpected behaviour in the vmvn instruction for both, AArch32 (ARM:LE:32:v8) & Thumb (ARM:LE:32:v8T).

According to the manual, it takes a value from a register, inverts the value of each bit, and places the result in the destination register. However, we noticed the output was incorrect.


e.g, for AArch32 with,

Instruction: 0xe005f0f3, vmvn q8,q8
initial_registers: { "q8": 0xffffffffffffffff }

We get:

Hardware: { "q8": 0xffffffffffffffff0000000000000000 }
Patched Spec: { "q8": 0xffffffffffffffff0000000000000000 }
Existing Spec: { "q8": 0xffffffffffffffff }


e.g, for Thumb with,

Instruction: 0xf0ffe005, vmvn q8,q8
initial_registers: { "q8": 0x0 }

We get:

Hardware: { "q8": 0xffffffffffffffffffffffffffffffff }
Patched Spec: { "q8": 0xffffffffffffffffffffffffffffffff }
Existing Spec: { "q8": 0xffffffffffffffffff }


Note: The patched spec does not introduce any disassembly changes to the best of our knowledge.

* fixed incorrect shift offset (bytes given in place of bits) and double word order
@GhidorahRex GhidorahRex self-assigned this May 20, 2024
@GhidorahRex GhidorahRex added Type: Bug Something isn't working Feature: Processor/ARM Status: Triage Information is being gathered labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Processor/ARM Status: Triage Information is being gathered Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants