Skip to content

x86: fix {er} decorator placement for integer-source VCVT* instructions#229

Open
thac0 wants to merge 1 commit intonetwide-assembler:masterfrom
thac0:fix-vcvt-encoding
Open

x86: fix {er} decorator placement for integer-source VCVT* instructions#229
thac0 wants to merge 1 commit intonetwide-assembler:masterfrom
thac0:fix-vcvt-encoding

Conversation

@thac0
Copy link
Copy Markdown

@thac0 thac0 commented May 7, 2026

For VCVTUSI2SD, VCVTUSI2SS, and VCVTUSI2SH, the |er flag in insns.dat was attached to the XMM pass-through source (operand 2, the vvvv field) rather than the integer source (operand 3, the rm field). This caused NASM to require the embedded-rounding decorator before the integer register rather than after it, which is wrong; the correct syntax is vcvtusi2ss xmm0,xmm1,eax,{rn-sae}, not vcvtusi2ss xmm0,xmm1,{rn-sae},eax.

Move |er to the integer source operand for all six affected entries, and change the XMM source from xmmreg|er to xmmreg* (optional duplicate of the destination, consistent with every other scalar integer-to-float convert in the file).

Also fix a copy-paste error in insns.dat where the second VCVTUSI2SH entry (W=1, rm64) was mis-labeled as VCVTUSI2SS.

Update travis/test/avx512f.asm to use the correct decorator syntax (reg,{rN-sae} instead of {rN-sae},reg) for the ER forms of VCVTSI2SD, VCVTSI2SS, VCVTUSI2SD, and VCVTUSI2SS; regenerate the golden avx512f.bin.t. The encoded bytes are unchanged.

travis/test/avx512f.json had a trailing comma after the last field of the JSON object, making it invalid JSON. Remove the trailing comma.

For `VCVTUSI2SD`, `VCVTUSI2SS`, and `VCVTUSI2SH`, the `|er` flag in
`insns.dat` was attached to the XMM pass-through source (operand 2, the
vvvv field) rather than the integer source (operand 3, the rm field).
This caused NASM to require the embedded-rounding decorator before the
integer register rather than after it, which is wrong; the correct
syntax is `vcvtusi2ss xmm0,xmm1,eax,{rn-sae}`, not `vcvtusi2ss
xmm0,xmm1,{rn-sae},eax`.

Move `|er` to the integer source operand for all six affected entries,
and change the XMM source from `xmmreg|er` to `xmmreg*` (optional
duplicate of the destination, consistent with every other scalar
integer-to-float convert in the file).

Also fix a copy-paste error in `insns.dat` where the second `VCVTUSI2SH`
entry (W=1, rm64) was mis-labeled as `VCVTUSI2SS`.

Update `travis/test/avx512f.asm` to use the correct decorator syntax
(`reg,{rN-sae}` instead of `{rN-sae},reg`) for the ER forms of
`VCVTSI2SD`, `VCVTSI2SS`, `VCVTUSI2SD`, and `VCVTUSI2SS`; regenerate the
golden `avx512f.bin.t`. The encoded bytes are unchanged.

`travis/test/avx512f.json` had a trailing comma after the last field of
the JSON object, making it invalid JSON. Remove the trailing comma.

Signed-off-by: Joe Konno <joe.konno@intel.com>
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