mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 11:09:19 +02:00
JccAdd2SetccAdd modified to make use of GetIntRegisterBetween
This commit is contained in:
parent
30166f8eb7
commit
67a1d52806
@ -2698,7 +2698,6 @@ implementation
|
|||||||
for r:=low(regs_to_save_int) to high(regs_to_save_int) do
|
for r:=low(regs_to_save_int) to high(regs_to_save_int) do
|
||||||
if regs_to_save_int[r] in rg[R_INTREGISTER].used_in_proc then
|
if regs_to_save_int[r] in rg[R_INTREGISTER].used_in_proc then
|
||||||
inc(size,sizeof(aint));
|
inc(size,sizeof(aint));
|
||||||
|
|
||||||
if uses_registers(R_ADDRESSREGISTER) then
|
if uses_registers(R_ADDRESSREGISTER) then
|
||||||
for r:=low(regs_to_save_int) to high(regs_to_save_int) do
|
for r:=low(regs_to_save_int) to high(regs_to_save_int) do
|
||||||
if regs_to_save_int[r] in rg[R_ADDRESSREGISTER].used_in_proc then
|
if regs_to_save_int[r] in rg[R_ADDRESSREGISTER].used_in_proc then
|
||||||
@ -2714,10 +2713,8 @@ implementation
|
|||||||
|
|
||||||
for r:=low(regs_to_save_mm) to high(regs_to_save_mm) do
|
for r:=low(regs_to_save_mm) to high(regs_to_save_mm) do
|
||||||
if regs_to_save_mm[r] in rg[R_MMREGISTER].used_in_proc then
|
if regs_to_save_mm[r] in rg[R_MMREGISTER].used_in_proc then
|
||||||
begin
|
|
||||||
inc(size,tcgsize2size[OS_VECTOR]);
|
inc(size,tcgsize2size[OS_VECTOR]);
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
if size>0 then
|
if size>0 then
|
||||||
begin
|
begin
|
||||||
|
@ -9738,7 +9738,6 @@ unit aoptx86;
|
|||||||
{$endif i8086}
|
{$endif i8086}
|
||||||
carryadd_opcode : TAsmOp;
|
carryadd_opcode : TAsmOp;
|
||||||
symbol: TAsmSymbol;
|
symbol: TAsmSymbol;
|
||||||
reg: tsuperregister;
|
|
||||||
increg, tmpreg: TRegister;
|
increg, tmpreg: TRegister;
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
@ -9832,22 +9831,13 @@ unit aoptx86;
|
|||||||
else if not(cs_opt_size in current_settings.optimizerswitches) then
|
else if not(cs_opt_size in current_settings.optimizerswitches) then
|
||||||
begin
|
begin
|
||||||
{ search for an available register which is volatile }
|
{ search for an available register which is volatile }
|
||||||
for reg in tcpuregisterset do
|
increg := GetIntRegisterBetween(R_SUBL, UsedRegs, p, hp1);
|
||||||
|
if increg <> NR_NO then
|
||||||
begin
|
begin
|
||||||
if
|
|
||||||
{$if defined(i386) or defined(i8086)}
|
|
||||||
{ Only use registers whose lowest 8-bits can Be accessed }
|
|
||||||
(reg in [RS_EAX,RS_EBX,RS_ECX,RS_EDX]) and
|
|
||||||
{$endif i386 or i8086}
|
|
||||||
(reg in paramanager.get_volatile_registers_int(current_procinfo.procdef.proccalloption)) and
|
|
||||||
not(reg in UsedRegs[R_INTREGISTER].GetUsedRegs)
|
|
||||||
{ We don't need to check if tmpreg is in hp1 or not, because
|
{ We don't need to check if tmpreg is in hp1 or not, because
|
||||||
it will be marked as in use at p (if not, this is
|
it will be marked as in use at p (if not, this is
|
||||||
indictive of a compiler bug). }
|
indictive of a compiler bug). }
|
||||||
then
|
|
||||||
begin
|
|
||||||
TAsmLabel(symbol).decrefs;
|
TAsmLabel(symbol).decrefs;
|
||||||
increg := newreg(R_INTREGISTER,reg,R_SUBL);
|
|
||||||
Taicpu(p).clearop(0);
|
Taicpu(p).clearop(0);
|
||||||
Taicpu(p).ops:=1;
|
Taicpu(p).ops:=1;
|
||||||
Taicpu(p).is_jmp:=false;
|
Taicpu(p).is_jmp:=false;
|
||||||
@ -9861,25 +9851,25 @@ unit aoptx86;
|
|||||||
case getsubreg(Taicpu(hp1).oper[1]^.reg) of
|
case getsubreg(Taicpu(hp1).oper[1]^.reg) of
|
||||||
R_SUBW:
|
R_SUBW:
|
||||||
begin
|
begin
|
||||||
tmpreg := newreg(R_INTREGISTER,reg,R_SUBW);
|
tmpreg := newreg(R_INTREGISTER,getsupreg(increg),R_SUBW);
|
||||||
hp2:=Taicpu.op_reg_reg(A_MOVZX,S_BW,increg,tmpreg);
|
hp2:=Taicpu.op_reg_reg(A_MOVZX,S_BW,increg,tmpreg);
|
||||||
end;
|
end;
|
||||||
R_SUBD:
|
R_SUBD:
|
||||||
begin
|
begin
|
||||||
tmpreg := newreg(R_INTREGISTER,reg,R_SUBD);
|
tmpreg := newreg(R_INTREGISTER,getsupreg(increg),R_SUBD);
|
||||||
hp2:=Taicpu.op_reg_reg(A_MOVZX,S_BL,increg,tmpreg);
|
hp2:=Taicpu.op_reg_reg(A_MOVZX,S_BL,increg,tmpreg);
|
||||||
end;
|
end;
|
||||||
{$ifdef x86_64}
|
{$ifdef x86_64}
|
||||||
R_SUBQ:
|
R_SUBQ:
|
||||||
begin
|
begin
|
||||||
{ MOVZX doesn't have a 64-bit variant, because
|
{ MOVZX doesn't have a 64-bit variant, because
|
||||||
the 32-bit version implicitly zeroes the
|
the 32-bit version implicitly zeroes the
|
||||||
upper 32-bits of the destination register }
|
upper 32-bits of the destination register }
|
||||||
hp2:=Taicpu.op_reg_reg(A_MOVZX,S_BL,increg,
|
tmpreg := newreg(R_INTREGISTER,getsupreg(increg),R_SUBD);
|
||||||
newreg(R_INTREGISTER,reg,R_SUBD));
|
hp2:=Taicpu.op_reg_reg(A_MOVZX,S_BL,increg,tmpreg);
|
||||||
tmpreg := newreg(R_INTREGISTER,reg,R_SUBQ);
|
setsubreg(tmpreg, R_SUBQ);
|
||||||
end;
|
end;
|
||||||
{$endif x86_64}
|
{$endif x86_64}
|
||||||
else
|
else
|
||||||
Internalerror(2020030601);
|
Internalerror(2020030601);
|
||||||
end;
|
end;
|
||||||
@ -9904,7 +9894,6 @@ unit aoptx86;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
{ Detect the following:
|
{ Detect the following:
|
||||||
jmp<cond> @Lbl1
|
jmp<cond> @Lbl1
|
||||||
|
Loading…
Reference in New Issue
Block a user