AArch32: vsel "gt" condition missing NG & OV flag equality check #6531
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.
As part of a research project testing the accuracy of the SLEIGH specifications compared to real hardware, we observed an unexpected behaviour in the
vselgt
instruction for both, AArch32 (ARM:LE:32:v8
) & Thumb (ARM:LE:32:v8T
).According to the manual, it is a floating-point conditional select that makes the destination register to take the value in either one or the other source register according to the "gt" condition. However, we noticed the output was incorrect.
This patch is similar to an already existing constructor in the x86 SLEIGH specification as shown here.
e.g, for AArch32 with,
Instruction:
0xa17a7afe, vselgt.f32 s15,s21,s3
initial_registers:
{ "q0": 0x8448927d97a680d18cd6b3dbe2314e37, "q5": 0x9979037dd3f2dc8f07906f37e010f2bd, "q3": 0x24c8d61cd2a6426faae5e54bb2c1a276, "NG": 0x1, "ZR": 0x0, "OV": 0x0 }
We get:
Hardware:
{ "q3": 0x8448927dd2a6426faae5e54bb2c1a276 }
Patched Spec:
{ "q3": 0x8448927dd2a6426faae5e54bb2c1a276 }
Existing Spec:
{ "q3": 0x7906f37d2a6426faae5e54bb2c1a276 }
e.g, for Thumb with,
Instruction:
0x73fea4aa, vselgt.f32 s21,s7,s9
initial_registers:
{ "q1": 0x7b287a26dcdce5c5a50d617a7c19e34a, "q2": 0x3f6e38d7a2297057bdaefa5c13765026, "q5": 0xa711bccf5300d256e55923cb9d75e855, "NG": 0x1, "ZR": 0x0, "OV": 0x0 }
We get:
Hardware:
{ "q5": 0xa711bccf5300d256bdaefa5c9d75e855 }
Patched Spec:
{ "q5": 0xa711bccf5300d256bdaefa5c9d75e855 }
Existing Spec:
{ "q5": 0xa711bccf5300d2567b287a269d75e855 }
Note: The patched spec does not introduce any disassembly changes to the best of our knowledge.