[Nasm-bugs] [Bug 3392619] For AVX2 instructins VPBROADCASTx usage of general purpose register as a source operand isn't detected as an error

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Thu Oct 10 00:03:07 PDT 2019


https://bugzilla.nasm.us/show_bug.cgi?id=3392619

--- Comment #4 from Vadim Demidov <demidov at beamr.com> ---
Hi Peter,

According to Intel's description of this instruction I expect an error message
like "incompatible argument" if I (or someone else) is trying to use a general
purpose register as a source. Only memory and XMM are valid sources for this
instruction. Generated code is completely wrong, for instance if I insert such
case in my code:

            vpbroadcastd ymm3, xmm0             ; b, 8d
            vpbroadcastd ymm3, edx              ; b, should produce an error
            vpbroadcastd ymm1, xmm1             ; a, 8d

then compiled code in Visual Studio looks like:

000003F7000550C1 C4 E2 7D 58 D8       vpbroadcastd ymm3,xmm0  
000003F7000550C6 ??                   ?? ?? 
000003F7000550C7 F2 7D 28             repne jge  
calc_sad_values_plane_avx2+72h (03F7000550F2h)  
000003F7000550CA 7C DA                jl         
calc_sad_values_plane_avx2+26h (03F7000550A6h)  
000003F7000550CC C4 E2 7D 58 C9       vpbroadcastd ymm1,xmm1  

and such code is obviously crashes when executed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list