From 2555cc8496f428ebd9a4cbc9df700ea9d240ea91 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 6 May 2004 22:01:54 +0000 Subject: [PATCH] * register numbers for address registers fixed --- compiler/m68k/aasmcpu.pas | 51 +++++++++++++++++++++------------------ compiler/m68k/cgcpu.pas | 9 ++++++- compiler/m68k/cpubase.pas | 8 ++++-- compiler/m68k/m68kreg.dat | 22 ++++++++++------- compiler/m68k/r68kcon.inc | 16 ++++++------ compiler/m68k/r68kgas.inc | 18 +++++++------- compiler/m68k/r68kgri.inc | 40 +++++++++++++++--------------- compiler/m68k/r68knum.inc | 18 +++++++------- compiler/m68k/r68ksri.inc | 42 ++++++++++++++++---------------- compiler/m68k/r68ksta.inc | 18 +++++++------- compiler/m68k/r68kstd.inc | 18 +++++++------- compiler/m68k/r68ksup.inc | 16 ++++++------ 12 files changed, 147 insertions(+), 129 deletions(-) diff --git a/compiler/m68k/aasmcpu.pas b/compiler/m68k/aasmcpu.pas index b969058c8f..5f7f7e2bc5 100644 --- a/compiler/m68k/aasmcpu.pas +++ b/compiler/m68k/aasmcpu.pas @@ -142,14 +142,14 @@ implementation constructor taicpu.op_none(op : tasmop;_size : topsize); begin - inherited create(op);; + inherited create(op); init(_size); end; constructor taicpu.op_reg(op : tasmop;_size : topsize;_op1 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=1; loadreg(0,_op1); @@ -158,7 +158,7 @@ implementation constructor taicpu.op_const(op : tasmop;_size : topsize;_op1 : longint); begin - inherited create(op);; + inherited create(op); init(_size); ops:=1; loadconst(0,aword(_op1)); @@ -167,7 +167,7 @@ implementation constructor taicpu.op_ref(op : tasmop;_size : topsize;_op1 : treference); begin - inherited create(op);; + inherited create(op); init(_size); ops:=1; loadref(0,_op1); @@ -176,7 +176,7 @@ implementation constructor taicpu.op_reg_reg(op : tasmop;_size : topsize;_op1,_op2 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadreg(0,_op1); @@ -186,7 +186,7 @@ implementation constructor taicpu.op_reg_const(op:tasmop; _size: topsize; _op1: tregister; _op2: longint); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadreg(0,_op1); @@ -196,7 +196,7 @@ implementation constructor taicpu.op_reg_ref(op : tasmop;_size : topsize;_op1 : tregister;_op2 : treference); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadreg(0,_op1); @@ -206,7 +206,7 @@ implementation constructor taicpu.op_const_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadconst(0,aword(_op1)); @@ -216,7 +216,7 @@ implementation constructor taicpu.op_const_const(op : tasmop;_size : topsize;_op1,_op2 : longint); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadconst(0,aword(_op1)); @@ -226,7 +226,7 @@ implementation constructor taicpu.op_const_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : treference); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadconst(0,aword(_op1)); @@ -236,7 +236,7 @@ implementation constructor taicpu.op_ref_reg(op : tasmop;_size : topsize;_op1 : treference;_op2 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadref(0,_op1); @@ -246,7 +246,7 @@ implementation constructor taicpu.op_ref_ref(op : tasmop;_size : topsize;_op1,_op2 : treference); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadref(0,_op1); @@ -256,7 +256,7 @@ implementation constructor taicpu.op_reg_reg_reg(op : tasmop;_size : topsize;_op1,_op2,_op3 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=3; loadreg(0,_op1); @@ -266,7 +266,7 @@ implementation constructor taicpu.op_const_reg_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=3; loadconst(0,aword(_op1)); @@ -276,7 +276,7 @@ implementation constructor taicpu.op_reg_reg_ref(op : tasmop;_size : topsize;_op1,_op2 : tregister;_op3 : treference); begin - inherited create(op);; + inherited create(op); init(_size); ops:=3; loadreg(0,_op1); @@ -287,7 +287,7 @@ implementation constructor taicpu.op_const_ref_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : treference;_op3 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=3; loadconst(0,aword(_op1)); @@ -298,7 +298,7 @@ implementation constructor taicpu.op_const_reg_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : treference); begin - inherited create(op);; + inherited create(op); init(_size); ops:=3; loadconst(0,aword(_op1)); @@ -309,7 +309,7 @@ implementation constructor taicpu.op_ref_regset(op: tasmop; _size : topsize; _op1: treference;const _op2: tcpuregisterset); Begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadref(0,_op1); @@ -318,7 +318,7 @@ implementation constructor taicpu.op_regset_ref(op: tasmop; _size : topsize;const _op1: tcpuregisterset; _op2: treference); Begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadregset(0,_op1); @@ -329,7 +329,7 @@ implementation constructor taicpu.op_reg_regset(op: tasmop; _size : topsize; _op1: tregister;const _op2: tcpuregisterset); Begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadreg(0,_op1); @@ -339,7 +339,7 @@ implementation constructor taicpu.op_regset_reg(op: tasmop; _size : topsize;const _op1: tcpuregisterset; _op2: tregister); Begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; loadregset(0,_op1); @@ -349,7 +349,7 @@ implementation constructor taicpu.op_sym(op : tasmop;_size : topsize;_op1 : tasmsymbol); begin - inherited create(op);; + inherited create(op); init(_size); ops:=1; loadsymbol(0,_op1,0); @@ -386,7 +386,7 @@ implementation constructor taicpu.op_sym_ofs_reg(op : tasmop;_size : topsize;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister); begin - inherited create(op);; + inherited create(op); init(_size); ops:=2; if ((op >= A_DBCC) and (op <= A_DBF)) @@ -426,7 +426,10 @@ implementation end. { $Log$ - Revision 1.10 2004-01-30 12:17:18 florian + Revision 1.11 2004-05-06 22:01:54 florian + * register numbers for address registers fixed + + Revision 1.10 2004/01/30 12:17:18 florian * fixed some m68k compilation problems Revision 1.9 2003/06/14 14:53:50 jonas diff --git a/compiler/m68k/cgcpu.pas b/compiler/m68k/cgcpu.pas index 3969b428ce..24b957a6df 100644 --- a/compiler/m68k/cgcpu.pas +++ b/compiler/m68k/cgcpu.pas @@ -1100,6 +1100,7 @@ unit cgcpu; tosave : tcpuregisterset; ref : treference; begin + {!!!!! tosave:=std_saved_registers; { only save the registers which are not used and must be saved } tosave:=tosave*(rg[R_INTREGISTER].used_in_proc+rg[R_ADDRESSREGISTER].used_in_proc); @@ -1107,6 +1108,7 @@ unit cgcpu; ref.direction:=dir_dec; if tosave<>[] then list.concat(taicpu.op_regset_ref(A_MOVEM,S_L,tosave,ref)); + } end; @@ -1116,6 +1118,7 @@ unit cgcpu; r:Tregister; ref : treference; begin + {!!!!!!!! torestore:=std_saved_registers; { should be intersected with used regs, no ? } torestore:=torestore*(rg[R_INTREGISTER].used_in_proc+rg[R_ADDRESSREGISTER].used_in_proc); @@ -1123,6 +1126,7 @@ unit cgcpu; ref.direction:=dir_inc; if torestore<>[] then list.concat(taicpu.op_ref_regset(A_MOVEM,S_L,ref,torestore)); + } end; @@ -1309,7 +1313,10 @@ end. { $Log$ - Revision 1.25 2004-05-06 20:30:51 florian + Revision 1.26 2004-05-06 22:01:54 florian + * register numbers for address registers fixed + + Revision 1.25 2004/05/06 20:30:51 florian * m68k compiler compilation fixed Revision 1.24 2004/04/19 21:15:12 florian diff --git a/compiler/m68k/cpubase.pas b/compiler/m68k/cpubase.pas index a31db760b1..7e1786eca9 100644 --- a/compiler/m68k/cpubase.pas +++ b/compiler/m68k/cpubase.pas @@ -368,7 +368,8 @@ unit cpubase; This value can be deduced from CALLED_USED_REGISTERS array in the GCC source. } - std_saved_registers = [RS_D2..RS_D7,RS_A2..RS_A5]; + std_saved_intregisters = [RS_D2..RS_D7]; + std_saved_addrregisters = [RS_A2..RS_A5]; {# Required parameter alignment when calling a routine declared as stdcall and cdecl. The alignment value should be the one defined by GCC or the target ABI. @@ -513,7 +514,10 @@ implementation end. { $Log$ - Revision 1.27 2004-05-06 20:30:51 florian + Revision 1.28 2004-05-06 22:01:54 florian + * register numbers for address registers fixed + + Revision 1.27 2004/05/06 20:30:51 florian * m68k compiler compilation fixed Revision 1.26 2004/04/25 21:26:16 florian diff --git a/compiler/m68k/m68kreg.dat b/compiler/m68k/m68kreg.dat index 7d5253b991..2d3a8c59eb 100644 --- a/compiler/m68k/m68kreg.dat +++ b/compiler/m68k/m68kreg.dat @@ -16,14 +16,6 @@ D4,$01,$04,d4,%d4,4 D5,$01,$05,d5,%d5,5 D6,$01,$06,d6,%d6,6 D7,$01,$07,d7,%d7,7 -A0,$01,$08,a0,%a0,8 -A1,$01,$09,a1,%a1,9 -A2,$01,$0a,a2,%a2,10 -A3,$01,$0b,a3,%a3,11 -A4,$01,$0c,a4,%a4,12 -A5,$01,$0d,a5,%a5,13 -A6,$01,$0e,a6,%a6,14 -SP,$01,$0f,sp,%sp,15 FP0,$02,$00,fp0,%fp0,16 FP1,$02,$01,fp1,%fp1,17 @@ -44,9 +36,21 @@ SFC,$05,$06,sfc,%sfc,0 VBR,$05,$07,vbr,%vbr,0 FPSR,$05,$08,fpsr,%fpsr,0 +A0,$06,$00,a0,%a0,8 +A1,$06,$01,a1,%a1,9 +A2,$06,$02,a2,%a2,10 +A3,$06,$03,a3,%a3,11 +A4,$06,$04,a4,%a4,12 +A5,$06,$05,a5,%a5,13 +A6,$06,$06,a6,%a6,14 +SP,$06,$07,sp,%sp,15 + ; ; $Log$ -; Revision 1.3 2004-04-26 11:05:28 florian +; Revision 1.4 2004-05-06 22:01:54 florian +; * register numbers for address registers fixed +; +; Revision 1.3 2004/04/26 11:05:28 florian ; + gas registers ; ; Revision 1.2 2004/04/25 21:26:16 florian diff --git a/compiler/m68k/r68kcon.inc b/compiler/m68k/r68kcon.inc index 79830ba111..2e8f8716fb 100644 --- a/compiler/m68k/r68kcon.inc +++ b/compiler/m68k/r68kcon.inc @@ -8,14 +8,6 @@ NR_D4 = tregister($01000004); NR_D5 = tregister($01000005); NR_D6 = tregister($01000006); NR_D7 = tregister($01000007); -NR_A0 = tregister($01000008); -NR_A1 = tregister($01000009); -NR_A2 = tregister($0100000a); -NR_A3 = tregister($0100000b); -NR_A4 = tregister($0100000c); -NR_A5 = tregister($0100000d); -NR_A6 = tregister($0100000e); -NR_SP = tregister($0100000f); NR_FP0 = tregister($02000000); NR_FP1 = tregister($02000001); NR_FP2 = tregister($02000002); @@ -33,3 +25,11 @@ NR_DFC = tregister($05000005); NR_SFC = tregister($05000006); NR_VBR = tregister($05000007); NR_FPSR = tregister($05000008); +NR_A0 = tregister($06000000); +NR_A1 = tregister($06000001); +NR_A2 = tregister($06000002); +NR_A3 = tregister($06000003); +NR_A4 = tregister($06000004); +NR_A5 = tregister($06000005); +NR_A6 = tregister($06000006); +NR_SP = tregister($06000007); diff --git a/compiler/m68k/r68kgas.inc b/compiler/m68k/r68kgas.inc index 7d34a6360e..ee47e9ad64 100644 --- a/compiler/m68k/r68kgas.inc +++ b/compiler/m68k/r68kgas.inc @@ -8,14 +8,6 @@ '%d5', '%d6', '%d7', -'%a0', -'%a1', -'%a2', -'%a3', -'%a4', -'%a5', -'%a6', -'%sp', '%fp0', '%fp1', '%fp2', @@ -32,4 +24,12 @@ '%dfc', '%sfc', '%vbr', -'%fpsr' +'%fpsr', +'%a0', +'%a1', +'%a2', +'%a3', +'%a4', +'%a5', +'%a6', +'%sp' diff --git a/compiler/m68k/r68kgri.inc b/compiler/m68k/r68kgri.inc index 688792da49..17ba5dc3a9 100644 --- a/compiler/m68k/r68kgri.inc +++ b/compiler/m68k/r68kgri.inc @@ -1,12 +1,12 @@ { don't edit, this file is generated from m68kreg.dat } -9, -10, -11, -12, -13, -14, -15, 26, +27, +28, +29, +30, +31, +32, +18, 1, 2, 3, @@ -15,21 +15,21 @@ 6, 7, 8, -30, -17, -18, +22, +9, +10, +11, +12, +13, +14, +15, +16, 19, +25, +17, +23, +33, 20, 21, -22, -23, 24, -27, -33, -25, -31, -16, -28, -29, -32, 0 diff --git a/compiler/m68k/r68knum.inc b/compiler/m68k/r68knum.inc index 0705ccdf2f..0dc71ce16f 100644 --- a/compiler/m68k/r68knum.inc +++ b/compiler/m68k/r68knum.inc @@ -8,14 +8,6 @@ tregister($01000004), tregister($01000005), tregister($01000006), tregister($01000007), -tregister($01000008), -tregister($01000009), -tregister($0100000a), -tregister($0100000b), -tregister($0100000c), -tregister($0100000d), -tregister($0100000e), -tregister($0100000f), tregister($02000000), tregister($02000001), tregister($02000002), @@ -32,4 +24,12 @@ tregister($05000004), tregister($05000005), tregister($05000006), tregister($05000007), -tregister($05000008) +tregister($05000008), +tregister($06000000), +tregister($06000001), +tregister($06000002), +tregister($06000003), +tregister($06000004), +tregister($06000005), +tregister($06000006), +tregister($06000007) diff --git a/compiler/m68k/r68ksri.inc b/compiler/m68k/r68ksri.inc index 9b604f6ce7..44010ba66a 100644 --- a/compiler/m68k/r68ksri.inc +++ b/compiler/m68k/r68ksri.inc @@ -1,13 +1,13 @@ { don't edit, this file is generated from m68kreg.dat } 0, -9, -10, -11, -12, -13, -14, -15, 26, +27, +28, +29, +30, +31, +32, +18, 1, 2, 3, @@ -16,20 +16,20 @@ 6, 7, 8, -30, -17, -18, +22, +9, +10, +11, +12, +13, +14, +15, +16, 19, +25, +17, +23, +33, 20, 21, -22, -23, -24, -27, -33, -25, -31, -16, -28, -29, -32 +24 diff --git a/compiler/m68k/r68ksta.inc b/compiler/m68k/r68ksta.inc index 58bd105165..ed8d142fe4 100644 --- a/compiler/m68k/r68ksta.inc +++ b/compiler/m68k/r68ksta.inc @@ -8,14 +8,6 @@ 5, 6, 7, -8, -9, -10, -11, -12, -13, -14, -15, 16, 17, 18, @@ -32,4 +24,12 @@ 0, 0, 0, -0 +0, +8, +9, +10, +11, +12, +13, +14, +15 diff --git a/compiler/m68k/r68kstd.inc b/compiler/m68k/r68kstd.inc index 26d38c58ae..3719f1f96b 100644 --- a/compiler/m68k/r68kstd.inc +++ b/compiler/m68k/r68kstd.inc @@ -8,14 +8,6 @@ 'd5', 'd6', 'd7', -'a0', -'a1', -'a2', -'a3', -'a4', -'a5', -'a6', -'sp', 'fp0', 'fp1', 'fp2', @@ -32,4 +24,12 @@ 'dfc', 'sfc', 'vbr', -'fpsr' +'fpsr', +'a0', +'a1', +'a2', +'a3', +'a4', +'a5', +'a6', +'sp' diff --git a/compiler/m68k/r68ksup.inc b/compiler/m68k/r68ksup.inc index 7bca78e761..8677c2a633 100644 --- a/compiler/m68k/r68ksup.inc +++ b/compiler/m68k/r68ksup.inc @@ -8,14 +8,6 @@ RS_D4 = $04; RS_D5 = $05; RS_D6 = $06; RS_D7 = $07; -RS_A0 = $08; -RS_A1 = $09; -RS_A2 = $0a; -RS_A3 = $0b; -RS_A4 = $0c; -RS_A5 = $0d; -RS_A6 = $0e; -RS_SP = $0f; RS_FP0 = $00; RS_FP1 = $01; RS_FP2 = $02; @@ -33,3 +25,11 @@ RS_DFC = $05; RS_SFC = $06; RS_VBR = $07; RS_FPSR = $08; +RS_A0 = $00; +RS_A1 = $01; +RS_A2 = $02; +RS_A3 = $03; +RS_A4 = $04; +RS_A5 = $05; +RS_A6 = $06; +RS_SP = $07;