- removed GetHigh, GetNextReg, GetLastReg, GetOffsetReg and GetOffsetReg64 from cpubase. The methods

in cg should be used instead, because they do better error checking on the register used.

git-svn-id: trunk@45147 -
This commit is contained in:
nickysn 2020-04-27 22:03:36 +00:00
parent f202249711
commit 69c95115f6
2 changed files with 1 additions and 47 deletions

View File

@ -288,19 +288,6 @@ unit cpubase;
function dwarf_reg_no_error(r:tregister):shortint;
function eh_return_data_regno(nr: longint): longint;
function GetHigh(const r : TRegister) : TRegister;
{ returns the next virtual register }
function GetNextReg(const r : TRegister) : TRegister;
{ returns the last virtual register }
function GetLastReg(const r : TRegister) : TRegister;
{ returns the register with the offset of ofs of a continuous set of register starting with r }
function GetOffsetReg(const r : TRegister;ofs : shortint) : TRegister;
{ returns the register with the offset of ofs of a continuous set of register starting with r and being continued with rhi }
function GetOffsetReg64(const r,rhi: TRegister;ofs : shortint): TRegister;
function is_calljmp(o:tasmop):boolean;{$ifdef USEINLINE}inline;{$endif USEINLINE}
implementation
@ -464,39 +451,6 @@ unit cpubase;
end;
function GetHigh(const r : TRegister) : TRegister;
begin
result:=TRegister(longint(r)+1)
end;
function GetNextReg(const r: TRegister): TRegister;
begin
result:=TRegister(longint(r)+1);
end;
function GetLastReg(const r: TRegister): TRegister;
begin
result:=TRegister(longint(r)-1);
end;
function GetOffsetReg(const r: TRegister;ofs : shortint): TRegister;
begin
result:=TRegister(longint(r)+ofs);
end;
function GetOffsetReg64(const r,rhi: TRegister;ofs : shortint): TRegister;
begin
if ofs>3 then
result:=TRegister(longint(rhi)+ofs-4)
else
result:=TRegister(longint(r)+ofs);
end;
function is_calljmp(o:tasmop):boolean;{$ifdef USEINLINE}inline;{$endif USEINLINE}
begin
is_calljmp:= o in call_jmp_instructions;

View File

@ -60,7 +60,7 @@ implementation
location.register:=cg.getintregister(current_asmdata.CurrAsmList,OS_16);
cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_8,OS_8,NR_L,location.register);
cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_L);
cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_8,OS_8,NR_H,GetNextReg(location.register));
cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_8,OS_8,NR_H,cg.GetNextReg(location.register));
cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_H);
end;
end;