mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 01:46:58 +02:00
* fixed reading of reg. sets in the arm assembler reader
This commit is contained in:
parent
be56bf3901
commit
256299c274
@ -187,6 +187,7 @@ unit agarmgas;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Procedure TARMGNUAssembler.WriteInstruction(hp : tai);
|
||||
var op: TAsmOp;
|
||||
s: string;
|
||||
@ -226,7 +227,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.14 2003-11-17 23:23:47 florian
|
||||
Revision 1.15 2003-11-21 16:29:26 florian
|
||||
* fixed reading of reg. sets in the arm assembler reader
|
||||
|
||||
Revision 1.14 2003/11/17 23:23:47 florian
|
||||
+ first part of arm assembler reader
|
||||
|
||||
Revision 1.13 2003/11/07 15:58:32 florian
|
||||
|
@ -759,8 +759,8 @@ unit cgcpu;
|
||||
OS_32,OS_S32:
|
||||
begin
|
||||
instr:=taicpu.op_reg_reg(A_MOV,reg2,reg1);
|
||||
add_move_instruction(instr);
|
||||
list.concat(instr);
|
||||
add_move_instruction(instr);
|
||||
end;
|
||||
else internalerror(2002090901);
|
||||
end;
|
||||
@ -954,8 +954,8 @@ unit cgcpu;
|
||||
else
|
||||
begin
|
||||
instr:=taicpu.op_reg_reg(A_MOV,r,tmpref.base);
|
||||
add_move_instruction(instr);
|
||||
list.concat(instr);
|
||||
add_move_instruction(instr);
|
||||
end;
|
||||
end;
|
||||
reference_release(list,tmpref);
|
||||
@ -1282,7 +1282,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.22 2003-11-07 15:58:32 florian
|
||||
Revision 1.23 2003-11-21 16:29:26 florian
|
||||
* fixed reading of reg. sets in the arm assembler reader
|
||||
|
||||
Revision 1.22 2003/11/07 15:58:32 florian
|
||||
* Florian's culmutative nr. 1; contains:
|
||||
- invalid calling conventions for a certain cpu are rejected
|
||||
- arm softfloat calling conventions
|
||||
|
@ -181,6 +181,11 @@ unit cpubase;
|
||||
'ge','lt','gt','le','al','nv'
|
||||
);
|
||||
|
||||
uppercond2str : array[TAsmCond] of string[2]=('',
|
||||
'EQ','NE','CS','CC','MI','PL','VS','VC','HI','LS',
|
||||
'GE','LT','GT','LE','AL','NV'
|
||||
);
|
||||
|
||||
inverse_cond : array[TAsmCond] of TAsmCond=(C_None,
|
||||
C_NE,C_EQ,C_CC,C_CS,C_PL,C_MI,C_VC,C_VS,C_LS,C_HI,
|
||||
C_LT,C_GE,C_LE,C_GT,C_None,C_None
|
||||
@ -564,7 +569,10 @@ unit cpubase;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.18 2003-11-17 23:23:47 florian
|
||||
Revision 1.19 2003-11-21 16:29:26 florian
|
||||
* fixed reading of reg. sets in the arm assembler reader
|
||||
|
||||
Revision 1.18 2003/11/17 23:23:47 florian
|
||||
+ first part of arm assembler reader
|
||||
|
||||
Revision 1.17 2003/11/02 14:30:03 florian
|
||||
|
@ -384,9 +384,10 @@ Unit raarmgas;
|
||||
|
||||
|
||||
var
|
||||
tempreg : tregister;
|
||||
tempreg,ireg : tregister;
|
||||
hl : tasmlabel;
|
||||
ofs : longint;
|
||||
registerset : tcpuregisterset;
|
||||
Begin
|
||||
expr:='';
|
||||
case actasmtoken of
|
||||
@ -396,6 +397,13 @@ Unit raarmgas;
|
||||
BuildReference(oper);
|
||||
end;
|
||||
|
||||
AS_HASH: { Constant expression }
|
||||
Begin
|
||||
Consume(AS_HASH);
|
||||
BuildConstantOperand(oper);
|
||||
end;
|
||||
|
||||
(*
|
||||
AS_INTNUM,
|
||||
AS_MINUS,
|
||||
AS_PLUS:
|
||||
@ -413,7 +421,7 @@ Unit raarmgas;
|
||||
else
|
||||
BuildReference(oper);
|
||||
end;
|
||||
|
||||
*)
|
||||
AS_ID: { A constant expression, or a Variable ref. }
|
||||
Begin
|
||||
{ Local Label ? }
|
||||
@ -519,7 +527,8 @@ Unit raarmgas;
|
||||
BuildReference(oper);
|
||||
end;
|
||||
|
||||
AS_REGISTER: { Register, a variable reference or a constant reference }
|
||||
{ Register, a variable reference or a constant reference }
|
||||
AS_REGISTER:
|
||||
Begin
|
||||
{ save the type of register used. }
|
||||
tempreg:=actasmregister;
|
||||
@ -534,6 +543,38 @@ Unit raarmgas;
|
||||
else
|
||||
Message(asmr_e_syn_operand);
|
||||
end;
|
||||
|
||||
{ Registerset }
|
||||
AS_LSBRACKET:
|
||||
begin
|
||||
consume(AS_LSBRACKET);
|
||||
registerset:=[];
|
||||
while true do
|
||||
begin
|
||||
if actasmtoken=AS_REGISTER then
|
||||
begin
|
||||
include(registerset,actasmregister);
|
||||
tempreg:=actasmregister;
|
||||
consume(AS_REGISTER);
|
||||
if actasmtoken=AS_MINUS then
|
||||
begin
|
||||
consume(AS_MINUS);
|
||||
for ireg:=tempreg to actasmregister do
|
||||
include(registerset,ireg);
|
||||
consume(AS_REGISTER);
|
||||
end;
|
||||
end
|
||||
else
|
||||
consume(AS_REGISTER);
|
||||
if actasmtoken=AS_COMMA then
|
||||
consume(AS_COMMA)
|
||||
else
|
||||
break;
|
||||
end;
|
||||
consume(AS_RSBRACKET);
|
||||
oper.opr.typ:=OPR_REGSET;
|
||||
oper.opr.regset:=registerset;
|
||||
end;
|
||||
AS_END,
|
||||
AS_SEPARATOR,
|
||||
AS_COMMA: ;
|
||||
@ -586,13 +627,7 @@ Unit raarmgas;
|
||||
if operandnum>Max_Operands then
|
||||
Message(asmr_e_too_many_operands)
|
||||
else
|
||||
begin
|
||||
{ condition operands doesn't set the operand but write to the
|
||||
condition field of the instruction
|
||||
}
|
||||
if instr.Operands[operandnum].opr.typ<>OPR_NONE then
|
||||
Inc(operandnum);
|
||||
end;
|
||||
Inc(operandnum);
|
||||
Consume(AS_COMMA);
|
||||
end;
|
||||
AS_SEPARATOR,
|
||||
@ -604,8 +639,6 @@ Unit raarmgas;
|
||||
BuildOperand(instr.Operands[operandnum] as tarmoperand);
|
||||
end; { end case }
|
||||
until false;
|
||||
if (operandnum=1) and (instr.Operands[operandnum].opr.typ=OPR_NONE) then
|
||||
dec(operandnum);
|
||||
instr.Ops:=operandnum;
|
||||
end;
|
||||
|
||||
@ -662,7 +695,7 @@ Unit raarmgas;
|
||||
begin
|
||||
for icond:=low(tasmcond) to high(tasmcond) do
|
||||
begin
|
||||
if copy(hs,1,2)=cond2str[icond] then
|
||||
if copy(hs,1,2)=uppercond2str[icond] then
|
||||
begin
|
||||
actcondition:=icond;
|
||||
{ strip condition }
|
||||
@ -750,6 +783,9 @@ initialization
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.1 2003-11-17 23:23:47 florian
|
||||
Revision 1.2 2003-11-21 16:29:26 florian
|
||||
* fixed reading of reg. sets in the arm assembler reader
|
||||
|
||||
Revision 1.1 2003/11/17 23:23:47 florian
|
||||
+ first part of arm assembler reader
|
||||
}
|
||||
|
@ -298,14 +298,17 @@ const
|
||||
procedure tcgppc.do_register_allocation(list:Taasmoutput;headertai:tai);
|
||||
begin
|
||||
{ Int }
|
||||
rgint.check_unreleasedregs;
|
||||
rgint.do_register_allocation(list,headertai);
|
||||
rgint.translate_registers(list);
|
||||
|
||||
{ FPU }
|
||||
rgfpu.check_unreleasedregs;
|
||||
rgfpu.do_register_allocation(list,headertai);
|
||||
rgfpu.translate_registers(list);
|
||||
|
||||
{ MM }
|
||||
rgmm.check_unreleasedregs;
|
||||
rgmm.do_register_allocation(list,headertai);
|
||||
rgmm.translate_registers(list);
|
||||
end;
|
||||
@ -2443,7 +2446,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.136 2003-11-02 17:19:33 florian
|
||||
Revision 1.137 2003-11-21 16:29:26 florian
|
||||
* fixed reading of reg. sets in the arm assembler reader
|
||||
|
||||
Revision 1.136 2003/11/02 17:19:33 florian
|
||||
+ copying of open array value parameters to the heap implemented
|
||||
|
||||
Revision 1.135 2003/11/02 15:20:06 jonas
|
||||
|
@ -66,7 +66,7 @@ Function SearchLabel(const s: string; var hl: tasmlabel;emit:boolean): boolean;
|
||||
|
||||
type
|
||||
TOprType=(OPR_NONE,OPR_CONSTANT,OPR_SYMBOL,OPR_LOCAL,
|
||||
OPR_REFERENCE,OPR_REGISTER,OPR_REGLIST,OPR_COND);
|
||||
OPR_REFERENCE,OPR_REGISTER,OPR_REGLIST,OPR_COND,OPR_REGSET);
|
||||
|
||||
TOprRec = record
|
||||
case typ:TOprType of
|
||||
@ -81,7 +81,10 @@ type
|
||||
{$endif m68k}
|
||||
{$ifdef powerpc}
|
||||
OPR_COND : (cond : tasmcond);
|
||||
{$endif m68k}
|
||||
{$endif powerpc}
|
||||
{$ifdef arm}
|
||||
OPR_REGSET : (regset : tcpuregisterset);
|
||||
{$endif arm}
|
||||
end;
|
||||
|
||||
TOperand = class
|
||||
@ -1121,6 +1124,10 @@ end;
|
||||
operands[i].opr.localscale,operands[i].opr.localgetoffset);
|
||||
OPR_REFERENCE:
|
||||
ai.loadref(i-1,operands[i].opr.ref);
|
||||
{$ifdef ARM}
|
||||
OPR_REGSET:
|
||||
ai.loadregset(i-1,operands[i].opr.regset);
|
||||
{$endif ARM}
|
||||
end;
|
||||
end;
|
||||
ai.SetCondition(condition);
|
||||
@ -1618,7 +1625,10 @@ end;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.78 2003-11-17 23:23:47 florian
|
||||
Revision 1.79 2003-11-21 16:29:26 florian
|
||||
* fixed reading of reg. sets in the arm assembler reader
|
||||
|
||||
Revision 1.78 2003/11/17 23:23:47 florian
|
||||
+ first part of arm assembler reader
|
||||
|
||||
Revision 1.77 2003/11/12 16:05:39 florian
|
||||
|
Loading…
Reference in New Issue
Block a user