fpc/tests/test/testsse2.pp
Jonas Maebe 61522d00a2 * fixed tests now that i386 assembler code is checked for correct PIC
usage in case PIC generation is on (some by adding PIC-versions of
    the assembler code, most by adding -Cg- to the options to be used).

    Note: the Intel assembler reader does not yet support the Delphi
    PIC construct, so tests with that (like test/tasmread and test/tcg1)
    do not work with -Cg on non-Darwin (Darwin needs a different PIC
    construct)

git-svn-id: trunk@9370 -
2007-12-01 14:34:50 +00:00

39 lines
765 B
ObjectPascal

{ %OPT=-OaVARMAX=16 -OaVARMIN=16 }
{ %CPU=i386 }
uses
mmx;
{ only a small test to see if it works in principle }
var
b : byte;
q : array[0..15] of byte;
begin
if is_sse2_cpu then
asm
{$ifdef FPC_PIC}
call .LPIC
.LPIC:
popl %ecx
{$ifdef darwin}
movdqa %xmm1,%xmm2
movdqa q-.LPIC(%ecx),%xmm4
psubq %xmm1,%xmm2
psubq q-.LPIC(%ecx),%xmm4
{$else darwin}
addl $_GLOBAL_OFFSET_TABLE_,%ecx
movdqa %xmm1,%xmm2
movdqa q@GOT(%ecx),%xmm4
psubq %xmm1,%xmm2
psubq q@GOT(%ecx),%xmm4
{$endif darwin}
{$else FPC_PIC}
movdqa %xmm1,%xmm2
movdqa q,%xmm4
psubq %xmm1,%xmm2
psubq q,%xmm4
{$endif FPC_PIC}
end;
end.