+ att_reg2str -> gas_reg2str

This commit is contained in:
carl 2002-04-14 16:58:41 +00:00
parent f3bfe280a8
commit 39c86c857d
8 changed files with 73 additions and 48 deletions

View File

@ -421,7 +421,7 @@ interface
ait_regalloc :
begin
if (cs_asm_regalloc in aktglobalswitches) then
AsmWriteLn(target_asm.comment+'Register '+att_reg2str[tairegalloc(hp).reg]+
AsmWriteLn(target_asm.comment+'Register '+gas_reg2str[tairegalloc(hp).reg]+
allocstr[tairegalloc(hp).allocation]);
end;
@ -883,7 +883,10 @@ initialization
end.
{
$Log$
Revision 1.14 2002-04-04 18:27:37 carl
Revision 1.15 2002-04-14 16:58:41 carl
+ att_reg2str -> gas_reg2str
Revision 1.14 2002/04/04 18:27:37 carl
+ added wdosx support (patch from Pavel)
Revision 1.13 2002/04/02 17:11:33 peter

View File

@ -399,7 +399,7 @@ const
{$endif}
{$ifdef ATTREG}
att_reg2str : reg2strtable = ('',
gas_reg2str : reg2strtable = ('',
'%eax','%ecx','%edx','%ebx','%esp','%ebp','%esi','%edi',
'%ax','%cx','%dx','%bx','%sp','%bp','%si','%di',
'%al','%cl','%dl','%bl','%ah','%ch','%bh','%dh',
@ -930,7 +930,10 @@ implementation
end.
{
$Log$
Revision 1.12 2002-04-02 17:11:34 peter
Revision 1.13 2002-04-14 16:59:41 carl
+ att_reg2str -> gas_reg2str
Revision 1.12 2002/04/02 17:11:34 peter
* tlocation,treference update
* LOC_CONSTANT added for better constant handling
* secondadd splitted in multiple routines

View File

@ -69,6 +69,7 @@ implementation
**************************************}
{$ifndef NOAG386ATT}
,aggas
,ag386att
{$endif}
{$ifndef NOAG386NSM}
@ -85,7 +86,10 @@ implementation
end.
{
$Log$
Revision 1.4 2002-04-04 18:31:37 carl
Revision 1.5 2002-04-14 17:00:49 carl
+ att_reg2str -> gas_reg2str
Revision 1.4 2002/04/04 18:31:37 carl
+ added wdosx support (patch from Pavel)
Revision 1.3 2002/03/28 20:48:04 carl

View File

@ -574,7 +574,7 @@ begin
exclude(regsUsable,regCounter);
{$ifdef alignregdebug}
temp := Tai_asm_comment.Create(strpnew(
att_reg2str[regCounter]+' removed')));
gas_reg2str[regCounter]+' removed')));
temp.next := prev.next;
temp.previous := prev;
prev.next := temp;
@ -624,7 +624,7 @@ begin
exclude(regsUsable,regCounter);
{$ifdef alignregdebug}
temp := Tai_asm_comment.Create(strpnew(
att_reg2str[regCounter]+' removed')));
gas_reg2str[regCounter]+' removed')));
temp.next := next.next;
temp.previous := next;
next.next := temp;
@ -667,7 +667,7 @@ begin
break
end;
{$ifdef alignregdebug}
next := Tai_asm_comment.Create(strpnew(att_reg2str[lastRemoved]+
next := Tai_asm_comment.Create(strpnew(gas_reg2str[lastRemoved]+
' chosen as alignment register')));
next.next := p.next;
next.previous := p;
@ -703,7 +703,7 @@ begin
{$ifdef replaceregdebug}
l := random(1000);
hp := Tai_asm_comment.Create(strpnew(
'cleared '+att_reg2str[reg]+' from here... '+tostr(l))));
'cleared '+gas_reg2str[reg]+' from here... '+tostr(l))));
hp.next := p;
hp.previous := p.previous;
p.previous := hp;
@ -738,7 +738,7 @@ begin
if assigned(p) then
begin
hp := Tai_asm_comment.Create(strpnew(
'cleared '+att_reg2str[reg]+' till here... '+tostr(l))));
'cleared '+gas_reg2str[reg]+' till here... '+tostr(l))));
hp.next := p;
hp.previous := p.previous;
p.previous := hp;
@ -759,7 +759,7 @@ begin
{$ifdef replaceregdebug}
l := random(1000);
hp := Tai_asm_comment.Create(strpnew(
'restored '+att_reg2str[reg]+' with data from here... '+tostr(l))));
'restored '+gas_reg2str[reg]+' with data from here... '+tostr(l))));
hp.next := p;
hp.previous := p.previous;
p.previous := hp;
@ -784,7 +784,7 @@ begin
if assigned(p) then
begin
hp := Tai_asm_comment.Create(strpnew(
'restored '+att_reg2str[reg]+' till here... '+tostr(l))));
'restored '+gas_reg2str[reg]+' till here... '+tostr(l))));
hp.next := p;
hp.previous := p.previous;
p.previous := hp;
@ -1171,7 +1171,7 @@ begin
begin
{$ifdef replaceregdebug}
hp := Tai_asm_comment.Create(strpnew(
'replacing '+att_reg2str[newreg]+' with '+att_reg2str[orgreg]+
'replacing '+gas_reg2str[newreg]+' with '+gas_reg2str[orgreg]+
' from here...')));
hp.next := p;
hp.previous := p.previous;
@ -1180,7 +1180,7 @@ begin
hp.previous^.next := hp;
hp := Tai_asm_comment.Create(strpnew(
'replaced '+att_reg2str[newreg]+' with '+att_reg2str[orgreg]+
'replaced '+gas_reg2str[newreg]+' with '+gas_reg2str[orgreg]+
' till here')));
hp.next := endp.next;
hp.previous := endp;
@ -1243,7 +1243,7 @@ begin
else
begin
hp := Tai_asm_comment.Create(strpnew(
'replacing '+att_reg2str[newreg]+' with '+att_reg2str[orgreg]+
'replacing '+gas_reg2str[newreg]+' with '+gas_reg2str[orgreg]+
' from here...')));
hp.previous := p.previous;
hp.next := p;
@ -1252,7 +1252,7 @@ begin
hp.previous^.next := hp;
hp := Tai_asm_comment.Create(strpnew(
'replacing '+att_reg2str[newreg]+' with '+att_reg2str[orgreg]+
'replacing '+gas_reg2str[newreg]+' with '+gas_reg2str[orgreg]+
' failed here')));
hp.next := endp.next;
hp.previous := endp;
@ -1460,7 +1460,7 @@ Begin
begin
{$ifdef csdebug}
hp5 := Tai_asm_comment.Create(strpnew(
'cse checking '+att_reg2str[Reg32(Taicpu(p).oper[1].reg)])));
'cse checking '+gas_reg2str[Reg32(Taicpu(p).oper[1].reg)])));
insertLLItem(asml,p,p.next,hp5);
{$endif csdebug}
If CheckSequence(p,prevSeq,Taicpu(p).oper[1].reg, Cnt, RegInfo, findPrevSeqs) And
@ -1542,8 +1542,8 @@ Begin
For RegCounter := R_EAX To R_EDI Do
If (RegCounter in RegInfo.RegsLoadedForRef) Then
Begin
hp5 := Tai_asm_comment.Create(strpnew('New: '+att_reg2str[RegCounter]+', Old: '+
att_reg2str[RegInfo.New2OldReg[RegCounter]])));
hp5 := Tai_asm_comment.Create(strpnew('New: '+gas_reg2str[RegCounter]+', Old: '+
gas_reg2str[RegInfo.New2OldReg[RegCounter]])));
InsertLLItem(AsmL, Tai(hp2.previous), hp2, hp5);
End;
{$EndIf CSDebug}
@ -1983,7 +1983,10 @@ End.
{
$Log$
Revision 1.27 2002-04-04 19:06:10 peter
Revision 1.28 2002-04-14 17:00:49 carl
+ att_reg2str -> gas_reg2str
Revision 1.27 2002/04/04 19:06:10 peter
* removed unused units
* use tlocation.size in cg.a_*loc*() routines

View File

@ -1171,10 +1171,10 @@ Begin
firstRemovedWasAlloc := false;
first := true;
{$ifdef allocregdebug}
hp := Tai_asm_comment.Create(strpnew('allocating '+att_reg2str[reg]+
hp := Tai_asm_comment.Create(strpnew('allocating '+gas_reg2str[reg]+
' from here...')));
insertllitem(asml,p1.previous,p1,hp);
hp := Tai_asm_comment.Create(strpnew('allocated '+att_reg2str[reg]+
hp := Tai_asm_comment.Create(strpnew('allocated '+gas_reg2str[reg]+
' till here...')));
insertllitem(asml,p2,p1.next,hp);
{$endif allocregdebug}
@ -1525,7 +1525,7 @@ Begin {checks whether two Taicpu instructions are equal}
Begin
RegInfo.RegsLoadedForRef := RegInfo.RegsLoadedForRef + [Base];
{$ifdef csdebug}
Writeln(att_reg2str[base], ' added');
Writeln(gas_reg2str[base], ' added');
{$endif csdebug}
end;
If Not(Index in [procinfo^.FramePointer,
@ -1533,7 +1533,7 @@ Begin {checks whether two Taicpu instructions are equal}
Begin
RegInfo.RegsLoadedForRef := RegInfo.RegsLoadedForRef + [Index];
{$ifdef csdebug}
Writeln(att_reg2str[index], ' added');
Writeln(gas_reg2str[index], ' added');
{$endif csdebug}
end;
@ -1544,7 +1544,7 @@ Begin {checks whether two Taicpu instructions are equal}
RegInfo.RegsLoadedForRef := RegInfo.RegsLoadedForRef -
[Reg32(Taicpu(p2).oper[1].reg)];
{$ifdef csdebug}
Writeln(att_reg2str[Reg32(Taicpu(p2).oper[1].reg)], ' removed');
Writeln(gas_reg2str[Reg32(Taicpu(p2).oper[1].reg)], ' removed');
{$endif csdebug}
end;
InstructionsEquivalent :=
@ -1891,7 +1891,7 @@ Begin
top_reg:
begin
{$ifdef statedebug}
hp := Tai_asm_comment.Create(strpnew('destroying '+att_reg2str[o.reg]));
hp := Tai_asm_comment.Create(strpnew('destroying '+gas_reg2str[o.reg]));
hp.next := Taiobj^.next;
hp.previous := Taiobj;
Taiobj^.next := hp;
@ -1940,7 +1940,7 @@ Begin
invalidateDependingRegs(p.optinfo,reg);
pTaiprop(p.optinfo)^.regs[reg].memwrite := nil;
{$ifdef StateDebug}
hp := Tai_asm_comment.Create(strpnew(att_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)
hp := Tai_asm_comment.Create(strpnew(gas_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)
+ ' -- ' + tostr(PTaiProp(p.optinfo)^.Regs[reg].nrofmods))));
InsertLLItem(AsmL, p, p.next, hp);
{$endif StateDebug}
@ -1948,12 +1948,12 @@ Begin
Else
Begin
{$ifdef statedebug}
hp := Tai_asm_comment.Create(strpnew('destroying '+att_reg2str[reg]));
hp := Tai_asm_comment.Create(strpnew('destroying '+gas_reg2str[reg]));
insertllitem(asml,p,p.next,hp);
{$endif statedebug}
DestroyReg(PTaiProp(p.optinfo), Reg, true);
{$ifdef StateDebug}
hp := Tai_asm_comment.Create(strpnew(att_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)));
hp := Tai_asm_comment.Create(strpnew(gas_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)));
InsertLLItem(AsmL, p, p.next, hp);
{$endif StateDebug}
End
@ -2242,7 +2242,7 @@ Begin
Begin
{$ifdef statedebug}
hp := Tai_asm_comment.Create(strpnew('destroying '+
att_reg2str[Taicpu(p).oper[1].reg])));
gas_reg2str[Taicpu(p).oper[1].reg])));
insertllitem(asml,p,p.next,hp);
{$endif statedebug}
@ -2270,7 +2270,7 @@ Begin
else
begin
{$ifdef statedebug}
hp := Tai_asm_comment.Create(strpnew('destroying & initing '+att_reg2str[tmpreg]));
hp := Tai_asm_comment.Create(strpnew('destroying & initing '+gas_reg2str[tmpreg]));
insertllitem(asml,p,p.next,hp);
{$endif statedebug}
destroyReg(curprop, tmpreg, true);
@ -2283,7 +2283,7 @@ Begin
end
end;
{$ifdef StateDebug}
hp := Tai_asm_comment.Create(strpnew(att_reg2str[TmpReg]+': '+tostr(CurProp^.regs[TmpReg].WState)));
hp := Tai_asm_comment.Create(strpnew(gas_reg2str[TmpReg]+': '+tostr(CurProp^.regs[TmpReg].WState)));
InsertLLItem(AsmL, p, p.next, hp);
{$endif StateDebug}
End;
@ -2308,7 +2308,7 @@ Begin
Begin
TmpReg := Reg32(Taicpu(p).oper[1].reg);
{$ifdef statedebug}
hp := Tai_asm_comment.Create(strpnew('destroying '+att_reg2str[tmpreg]));
hp := Tai_asm_comment.Create(strpnew('destroying '+gas_reg2str[tmpreg]));
insertllitem(asml,p,p.next,hp);
{$endif statedebug}
With CurProp^.regs[TmpReg] Do
@ -2378,7 +2378,7 @@ Begin
begin
{$ifdef statedebug}
hp := Tai_asm_comment.Create(strpnew('destroying & initing'+
att_reg2str[Taicpu(p).oper[1].reg])));
gas_reg2str[Taicpu(p).oper[1].reg])));
insertllitem(asml,p,p.next,hp);
{$endif statedebug}
destroyreg(curprop,Taicpu(p).oper[1].reg,true);
@ -2404,7 +2404,7 @@ Begin
ReadReg(CurProp, TCh2Reg(InstrProp.Ch[Cnt]));
{$ifdef statedebug}
hp := Tai_asm_comment.Create(strpnew('destroying '+
att_reg2str[TCh2Reg(InstrProp.Ch[Cnt])])));
gas_reg2str[TCh2Reg(InstrProp.Ch[Cnt])])));
insertllitem(asml,p,p.next,hp);
{$endif statedebug}
DestroyReg(CurProp, TCh2Reg(InstrProp.Ch[Cnt]), true);
@ -2586,7 +2586,10 @@ End.
{
$Log$
Revision 1.28 2002-04-02 17:11:34 peter
Revision 1.29 2002-04-14 17:00:49 carl
+ att_reg2str -> gas_reg2str
Revision 1.28 2002/04/02 17:11:34 peter
* tlocation,treference update
* LOC_CONSTANT added for better constant handling
* secondadd splitted in multiple routines

View File

@ -121,7 +121,7 @@ Begin
{ registers }
new(iasmregs);
for j:=firstreg to lastreg do
iasmregs^[j] := upper(att_reg2str[j]);
iasmregs^[j] := upper(gas_reg2str[j]);
end;
@ -2129,7 +2129,10 @@ finalization
end.
{
$Log$
Revision 1.19 2002-04-04 19:06:13 peter
Revision 1.20 2002-04-14 17:01:52 carl
+ att_reg2str -> gas_reg2str
Revision 1.19 2002/04/04 19:06:13 peter
* removed unused units
* use tlocation.size in cg.a_*loc*() routines

View File

@ -87,7 +87,7 @@ interface
is_fpu(aktprocdef.rettype.def) then
tfuncretsym(aktprocdef.funcretsym).funcretstate:=vs_assigned;
if (not is_void(aktprocdef.rettype.def)) then
retstr:=upper(tostr(procinfo^.return_offset)+'('+att_reg2str[procinfo^.framepointer]+')')
retstr:=upper(tostr(procinfo^.return_offset)+'('+gas_reg2str[procinfo^.framepointer]+')')
else
retstr:='';
c:=current_scanner.asmgetchar;
@ -168,7 +168,7 @@ interface
hs:=tvarsym(sym).mangledname
else
hs:='-'+tostr(tvarsym(sym).address)+
'('+att_reg2str[procinfo^.framepointer]+')';
'('+gas_reg2str[procinfo^.framepointer]+')';
end
else
{ call to local function }
@ -191,7 +191,7 @@ interface
l:=tvarsym(sym).address;
{ set offset }
inc(l,aktprocdef.parast.address_fixup);
hs:=tostr(l)+'('+att_reg2str[procinfo^.framepointer]+')';
hs:=tostr(l)+'('+gas_reg2str[procinfo^.framepointer]+')';
if pos(',',s) > 0 then
tvarsym(sym).varstate:=vs_used;
end;
@ -237,7 +237,7 @@ interface
begin
if assigned(procinfo^._class) then
hs:=tostr(procinfo^.selfpointer_offset)+
'('+att_reg2str[procinfo^.framepointer]+')'
'('+gas_reg2str[procinfo^.framepointer]+')'
else
Message(asmr_e_cannot_use_SELF_outside_a_method);
end
@ -254,7 +254,7 @@ interface
{ we do it: }
if lexlevel>normal_function_level then
hs:=tostr(procinfo^.framepointer_offset)+
'('+att_reg2str[procinfo^.framepointer]+')'
'('+gas_reg2str[procinfo^.framepointer]+')'
else
Message(asmr_e_cannot_use_OLDEBP_outside_nested_procedure);
end;
@ -302,7 +302,10 @@ initialization
end.
{
$Log$
Revision 1.12 2001-11-02 22:58:11 peter
Revision 1.13 2002-04-14 17:01:52 carl
+ att_reg2str -> gas_reg2str
Revision 1.12 2001/11/02 22:58:11 peter
* procsym definition rewrite
Revision 1.11 2001/08/26 13:37:02 florian

View File

@ -959,7 +959,7 @@ begin
write(', ')
else
first := false;
write(att_reg2str[r])
write(gas_reg2str[r])
end;
if (firstsavefpureg <> R_NO) then
for r := firstsavefpureg to lastsavefpureg do
@ -969,7 +969,7 @@ begin
write(', ')
else
first := false;
write(att_reg2str[r])
write(gas_reg2str[r])
end;
if (firstsavemmreg <> R_NO) then
for r := firstsavemmreg to lastsavemmreg do
@ -979,7 +979,7 @@ begin
write(', ')
else
first := false;
write(att_reg2str[r])
write(gas_reg2str[r])
end;
writeln;
end;
@ -1700,7 +1700,10 @@ begin
end.
{
$Log$
Revision 1.18 2002-04-07 10:23:36 carl
Revision 1.19 2002-04-14 17:02:19 carl
+ att_reg2str -> gas_reg2str
Revision 1.18 2002/04/07 10:23:36 carl
+ added vm / sparc targets
Revision 1.17 2002/04/04 19:06:14 peter