mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 23:19:24 +02:00
* continued to work on the arm port
This commit is contained in:
parent
284d18b7ca
commit
9edd2b0401
@ -39,6 +39,7 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
taicpu = class(taicpu_abstract)
|
taicpu = class(taicpu_abstract)
|
||||||
|
procedure loadshifterop(opidx:longint;const so:tshifterop);
|
||||||
constructor op_none(op : tasmop);
|
constructor op_none(op : tasmop);
|
||||||
|
|
||||||
constructor op_reg(op : tasmop;_op1 : tregister);
|
constructor op_reg(op : tasmop;_op1 : tregister);
|
||||||
@ -57,6 +58,7 @@ uses
|
|||||||
constructor op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister; const _op3: treference);
|
constructor op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister; const _op3: treference);
|
||||||
constructor op_const_reg_reg(op : tasmop;_op1 : longint;_op2, _op3 : tregister);
|
constructor op_const_reg_reg(op : tasmop;_op1 : longint;_op2, _op3 : tregister);
|
||||||
constructor op_const_reg_const(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : longint);
|
constructor op_const_reg_const(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : longint);
|
||||||
|
constructor op_reg_reg_shifterop(op : tasmop;_op1,_op2 : tregister;_op3 : tshifterop);
|
||||||
|
|
||||||
constructor op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
constructor op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
||||||
|
|
||||||
@ -94,7 +96,23 @@ uses
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses cutils,rgobj;
|
uses
|
||||||
|
cutils,rgobj;
|
||||||
|
|
||||||
|
|
||||||
|
procedure taicpu.loadshifterop(opidx:longint;const so:tshifterop);
|
||||||
|
begin
|
||||||
|
if opidx>=ops then
|
||||||
|
ops:=opidx+1;
|
||||||
|
with oper[opidx] do
|
||||||
|
begin
|
||||||
|
if typ<>top_shifterop then
|
||||||
|
new(shifterop);
|
||||||
|
shifterop^:=so;
|
||||||
|
typ:=top_shifterop;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
taicpu Constructors
|
taicpu Constructors
|
||||||
@ -259,6 +277,20 @@ uses cutils,rgobj;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
constructor taicpu.op_reg_reg_shifterop(op : tasmop;_op1,_op2 : tregister;_op3 : tshifterop);
|
||||||
|
begin
|
||||||
|
inherited create(op);
|
||||||
|
if (_op1.enum = R_INTREGISTER) and (_op1.number = NR_NO) then
|
||||||
|
internalerror(200308233);
|
||||||
|
if (_op2.enum = R_INTREGISTER) and (_op2.number = NR_NO) then
|
||||||
|
internalerror(200308233);
|
||||||
|
ops:=3;
|
||||||
|
loadreg(0,_op1);
|
||||||
|
loadreg(1,_op2);
|
||||||
|
loadshifterop(2,_op3);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
constructor taicpu.op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
constructor taicpu.op_reg_reg_reg_reg(op : tasmop;_op1,_op2,_op3,_op4 : tregister);
|
||||||
begin
|
begin
|
||||||
inherited create(op);
|
inherited create(op);
|
||||||
@ -719,7 +751,10 @@ uses cutils,rgobj;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2003-08-20 15:50:12 florian
|
Revision 1.3 2003-08-24 12:27:26 florian
|
||||||
|
* continued to work on the arm port
|
||||||
|
|
||||||
|
Revision 1.2 2003/08/20 15:50:12 florian
|
||||||
* more arm stuff
|
* more arm stuff
|
||||||
|
|
||||||
Revision 1.1 2003/08/16 13:23:01 florian
|
Revision 1.1 2003/08/16 13:23:01 florian
|
||||||
|
@ -135,7 +135,7 @@ unit agarmgas;
|
|||||||
internalerror(200303121);
|
internalerror(200303121);
|
||||||
getopstr_jmp:=std_reg2str[o.reg.enum];
|
getopstr_jmp:=std_reg2str[o.reg.enum];
|
||||||
end;
|
end;
|
||||||
top_shifter:
|
top_shifterop:
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
{ no top_ref jumping for powerpc }
|
{ no top_ref jumping for powerpc }
|
||||||
@ -179,7 +179,7 @@ unit agarmgas;
|
|||||||
internalerror(200303125);
|
internalerror(200303125);
|
||||||
getopstr:=std_reg2str[o.reg.enum];
|
getopstr:=std_reg2str[o.reg.enum];
|
||||||
end;
|
end;
|
||||||
top_shifter:
|
top_shifterop:
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
top_const:
|
top_const:
|
||||||
@ -273,7 +273,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2003-08-20 15:50:12 florian
|
Revision 1.3 2003-08-24 12:27:26 florian
|
||||||
|
* continued to work on the arm port
|
||||||
|
|
||||||
|
Revision 1.2 2003/08/20 15:50:12 florian
|
||||||
* more arm stuff
|
* more arm stuff
|
||||||
|
|
||||||
Revision 1.1 2003/08/16 13:23:01 florian
|
Revision 1.1 2003/08/16 13:23:01 florian
|
||||||
|
@ -252,6 +252,29 @@ unit cgcpu;
|
|||||||
|
|
||||||
procedure tcgarm.a_op_const_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; reg: TRegister);
|
procedure tcgarm.a_op_const_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; reg: TRegister);
|
||||||
begin
|
begin
|
||||||
|
{
|
||||||
|
shifterop_reset(so);
|
||||||
|
{ determine operator }
|
||||||
|
if nodetype=shln then
|
||||||
|
so.shiftertype:=SO_LSL
|
||||||
|
else
|
||||||
|
so.shiftertype:=SO_LSR;
|
||||||
|
{ shifting by a constant directly coded: }
|
||||||
|
if (right.nodetype=ordconstn) then
|
||||||
|
begin
|
||||||
|
so.shiftimm:=tordconstnode(right).value and 31;
|
||||||
|
a_op_reg_reg_shifterop(exprasmlist,op,OS_32,hregister1,resultreg,so)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ load shift count in a register if necessary }
|
||||||
|
location_force_reg(exprasmlist,right.location,def_cgsize(right.resulttype.def),true);
|
||||||
|
hregister2 := right.location.register;
|
||||||
|
so.rs:=hregister2;
|
||||||
|
a_op_reg_reg_reg(exprasmlist,op,OS_32,hregister2,hregister1,resultreg);
|
||||||
|
rg.UnGetRegisterInt(exprasmlist,hregister2);
|
||||||
|
end;
|
||||||
|
}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -507,7 +530,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2003-08-21 03:14:00 florian
|
Revision 1.4 2003-08-24 12:27:26 florian
|
||||||
|
* continued to work on the arm port
|
||||||
|
|
||||||
|
Revision 1.3 2003/08/21 03:14:00 florian
|
||||||
* arm compiler can be compiled; far from being working
|
* arm compiler can be compiled; far from being working
|
||||||
|
|
||||||
Revision 1.2 2003/08/20 15:50:12 florian
|
Revision 1.2 2003/08/20 15:50:12 florian
|
||||||
|
@ -266,7 +266,7 @@ uses
|
|||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
{ Types of operand }
|
{ Types of operand }
|
||||||
toptype=(top_none,top_reg,top_ref,top_const,top_symbol,top_regset,top_shifter);
|
toptype=(top_none,top_reg,top_ref,top_const,top_symbol,top_regset,top_shifterop);
|
||||||
|
|
||||||
tupdatereg = (UR_None,UR_Update);
|
tupdatereg = (UR_None,UR_Update);
|
||||||
|
|
||||||
@ -276,8 +276,7 @@ uses
|
|||||||
pshifterop = ^tshifterop;
|
pshifterop = ^tshifterop;
|
||||||
|
|
||||||
tshifterop = record
|
tshifterop = record
|
||||||
imm : dword;
|
shiftertype : tshiftertype;
|
||||||
rm : tregister;
|
|
||||||
rs : tregister;
|
rs : tregister;
|
||||||
shiftimm : byte;
|
shiftimm : byte;
|
||||||
end;
|
end;
|
||||||
@ -290,7 +289,7 @@ uses
|
|||||||
top_const : (val:aword);
|
top_const : (val:aword);
|
||||||
top_symbol : (sym:tasmsymbol;symofs:longint);
|
top_symbol : (sym:tasmsymbol;symofs:longint);
|
||||||
top_regset : (regset:tsupregset);
|
top_regset : (regset:tsupregset);
|
||||||
top_shifter : (shifterop : pshifterop);
|
top_shifterop : (shifterop : pshifterop);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
@ -591,6 +590,8 @@ uses
|
|||||||
function flags_to_cond(const f: TResFlags) : TAsmCond;
|
function flags_to_cond(const f: TResFlags) : TAsmCond;
|
||||||
function supreg_name(r:Tsuperregister):string;
|
function supreg_name(r:Tsuperregister):string;
|
||||||
|
|
||||||
|
procedure shifterop_reset(var so : tshifterop);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
procedure convert_register_to_enum(var r:Tregister);
|
procedure convert_register_to_enum(var r:Tregister);
|
||||||
@ -630,12 +631,19 @@ implementation
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure shifterop_reset(var so : tshifterop);
|
||||||
|
begin
|
||||||
|
FillChar(so,sizeof(so),0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2003-08-21 03:14:00 florian
|
Revision 1.6 2003-08-24 12:27:26 florian
|
||||||
|
* continued to work on the arm port
|
||||||
|
|
||||||
|
Revision 1.5 2003/08/21 03:14:00 florian
|
||||||
* arm compiler can be compiled; far from being working
|
* arm compiler can be compiled; far from being working
|
||||||
|
|
||||||
Revision 1.4 2003/08/20 15:50:13 florian
|
Revision 1.4 2003/08/20 15:50:13 florian
|
||||||
|
@ -37,14 +37,16 @@ unit cpunode;
|
|||||||
}
|
}
|
||||||
narmadd,
|
narmadd,
|
||||||
//!!! narminl,
|
//!!! narminl,
|
||||||
narmmat,
|
|
||||||
narmcnv
|
narmcnv
|
||||||
;
|
;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2003-08-21 23:24:08 florian
|
Revision 1.4 2003-08-24 12:27:26 florian
|
||||||
|
* continued to work on the arm port
|
||||||
|
|
||||||
|
Revision 1.3 2003/08/21 23:24:08 florian
|
||||||
* continued to work on the arm skeleton
|
* continued to work on the arm skeleton
|
||||||
|
|
||||||
Revision 1.2 2003/08/21 03:14:00 florian
|
Revision 1.2 2003/08/21 03:14:00 florian
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
{
|
|
||||||
$Id$
|
|
||||||
Copyright (c) 1998-2002 by Florian Klaempfl
|
|
||||||
|
|
||||||
Generate ARM assembler for math nodes
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
|
|
||||||
****************************************************************************
|
|
||||||
}
|
|
||||||
unit narmmat;
|
|
||||||
|
|
||||||
{$i fpcdefs.inc}
|
|
||||||
|
|
||||||
interface
|
|
||||||
|
|
||||||
uses
|
|
||||||
node,nmat,ncgmat;
|
|
||||||
|
|
||||||
type
|
|
||||||
tarmmoddivnode = class(tmoddivnode)
|
|
||||||
procedure pass_2;override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
tarmshlshrnode = class(tshlshrnode)
|
|
||||||
procedure pass_2;override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
implementation
|
|
||||||
|
|
||||||
uses
|
|
||||||
globtype,systems,
|
|
||||||
cutils,verbose,globals,
|
|
||||||
symconst,symdef,
|
|
||||||
aasmbase,aasmcpu,aasmtai,
|
|
||||||
defutil,
|
|
||||||
cgbase,cgobj,pass_1,pass_2,
|
|
||||||
ncon,
|
|
||||||
cpubase,cpuinfo,cginfo,
|
|
||||||
ncgutil,cgcpu,cg64f32,rgobj;
|
|
||||||
|
|
||||||
{*****************************************************************************
|
|
||||||
TARMMODDIVNODE
|
|
||||||
*****************************************************************************}
|
|
||||||
|
|
||||||
procedure tarmmoddivnode.pass_2;
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
{*****************************************************************************
|
|
||||||
TARMSHLRSHRNODE
|
|
||||||
*****************************************************************************}
|
|
||||||
|
|
||||||
procedure tarmshlshrnode.pass_2;
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
cmoddivnode:=tarmmoddivnode;
|
|
||||||
cshlshrnode:=tarmshlshrnode;
|
|
||||||
end.
|
|
||||||
{
|
|
||||||
$Log$
|
|
||||||
Revision 1.1 2003-08-21 23:23:59 florian
|
|
||||||
* continued to work on the arm skeleton
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user