NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: shaynox on December 01, 2014, 04:17:04 PM

Title: instruction normally not allowed but finnaly yes (intel compiler like proof)
Post by: shaynox on December 01, 2014, 04:17:04 PM
Hello, i use intel compiler and nasm for build my program in assembly, i take the asm file product by the compiler.

And i found something strange, intel compiler allowed :
    - vmovd     rdx, xmm1
but nasm no, we can only moving dest. to a 32 bit register (edx in that case).

Here the c code and code asm product by intel compiler:

c:
Code: [Select]
printf("FPS = %f\n", 50.0);
asm:
Code: [Select]
;;; printf("FPS = %f\n", 50.0);

        vmovsd    xmm1, QWORD PTR [_2il0floatpacket.27]         ;505.5
$LN367:
        lea       rcx, QWORD PTR [??_C@_09A@FPS?5?$DN?5?$CFf?6?$AA@] ;505.5
$LN368:
        vmovd     rdx, xmm1                                     ;505.5
$LN369:
        call      QWORD PTR [__imp_printf]                      ;505.5
$LN370:
                                ; LOE rbp rsi r15 edi xmm6 xmm7 xmm8 xmm9
.B1.44::                        ; Preds .B1.43

Here the error of nasm:
"error: invalid combination of opcode and operands"

Thanks
Title: Re: instruction normally not allowed but finnaly yes (intel compiler like proof)
Post by: Frank Kotler on December 02, 2014, 02:52:45 AM
Developers' list says "use vmovq". I guess they're saying the bug is in the compiler(?). I have no clue. Thanks for the feedback!

Best,
Frank