diff --git a/compiler/arm/aasmcpu.pas b/compiler/arm/aasmcpu.pas index 53d7f6fdc5..08ae6f9c01 100644 --- a/compiler/arm/aasmcpu.pas +++ b/compiler/arm/aasmcpu.pas @@ -39,6 +39,7 @@ uses type taicpu = class(taicpu_abstract) + oppostfix : TOpPostfix; roundingmode : troundingmode; procedure loadshifterop(opidx:longint;const so:tshifterop); constructor op_none(op : tasmop); @@ -741,7 +742,10 @@ implementation end. { $Log$ - Revision 1.4 2003-08-25 23:20:38 florian + Revision 1.5 2003-08-27 00:27:56 florian + + same procedure as very day: today's work on arm + + Revision 1.4 2003/08/25 23:20:38 florian + started to implement FPU support for the ARM * fixed a lot of other things diff --git a/compiler/arm/cpunode.pas b/compiler/arm/cpunode.pas index 4f848a4d41..dcf241bd8f 100644 --- a/compiler/arm/cpunode.pas +++ b/compiler/arm/cpunode.pas @@ -36,6 +36,8 @@ unit cpunode; after the generic one (FK) } narmadd, + narmcal, + narmmat, //!!! narminl, narmcnv ; @@ -43,7 +45,10 @@ unit cpunode; end. { $Log$ - Revision 1.5 2003-08-25 23:20:38 florian + Revision 1.6 2003-08-27 00:27:56 florian + + same procedure as very day: today's work on arm + + Revision 1.5 2003/08/25 23:20:38 florian + started to implement FPU support for the ARM * fixed a lot of other things diff --git a/compiler/arm/cpupara.pas b/compiler/arm/cpupara.pas index 485a06bd8e..d8eaf96b89 100644 --- a/compiler/arm/cpupara.pas +++ b/compiler/arm/cpupara.pas @@ -180,13 +180,11 @@ unit cpupara; procedure assignintreg; begin - if nextintreg.number<=NR_R10 then + if nextintreg.number<=NR_R3 then begin paraloc.loc:=LOC_REGISTER; paraloc.register:=nextintreg; inc(nextintreg.number,NR_R1-NR_R0); - if target_info.abi=abi_powerpc_aix then - inc(stack_offset,4); end else begin @@ -236,27 +234,20 @@ unit cpupara; if paraloc.size = OS_NO then paraloc.size := OS_ADDR; is_64bit := paraloc.size in [OS_64,OS_S64]; - if nextintreg.number<=(NR_R10-ord(is_64bit)*(NR_R1-NR_R0)) then + if nextintreg.number<=(NR_R3-ord(is_64bit)*(NR_R1-NR_R0)) then begin paraloc.loc:=LOC_REGISTER; if is_64bit then begin - if odd((nextintreg.number-NR_R3) shr 8) and (target_info.abi=abi_powerpc_sysv) Then - inc(nextintreg.number,NR_R1-NR_R0); paraloc.registerhigh:=nextintreg; inc(nextintreg.number,NR_R1-NR_R0); - if target_info.abi=abi_powerpc_aix then - inc(stack_offset,4); end; paraloc.registerlow:=nextintreg; inc(nextintreg.number,NR_R1-NR_R0); - if target_info.abi=abi_powerpc_aix then - inc(stack_offset,4); - end else begin - nextintreg.number := NR_R11; + nextintreg.number := NR_R4; paraloc.loc:=LOC_REFERENCE; paraloc.reference.index.enum:=R_INTREGISTER; paraloc.reference.index.number:=NR_STACK_POINTER_REG; @@ -270,7 +261,7 @@ unit cpupara; LOC_FPUREGISTER: begin paraloc.size:=def_cgsize(paradef); - if nextfloatreg.enum<=R_F10 then + if nextfloatreg.enum<=R_F3 then begin paraloc.loc:=LOC_FPUREGISTER; paraloc.register:=nextfloatreg; @@ -349,7 +340,10 @@ begin end. { $Log$ - Revision 1.2 2003-08-16 13:23:01 florian + Revision 1.3 2003-08-27 00:27:56 florian + + same procedure as very day: today's work on arm + + Revision 1.2 2003/08/16 13:23:01 florian * several arm related stuff fixed Revision 1.1 2003/07/21 16:35:30 florian diff --git a/compiler/arm/narmcal.pas b/compiler/arm/narmcal.pas new file mode 100644 index 0000000000..ca07444318 --- /dev/null +++ b/compiler/arm/narmcal.pas @@ -0,0 +1,50 @@ +{ + $Id$ + Copyright (c) 2002 by Florian Klaempfl + + Implements the ARM specific part of call 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 bymethodpointer + 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 narmcal; + +{$i fpcdefs.inc} + +interface + + uses + symdef,node,ncal,ncgcal; + + type + tarmcallnode = class(tcgcallnode) + procedure push_framepointer;override; + end; + +implementation + + procedure tarmcallnode.push_framepointer; + begin + end; + +begin + ccallnode:=tarmcallnode; +end. +{ + $Log$ + Revision 1.1 2003-08-27 00:27:56 florian + + same procedure as very day: today's work on arm +} diff --git a/compiler/arm/narmmat.pas b/compiler/arm/narmmat.pas new file mode 100644 index 0000000000..1ae7891160 --- /dev/null +++ b/compiler/arm/narmmat.pas @@ -0,0 +1,107 @@ +{ + $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 + tarmnotnode = class(tcgnotnode) + procedure second_boolean;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; + +{***************************************************************************** + TARMNOTNODE +*****************************************************************************} + + procedure tarmnotnode.second_boolean; + var + hl : tasmlabel; + ins : taicpu; + begin + { if the location is LOC_JUMP, we do the secondpass after the + labels are allocated + } + if left.expectloc=LOC_JUMP then + begin + hl:=truelabel; + truelabel:=falselabel; + falselabel:=hl; + secondpass(left); + maketojumpbool(exprasmlist,left,lr_load_regvars); + hl:=truelabel; + truelabel:=falselabel; + falselabel:=hl; + location.loc:=LOC_JUMP; + end + else + begin + secondpass(left); + case left.location.loc of + LOC_FLAGS : + begin + location_copy(location,left.location); + inverse_flags(location.resflags); + end; + LOC_REGISTER, LOC_CREGISTER, LOC_REFERENCE, LOC_CREFERENCE : + begin + location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),true); + ins:=taicpu.op_reg_reg(A_MVN,left.location.register,left.location.register); + ins.oppostfix:=PF_S; + exprasmlist.concat(ins); + location_release(exprasmlist,left.location); + location_reset(location,LOC_FLAGS,OS_NO); + location.resflags:=F_EQ; + end; + else + internalerror(2003042401); + end; + end; + end; + + +begin + cnotnode:=tarmnotnode; +end. +{ + $Log$ + Revision 1.3 2003-08-27 00:27:56 florian + + same procedure as very day: today's work on arm +}