mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 09:29:07 +02:00
* also integrated the getnextreg() implementation for 8-bit and 16-bit alus from
the avr and i8086 code generators into the base tcg class git-svn-id: trunk@37182 -
This commit is contained in:
parent
cf28b202eb
commit
db09759763
@ -47,7 +47,6 @@ unit cgcpu;
|
||||
function getaddressregister(list:TAsmList):TRegister;override;
|
||||
|
||||
function GetHigh(const r : TRegister) : TRegister;inline;
|
||||
function GetNextReg(const r: TRegister): TRegister;override;
|
||||
function GetOffsetReg(const r: TRegister;ofs : shortint): TRegister;override;
|
||||
function GetOffsetReg64(const r,rhi: TRegister;ofs : shortint): TRegister;override;
|
||||
|
||||
@ -168,12 +167,6 @@ unit cgcpu;
|
||||
end;
|
||||
|
||||
|
||||
function tcgavr.GetNextReg(const r: TRegister): TRegister;
|
||||
begin
|
||||
result:=TRegister(longint(r)+1);
|
||||
end;
|
||||
|
||||
|
||||
function tcgavr.GetOffsetReg(const r: TRegister;ofs : shortint): TRegister;
|
||||
begin
|
||||
result:=TRegister(longint(r)+ofs);
|
||||
|
@ -91,7 +91,7 @@ unit cgobj;
|
||||
|
||||
{$if defined(cpu8bitalu) or defined(cpu16bitalu)}
|
||||
{# returns the next virtual register }
|
||||
function GetNextReg(const r: TRegister): TRegister;virtual;abstract;
|
||||
function GetNextReg(const r: TRegister): TRegister;virtual;
|
||||
{$endif cpu8bitalu or cpu16bitalu}
|
||||
{$ifdef cpu8bitalu}
|
||||
{# returns the register with the offset of ofs of a continuous set of register starting with r }
|
||||
@ -714,6 +714,20 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
{$if defined(cpu8bitalu) or defined(cpu16bitalu)}
|
||||
function tcg.GetNextReg(const r: TRegister): TRegister;
|
||||
begin
|
||||
if getsupreg(r)<first_int_imreg then
|
||||
internalerror(2013051401);
|
||||
if getregtype(r)<>R_INTREGISTER then
|
||||
internalerror(2017091101);
|
||||
if getsubreg(r)<>R_SUBWHOLE then
|
||||
internalerror(2017091102);
|
||||
result:=TRegister(longint(r)+1);
|
||||
end;
|
||||
{$endif cpu8bitalu or cpu16bitalu}
|
||||
|
||||
|
||||
function Tcg.makeregsize(list:TAsmList;reg:Tregister;size:Tcgsize):Tregister;
|
||||
var
|
||||
subreg:Tsubregister;
|
||||
|
@ -41,8 +41,6 @@ unit cgcpu;
|
||||
procedure init_register_allocators;override;
|
||||
procedure do_register_allocation(list:TAsmList;headertai:tai);override;
|
||||
|
||||
function GetNextReg(const r: TRegister): TRegister;override;
|
||||
|
||||
procedure a_call_name(list : TAsmList;const s : string; weak: boolean);override;
|
||||
procedure a_call_name_far(list : TAsmList;const s : string; weak: boolean);
|
||||
procedure a_call_name_static(list : TAsmList;const s : string);override;
|
||||
@ -158,18 +156,6 @@ unit cgcpu;
|
||||
end;
|
||||
|
||||
|
||||
function tcg8086.GetNextReg(const r: TRegister): TRegister;
|
||||
begin
|
||||
if getsupreg(r)<first_int_imreg then
|
||||
internalerror(2013051401);
|
||||
if getregtype(r)<>R_INTREGISTER then
|
||||
internalerror(2017091101);
|
||||
if getsubreg(r)<>R_SUBW then
|
||||
internalerror(2017091102);
|
||||
result:=TRegister(longint(r)+1);
|
||||
end;
|
||||
|
||||
|
||||
procedure tcg8086.a_call_name(list: TAsmList; const s: string; weak: boolean);
|
||||
begin
|
||||
if current_settings.x86memorymodel in x86_far_code_models then
|
||||
|
Loading…
Reference in New Issue
Block a user