views:

64

answers:

2

I'm kind a of making a "JIT" for a numeric routine that I need to compute fast, for x86-64. I'm only using sse instructions for arithmetics and of course some moves. My application generates all of those by simply writing the binary form of machine instructions to some part of memory and then executing. For getting the binary form of instructions, instead of digesting the Intel instructions manuals completely I just put the assembler mnemonimics to an input file in NASM and examine his output.The problem is that I need the instruction movlps with an inmediate address that be 64 bits wide, which according to Intel manuals should be perfectly possible. So, something like this:

movlps xmm0, [0x7fffffffffa0]

But all what I get is Nasm truncating the operand size to 32 bits and printing the corresponding warning:

sample.s:6: warning: dword data exceeds bounds

I have tried with different forms of the qword prefix without success.

+2  A: 

I don't think you can do that. movlps loads or stores a value that's 64 bits wide, but immediate addresses and displacements are still limited to 32 bits in general. The best you can do is

mov rax, 0x7fffffffffa0
movlps xmm0, [rax]

(the first mov may need to be movabs; I don't really know Intel syntax assembly)

Zack
+1  A: 

most x64 instructions don't take 64 bit immed.

unless I'm very mistaken you have to move through the rax register.

Joshua