[Nasm-bugs] [Bug 3392362] New: pextrw instruction is not working on Celeron E3400

no-reply at bugzilla-nasm.gorcunov.org no-reply at bugzilla-nasm.gorcunov.org
Fri Jul 29 03:04:42 PDT 2016


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

            Bug ID: 3392362
           Summary: pextrw instruction is not working on Celeron E3400
           Product: NASM
           Version: 2.12.xx
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: olekhov at gmail.com
                CC: gorcunov at gmail.com, hpa at zytor.com, nasm-bugs at nasm.us

Created attachment 411565
  --> https://bugzilla.nasm.us/attachment.cgi?id=411565&action=edit
sample project

valgrind complains about unrecognized instruction, generated by NASM assembler.
A sample project is attached.

YASM and NASM  generate different instructions:

Yasm listing:
     1                                 %line 1+1 test_pextrw.nas
     2                                 [bits 64]
     3                                 [default rel]
     4
     5                                 [section .text align=16]
     6
     7                                 [global test_pextrw]
     8                                 test_pextrw:
     9 00000000 0F1007                  movups xmm0, [rdi]
    10 00000003 66480FC5C000            pextrw rax, xmm0, 0
    11 00000009 C3                      ret
    12

nasm listing:
     1                                  [bits 64]
     2                                  [default rel]
     3
     4                                  [section .text align=16]
     5
     6                                  [global test_pextrw]
     7                                  test_pextrw:
     8 00000000 0F1007                    movups xmm0, [rdi]
     9 00000003 66480F3A15C000            pextrw rax, xmm0, 0
    10 0000000A C3                        ret
    11


NASM  2.12.02rc7 (latest rc)
yasm 1.3.0.28.g51af (current git)
valgrind-3.12.0.SVN (current svn)

yasm generates instruction that executes on Intel Celeron E3400
nasm's instruction causes "illegal hardware instruction" exception on Celeron
E3400

It seems that nasm generates SSE4_1 version, which is not supported on Celeron
E3400

both versions work on Core i7-4770S

valgrind error messages on nasm version:

vex amd64->IR: unhandled instruction bytes: 0x66 0x48 0xF 0x3A 0x15 0xC0 0x0
0xC3 0x90 0x90
vex amd64->IR:   REX=1 REX.W=1 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F3A
vex amd64->IR:   PFX.66=1 PFX.F2=0 PFX.F3=0
==6168== valgrind: Unrecognised instruction at address 0x400583.
==6168==    at 0x400583: ??? (test_pextrw.nas:9)
==6168==    by 0x4E4FCDC: (below main) (in /lib64/libc-2.12.so)
==6168== 1. Your program has a bug and erroneously jumped to a non-code
==6168==    location.  If you are running Memcheck and you just saw a
==6168==    warning about a bad jump, it's probably your program's fault.
==6168== 2. The instruction is legitimate but Valgrind doesn't handle it,
==6168==    i.e. it's Valgrind's fault.  If you think this is the case or
==6168==    you are not sure, please let us know and we'll try to fix it.
==6168== Either way, Valgrind will now raise a SIGILL signal which will
==6168== probably kill your program.
==6168==
==6168== Process terminating with default action of signal 4 (SIGILL)
==6168==  Illegal opcode at address 0x400583
==6168==    at 0x400583: ??? (test_pextrw.nas:9)
==6168==    by 0x4E4FCDC: (below main) (in /lib64/libc-2.12.so)

code produced by yasm works under valgrind without errors.

related bug at valgrind bug tracker:
https://bugs.kde.org/show_bug.cgi?id=366237

-- 
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