[Nasm-bugs] [Bug 3392607] New: Incorrect decoding for some AVX512_VBMI2 instructions

noreply-nasm at gorcunov.org noreply-nasm at gorcunov.org
Tue Sep 3 09:32:44 PDT 2019


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

            Bug ID: 3392607
           Summary: Incorrect decoding for some AVX512_VBMI2 instructions
           Product: NASM
           Version: 2.14.xx
          Hardware: PC
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: shigoel at gmail.com
                CC: chang.seok.bae at intel.com, gorcunov at gmail.com,
                    hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Build from source archive using configure

Intel's new instructions --- VPSHLDV and VPSHRDV --- are incorrectly decoded,
leading to invalid errors from nasm.  The examples below are for left shifts,
but the right shifts are analogous.

Illustrative example: (using stable version 2.14.02)
===============================
$ cat vpshldv.asm
BITS 64
        vpshldvw xmm0{k1}{z}, xmm1, xmm2

$ nasm -o vpshldv.o vpshldv.asm
vpshldv.asm:2: error: WRT not supported by binary output format
vpshldv.asm:2: error: binary output format does not support external references
===============================

However, VPSHLDW is decoded as expected.
===============================
$ cat vpshld.asm
BITS 64
        vpshldw xmm0{k1}{z}, xmm1, xmm2, 5

$ nasm -o vpshld.o vpshld.asm
$ ndisasm -b64 vpshld.o
00000000  62F3F58970C205    vpshldw xmm0{k1}{z},xmm1,xmm2,byte 0x5
===============================

The case of VPSHLDVW followed by VPSHLD is interesting:
===============================
$ cat vpshldtest.asm 
BITS 64
        vpshldw xmm0{k1}{z}, xmm1, xmm2, 5
        vpshldvw xmm0{k1}{z}, xmm1, xmm2

$ nasm -o vpshldtest.o vpshldtest.asm
$ ndisasm -b64 vpshldtest.o
00000000  62F3F58970C205    vpshldw xmm0{k1}{z},xmm1,xmm2,byte 0x5
00000007  62F2F58970C205    vpshldvw xmm0{k1}{z},xmm1,xmm2
===============================

No errors this time, but VPSHLDVW (which shouldn't have any immediate values)
has 05 as the immediate byte.

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


More information about the Nasm-bugs mailing list