mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-05 22:29:33 +01:00
+ implemented inc/dec for huge pointers
git-svn-id: trunk@29251 -
This commit is contained in:
parent
d4ee6fb0e5
commit
c39128708e
@ -37,6 +37,7 @@ interface
|
|||||||
function first_seg: tnode; override;
|
function first_seg: tnode; override;
|
||||||
procedure second_seg; override;
|
procedure second_seg; override;
|
||||||
procedure second_get_frame;override;
|
procedure second_get_frame;override;
|
||||||
|
function first_IncDec: tnode;override;
|
||||||
procedure second_incdec;override;
|
procedure second_incdec;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -52,9 +53,9 @@ implementation
|
|||||||
defutil,
|
defutil,
|
||||||
aasmbase,aasmtai,aasmdata,aasmcpu,
|
aasmbase,aasmtai,aasmdata,aasmcpu,
|
||||||
symtype,symdef,symcpu,
|
symtype,symdef,symcpu,
|
||||||
cgbase,pass_2,
|
cgbase,pass_1,pass_2,
|
||||||
cpuinfo,cpubase,paramgr,
|
cpuinfo,cpubase,paramgr,
|
||||||
nbas,ncon,ncal,ncnv,nld,ncgutil,
|
nbas,nadd,ncon,ncal,ncnv,nld,ncgutil,
|
||||||
tgobj,
|
tgobj,
|
||||||
cga,cgutils,cgx86,cgobj,hlcgobj,
|
cga,cgutils,cgx86,cgobj,hlcgobj,
|
||||||
htypechk,procinfo;
|
htypechk,procinfo;
|
||||||
@ -138,6 +139,45 @@ implementation
|
|||||||
inherited second_get_frame;
|
inherited second_get_frame;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function ti8086inlinenode.first_IncDec: tnode;
|
||||||
|
var
|
||||||
|
procname:string;
|
||||||
|
elesize: Tconstexprint;
|
||||||
|
hp: tnode;
|
||||||
|
begin
|
||||||
|
if is_hugepointer(tcallparanode(left).left.resultdef) then
|
||||||
|
begin
|
||||||
|
case inlinenumber of
|
||||||
|
in_inc_x:
|
||||||
|
procname:='fpc_hugeptr_inc_longint';
|
||||||
|
in_dec_x:
|
||||||
|
procname:='fpc_hugeptr_dec_longint';
|
||||||
|
else
|
||||||
|
internalerror(2014121001);
|
||||||
|
end;
|
||||||
|
if cs_hugeptr_arithmetic_normalization in current_settings.localswitches then
|
||||||
|
procname:=procname+'_normalized';
|
||||||
|
|
||||||
|
if is_void(tpointerdef(tcallparanode(left).left.resultdef).pointeddef) then
|
||||||
|
elesize:=1
|
||||||
|
else
|
||||||
|
elesize:=tpointerdef(tcallparanode(left).left.resultdef).pointeddef.size;
|
||||||
|
|
||||||
|
hp := cordconstnode.create(elesize,s32inttype,false);
|
||||||
|
{ extra parameter? }
|
||||||
|
if assigned(tcallparanode(left).right) then
|
||||||
|
hp:=caddnode.create(muln,hp,tcallparanode(tcallparanode(left).right).left.getcopy);
|
||||||
|
|
||||||
|
result:=ccallnode.createintern(procname,
|
||||||
|
ccallparanode.create(hp,
|
||||||
|
ccallparanode.create(tcallparanode(left).left.getcopy,nil)));
|
||||||
|
typecheckpass(result);
|
||||||
|
firstpass(result);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
result:=inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure ti8086inlinenode.second_incdec;
|
procedure ti8086inlinenode.second_incdec;
|
||||||
const
|
const
|
||||||
addsubop:array[in_inc_x..in_dec_x] of TOpCG=(OP_ADD,OP_SUB);
|
addsubop:array[in_inc_x..in_dec_x] of TOpCG=(OP_ADD,OP_SUB);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user