Skip to content

Fix 64-bit FMOV immediate decoding - #46

Open
Darkar25 wants to merge 1 commit into
SamboyCoding:masterfrom
Darkar25:fix/fmov-immediate-64bit
Open

Darkar25 wants to merge 1 commit into
SamboyCoding:masterfrom
Darkar25:fix/fmov-immediate-64bit

Conversation

@Darkar25

@Darkar25 Darkar25 commented Nov 3, 2026

Copy link
Copy Markdown

No description provided.

DecodeFPImm shifted the fraction nibble as a 32-bit value: `frac <<= f - 4`
with f = 52 is a shift count of 48, which C# masks modulo 32, so the nibble
landed at bit 16 of the result instead of bit 48. `fmov d16, SamboyCoding#15.0` was
therefore decoded as 8.000000001629815 (10.0 -> 8.000000000465661,
5.0 -> 4.000000000232831). The 32-bit and 16-bit paths were unaffected
because their shifts (19 and 6) do not wrap.

Shift the fraction as a 64-bit value. The expansion (sign | E | F with
E = NOT(b):Replicate(b,8):c:d, F = efgh:Zeros(48), imm8 = s:b:cd:efgh)
was validated against capstone for all 256 immediate encodings.
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.

1 participant