On 03 Oct 2012, at 03:29, luiz americo pereira camara wrote:

I'm porting some Delphi assembly code.

It worked fine with fpc 2.6.0 i386-64bit windows compiler

When i tried the same code with fpc 2.6.0 i386-64bit for linux it failed to
compile with the following error:

Error: Asm: 16 or 32 Bit references not supported

at the line
        // Load XMM5 with the bias value.
       MOVD        XMM5, [Bias]  //Bias = Integer

Is it a know issue or a limitation of linux version?

Win64 uses a different calling convention compared to every other x86-64 operating system (Microsoft probably started working on it before the x86-64 ABI was finalized). One of the differences is that only passes the first three integer parameters in registers, while other operating systems pass the first six integer parameters in registers. This means that on Win64, the above translates into

  movd xmm5, [rpb + some_offset]

while on other platforms, it translates into

  movd xmm5, [r8d]

So you are creating a reference with r8d as base register, which is invalid (because it's a 32 bit register)


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to