mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 03:00:58 +01:00
* always use RIP-relative addressing in x86-64 assembler code
* abort if there's a warning (warnings for wrong/dangerous pic
will be added in a later commit)
git-svn-id: trunk@22239 -
This commit is contained in:
parent
be41f296a0
commit
ab9d68ae3e
@ -1,4 +1,5 @@
|
|||||||
{ %CPU=x86_64 }
|
{ %CPU=x86_64 }
|
||||||
|
{ %opt=-vw -Sew }
|
||||||
|
|
||||||
// Basic test for 3-operand SIMD instructions with rip-relative operand
|
// Basic test for 3-operand SIMD instructions with rip-relative operand
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
{ %cpu=x86_64 }
|
{ %cpu=x86_64 }
|
||||||
|
{ %opt=-vw -Sew }
|
||||||
|
|
||||||
{$ifdef windows}
|
{$ifdef windows}
|
||||||
{$imagebase $10000}
|
{$imagebase $10000}
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -10,29 +12,16 @@ begin
|
|||||||
test2:=$deadbeef;
|
test2:=$deadbeef;
|
||||||
ASM
|
ASM
|
||||||
MOVL $16,%EAX
|
MOVL $16,%EAX
|
||||||
{$ifdef FPC_PIC}
|
|
||||||
LEA .LLT(%RIP),%RBX
|
LEA .LLT(%RIP),%RBX
|
||||||
JMP (%RBX,%RAX)
|
JMP (%RBX,%RAX)
|
||||||
{$else not FPC_PIC}
|
|
||||||
JMP .LLT(%RAX)
|
|
||||||
{$endif not FPC_PIC}
|
|
||||||
.balign 16
|
.balign 16
|
||||||
.LLT:
|
.LLT:
|
||||||
.quad .L3,.L2,.L1
|
.quad .L3,.L2,.L1
|
||||||
.L2:
|
.L2:
|
||||||
{$ifdef FPC_PIC}
|
|
||||||
MOVL $12341234,test2(%RIP)
|
MOVL $12341234,test2(%RIP)
|
||||||
JMP .L3(%RIP)
|
|
||||||
{$else not FPC_PIC}
|
|
||||||
MOVL $12341234,test2
|
|
||||||
JMP .L3
|
JMP .L3
|
||||||
{$endif not FPC_PIC}
|
|
||||||
.L1:
|
.L1:
|
||||||
{$ifdef FPC_PIC}
|
|
||||||
MOVL $0,test(%RIP)
|
MOVL $0,test(%RIP)
|
||||||
{$else not FPC_PIC}
|
|
||||||
MOVL $0,test
|
|
||||||
{$endif not FPC_PIC}
|
|
||||||
.L3:
|
.L3:
|
||||||
END;
|
END;
|
||||||
if (test<>0) or (test2<>$deadbeef) then
|
if (test<>0) or (test2<>$deadbeef) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user