mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-03 22:03:43 +02:00

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 -
39 lines
765 B
ObjectPascal
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.
|