mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 22:39:36 +02:00
x86 assembler:
* Adjust rip-relative offsets using values known from calcsize, instead of reinterpreting the tail of instruction. This is simpler and remains the same regardless of particular codes used in opcode table. * Reduced maxinfolen to 8. - 'jmp imm64' and 64-bit versions of 'in' do not exist, removed. git-svn-id: trunk@17546 -
This commit is contained in:
parent
cbcece1ae6
commit
d89aeeadaf
@ -2369,7 +2369,7 @@
|
|||||||
(
|
(
|
||||||
opcode : A_IN;
|
opcode : A_IN;
|
||||||
ops : 2;
|
ops : 2;
|
||||||
optypes : (ot_reg_ax or ot_bits32 or ot_bits64,ot_immediate,ot_none);
|
optypes : (ot_reg_ax or ot_bits32,ot_immediate,ot_none);
|
||||||
code : #208#1#229#21;
|
code : #208#1#229#21;
|
||||||
flags : if_8086 or if_sb
|
flags : if_8086 or if_sb
|
||||||
),
|
),
|
||||||
@ -2383,7 +2383,7 @@
|
|||||||
(
|
(
|
||||||
opcode : A_IN;
|
opcode : A_IN;
|
||||||
ops : 2;
|
ops : 2;
|
||||||
optypes : (ot_reg_ax or ot_bits32 or ot_bits64,ot_reg_dx,ot_none);
|
optypes : (ot_reg_ax or ot_bits32,ot_reg_dx,ot_none);
|
||||||
code : #208#1#237;
|
code : #208#1#237;
|
||||||
flags : if_8086
|
flags : if_8086
|
||||||
),
|
),
|
||||||
@ -2530,7 +2530,7 @@
|
|||||||
(
|
(
|
||||||
opcode : A_JMP;
|
opcode : A_JMP;
|
||||||
ops : 1;
|
ops : 1;
|
||||||
optypes : (ot_immediate or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
|
optypes : (ot_immediate or ot_bits16 or ot_bits32,ot_none,ot_none);
|
||||||
code : #208#1#233#52;
|
code : #208#1#233#52;
|
||||||
flags : if_8086 or if_pass2
|
flags : if_8086 or if_pass2
|
||||||
),
|
),
|
||||||
|
@ -172,7 +172,7 @@ interface
|
|||||||
{$else x86_64}
|
{$else x86_64}
|
||||||
instabentries = {$i i386nop.inc}
|
instabentries = {$i i386nop.inc}
|
||||||
{$endif x86_64}
|
{$endif x86_64}
|
||||||
maxinfolen = 11;
|
maxinfolen = 8;
|
||||||
MaxInsChanges = 3; { Max things a instruction can change }
|
MaxInsChanges = 3; { Max things a instruction can change }
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -2358,17 +2358,10 @@ implementation
|
|||||||
if oper[opidx]^.ref^.base=NR_RIP then
|
if oper[opidx]^.ref^.base=NR_RIP then
|
||||||
begin
|
begin
|
||||||
currabsreloc:=RELOC_RELATIVE;
|
currabsreloc:=RELOC_RELATIVE;
|
||||||
{ Adjust reloc value depending of immediate operand size,
|
{ Adjust reloc value by number of bytes following the displacement,
|
||||||
but not if offset is specified by literal constant }
|
but not if displacement is specified by literal constant }
|
||||||
if Assigned(currsym) then
|
if Assigned(currsym) then
|
||||||
case Ord(codes^) of
|
Dec(currval,InsEnd-objdata.CurrObjSec.Size-ea_data.bytes);
|
||||||
12,13,14,16,17,18,20,21,22:
|
|
||||||
Dec(currval, 1);
|
|
||||||
24,25,26:
|
|
||||||
Dec(currval, 2);
|
|
||||||
32,33,34,172,173,174:
|
|
||||||
Dec(currval, 4);
|
|
||||||
end;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif x86_64}
|
{$endif x86_64}
|
||||||
|
@ -792,12 +792,13 @@ reg16,imm8 \324\1\x6B\100\15 286
|
|||||||
reg16,imm \324\1\x69\100\31 286,SW
|
reg16,imm \324\1\x69\100\31 286,SW
|
||||||
rm8 \1\xF6\205 8086
|
rm8 \1\xF6\205 8086
|
||||||
|
|
||||||
|
; 64-bit variant does not exist
|
||||||
[IN,inX]
|
[IN,inX]
|
||||||
(Ch_Wop2, Ch_Rop1, Ch_None)
|
(Ch_Wop2, Ch_Rop1, Ch_None)
|
||||||
reg_al,imm \1\xE4\25 8086,SB
|
reg_al,imm \1\xE4\25 8086,SB
|
||||||
reg_ax|32|64,imm \320\1\xE5\25 8086,SB
|
reg_ax|32,imm \320\1\xE5\25 8086,SB
|
||||||
reg_al,reg_dx \1\xEC 8086
|
reg_al,reg_dx \1\xEC 8086
|
||||||
reg_ax|32|64,reg_dx \320\1\xED 8086
|
reg_ax|32,reg_dx \320\1\xED 8086
|
||||||
|
|
||||||
[INC,incX]
|
[INC,incX]
|
||||||
(Ch_Mop1, Ch_WFlags, Ch_None)
|
(Ch_Mop1, Ch_WFlags, Ch_None)
|
||||||
@ -876,7 +877,7 @@ imm \1\xE3\50 X86_64
|
|||||||
[JMP,jmpX]
|
[JMP,jmpX]
|
||||||
(Ch_ROp1, Ch_None, Ch_None)
|
(Ch_ROp1, Ch_None, Ch_None)
|
||||||
imm8 \1\xEB\50 8086,PASS2
|
imm8 \1\xEB\50 8086,PASS2
|
||||||
imm16|32|64 \320\1\xE9\64 8086,PASS2
|
imm16|32 \320\1\xE9\64 8086,PASS2
|
||||||
rm16|32|64 \320\1\xFF\204 8086
|
rm16|32|64 \320\1\xFF\204 8086
|
||||||
imm|short \1\xEB\50 8086,PASS2
|
imm|short \1\xEB\50 8086,PASS2
|
||||||
imm|near \320\1\xE9\64 8086,ND,PASS2
|
imm|near \320\1\xE9\64 8086,ND,PASS2
|
||||||
|
@ -2306,7 +2306,7 @@
|
|||||||
(
|
(
|
||||||
opcode : A_IN;
|
opcode : A_IN;
|
||||||
ops : 2;
|
ops : 2;
|
||||||
optypes : (ot_reg_ax or ot_bits32 or ot_bits64,ot_immediate,ot_none);
|
optypes : (ot_reg_ax or ot_bits32,ot_immediate,ot_none);
|
||||||
code : #208#1#229#21;
|
code : #208#1#229#21;
|
||||||
flags : if_8086 or if_sb
|
flags : if_8086 or if_sb
|
||||||
),
|
),
|
||||||
@ -2320,7 +2320,7 @@
|
|||||||
(
|
(
|
||||||
opcode : A_IN;
|
opcode : A_IN;
|
||||||
ops : 2;
|
ops : 2;
|
||||||
optypes : (ot_reg_ax or ot_bits32 or ot_bits64,ot_reg_dx,ot_none);
|
optypes : (ot_reg_ax or ot_bits32,ot_reg_dx,ot_none);
|
||||||
code : #208#1#237;
|
code : #208#1#237;
|
||||||
flags : if_8086
|
flags : if_8086
|
||||||
),
|
),
|
||||||
@ -2453,7 +2453,7 @@
|
|||||||
(
|
(
|
||||||
opcode : A_JMP;
|
opcode : A_JMP;
|
||||||
ops : 1;
|
ops : 1;
|
||||||
optypes : (ot_immediate or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
|
optypes : (ot_immediate or ot_bits16 or ot_bits32,ot_none,ot_none);
|
||||||
code : #208#1#233#52;
|
code : #208#1#233#52;
|
||||||
flags : if_8086 or if_pass2
|
flags : if_8086 or if_pass2
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user