From 35b8e930737b8d21f71fd0521452990a7c61db07 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 30 Jan 2004 13:42:03 +0000 Subject: [PATCH] * fixed more alignment issues --- compiler/aasmtai.pas | 13 +++++-- compiler/aoptobj.pas | 7 ++-- compiler/powerpc/cpubase.pas | 70 +++--------------------------------- compiler/ppu.pas | 9 +++-- compiler/rabase.pas | 7 ++-- compiler/symtable.pas | 15 ++++++-- compiler/systems.pas | 13 ++++--- compiler/utils/mk68kreg.pp | 9 +++-- compiler/x86/cpubase.pas | 9 +++-- 9 files changed, 62 insertions(+), 90 deletions(-) diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index c6bcac1e61..991f8b1341 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -141,8 +141,9 @@ interface toptype=(top_none,top_reg,top_ref,top_const,top_symbol,top_bool,top_local, { ARM only } top_regset, - { ARM only } - top_shifterop); + top_shifterop, + { m68k only } + top_reglist); { kinds of operations that an instruction can perform on an operand } topertype = (operand_read,operand_write,operand_readwrite); @@ -163,6 +164,9 @@ interface top_regset : (regset:^tcpuregisterset); top_shifterop : (shifterop : pshifterop); {$endif arm} + {$ifdef m68k} + top_regset : (regset:^tcpuregisterset); + {$endif m68k} end; poper=^toper; @@ -1971,7 +1975,10 @@ implementation end. { $Log$ - Revision 1.67 2004-01-26 16:12:27 daniel + Revision 1.68 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.67 2004/01/26 16:12:27 daniel * reginfo now also only allocated during register allocation * third round of gdb cleanups: kick out most of concatstabto diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas index 93913f0e6e..4985938c93 100644 --- a/compiler/aoptobj.pas +++ b/compiler/aoptobj.pas @@ -85,7 +85,7 @@ Type { structure or to improve alignment } TStateInt = Byte; - TContent = Packed Record + TContent = Record { start and end of block instructions that defines the } { content of this register. If Typ = con_const, then } { Longint(StartMod) = value of the constant) } @@ -788,7 +788,10 @@ End. { $Log$ - Revision 1.8 2002-11-18 17:31:54 peter + Revision 1.9 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.8 2002/11/18 17:31:54 peter * pass proccalloption to ret_in_xxx and push_xxx functions Revision 1.7 2002/08/18 18:16:55 florian diff --git a/compiler/powerpc/cpubase.pas b/compiler/powerpc/cpubase.pas index 66d8f81166..5283687878 100644 --- a/compiler/powerpc/cpubase.pas +++ b/compiler/powerpc/cpubase.pas @@ -364,71 +364,6 @@ uses const max_operands = 5; -(* - {# Table of registers which can be allocated by the code generator - internally, when generating the code. - } - { legend: } - { xxxregs = set of all possibly used registers of that type in the code } - { generator } - { usableregsxxx = set of all 32bit components of registers that can be } - { possible allocated to a regvar or using getregisterxxx (this } - { excludes registers which can be only used for parameter } - { passing on ABI's that define this) } - { c_countusableregsxxx = amount of registers in the usableregsxxx set } - - maxintregs = 18; - { to determine how many registers to use for regvars } - maxintscratchregs = 3; - usableregsint = [RS_R13..RS_R27]; - c_countusableregsint = 18; - - maxfpuregs = 31-14+1; - usableregsfpu = [RS_F14..RS_F31]; - c_countusableregsfpu = 31-14+1; - - usableregsmm = [RS_M14..RS_M31]; - c_countusableregsmm = 31-14+1; - - { no distinction on this platform } - maxaddrregs = 0; - addrregs = []; - usableregsaddr = []; - c_countusableregsaddr = 0; - - firstsaveintreg = RS_R13; - lastsaveintreg = RS_R31; - firstsavefpureg = RS_F14; - lastsavefpureg = RS_F31; - { no altivec support yet. Need to override tcgobj.a_loadmm_* first in tcgppc } - firstsavemmreg = RS_INVALID; - lastsavemmreg = RS_INVALID; - - maxvarregs = 15; - varregs : Array [1..maxvarregs] of Tsuperregister = - (RS_R14,RS_R15,RS_R16,RS_R17,RS_R18,RS_R19,RS_R20,RS_R21, - RS_R22,RS_R23,RS_R24,RS_R25,RS_R26,RS_R27,RS_R28); - - maxfpuvarregs = 31-14+1; - fpuvarregs : Array [1..maxfpuvarregs] of Tsuperregister = - (RS_F14,RS_F15,RS_F16,RS_F17,RS_F18,RS_F19,RS_F20,RS_F21,RS_F22,RS_F23, - RS_F24,RS_F25,RS_F26,RS_F27,RS_F28,RS_F29,RS_F30,RS_F31); - -{ -// max_param_regs_int = 8; -// param_regs_int: Array[1..max_param_regs_int] of Tsuperregister = -// (R_3,R_4,R_5,R_6,R_7,R_8,R_9,R_10); - -// max_param_regs_fpu = 13; -// param_regs_fpu: Array[1..max_param_regs_fpu] of Toldregister = -// (RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,RS_F10,RS_F11,RS_F12,RS_F13); - - max_param_regs_mm = 13; - param_regs_mm: Array[1..max_param_regs_mm] of Toldregister = - (R_M1,R_M2,R_M3,R_M4,R_M5,R_M6,R_M7,R_M8,R_M9,R_M10,R_M11,R_M12,R_M13); -} - -*) {***************************************************************************** Default generic sizes @@ -694,7 +629,10 @@ implementation end. { $Log$ - Revision 1.82 2004-01-10 00:16:21 jonas + Revision 1.83 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.82 2004/01/10 00:16:21 jonas * fixed mtfsb0 instruction for assembler reader/writer * fixed initialisation of fpscr register to avoid spurious SIGPFE's (uses mtfsb0 instruction, so added extra define in options.pas to avoid diff --git a/compiler/ppu.pas b/compiler/ppu.pas index 45b774616d..dde2c3cacd 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -41,7 +41,7 @@ type {$endif Test_Double_checksum} const - CurrentPPUVersion=38; + CurrentPPUVersion=39; { buffer sizes } maxentrysize = 1024; @@ -153,9 +153,9 @@ type end; tppuentry=packed record + size : longint; id : byte; nr : byte; - size : longint; end; tppufile=class @@ -993,7 +993,10 @@ end; end. { $Log$ - Revision 1.44 2003-11-10 22:02:52 peter + Revision 1.45 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.44 2003/11/10 22:02:52 peter * cross unit inlining fixed Revision 1.43 2003/10/22 20:40:00 peter diff --git a/compiler/rabase.pas b/compiler/rabase.pas index 6108b407bd..26eebb8e26 100644 --- a/compiler/rabase.pas +++ b/compiler/rabase.pas @@ -39,7 +39,7 @@ unit rabase; tcbaseasmreader = class of tbaseasmreader; pasmmodeinfo = ^tasmmodeinfo; - tasmmodeinfo = packed record + tasmmodeinfo = record id : tasmmode; idtxt : string[8]; casmreader : tcbaseasmreader; @@ -106,7 +106,10 @@ finalization end. { $Log$ - Revision 1.2 2003-11-12 16:58:42 peter + Revision 1.3 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.2 2003/11/12 16:58:42 peter * fixed wrong initialization Revision 1.1 2003/11/12 16:05:39 florian diff --git a/compiler/symtable.pas b/compiler/symtable.pas index 5dd644251c..4c0e08f5d7 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -1141,7 +1141,7 @@ implementation var ps,nps : tvarsym; pd,npd : tdef; - varalignrecord, + varalignrecord,varalign, storesize,storealign : longint; begin storesize:=datasize; @@ -1162,8 +1162,14 @@ implementation symsearch.insert(ps); { update address } ps.fieldoffset:=datasize; + { update alignment of this record } - varalignrecord:=used_align(ps.vartype.def.alignment,aktalignment.recordalignmin,aktalignment.recordalignmax); + varalign:=ps.vartype.def.alignment; + { + if varalign=0 then + varalign:=size_2_align(ps.getvaluesize); + } + varalignrecord:=used_align(varalign,aktalignment.recordalignmin,aktalignment.recordalignmax); recordalignment:=max(recordalignment,varalignrecord); { next } ps:=nps; @@ -2333,7 +2339,10 @@ implementation end. { $Log$ - Revision 1.129 2004-01-29 16:51:29 peter + Revision 1.130 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.129 2004/01/29 16:51:29 peter * fixed alignment calculation for variant records * fixed alignment padding of records diff --git a/compiler/systems.pas b/compiler/systems.pas index c23b96b596..8773c31c28 100644 --- a/compiler/systems.pas +++ b/compiler/systems.pas @@ -179,7 +179,7 @@ interface palignmentinfo = ^talignmentinfo; - talignmentinfo = packed record + talignmentinfo = record procalign, loopalign, jumpalign, @@ -195,7 +195,7 @@ interface end; pasminfo = ^tasminfo; - tasminfo = packed record + tasminfo = record id : tasm; idtxt : string[9]; asmbin : string[8]; @@ -211,13 +211,13 @@ interface end; parinfo = ^tarinfo; - tarinfo = packed record + tarinfo = record id : tar; arcmd : string[50]; end; presinfo = ^tresinfo; - tresinfo = packed record + tresinfo = record id : tres; resbin : string[8]; rescmd : string[50]; @@ -650,7 +650,10 @@ finalization end. { $Log$ - Revision 1.81 2004-01-28 15:36:46 florian + Revision 1.82 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.81 2004/01/28 15:36:46 florian * fixed another couple of arm bugs Revision 1.80 2004/01/21 20:53:50 marco diff --git a/compiler/utils/mk68kreg.pp b/compiler/utils/mk68kreg.pp index 5f3ab86a2b..1acc0f3ccb 100644 --- a/compiler/utils/mk68kreg.pp +++ b/compiler/utils/mk68kreg.pp @@ -257,9 +257,9 @@ begin end else first:=false; - writeln(confile,'NR_',names[i],' = ',numbers[i],';'); writeln(supfile,'RS_',names[i],' = ',supregs[i],';'); - write(numfile,'NR_',names[i]); + writeln(confile,'NR_'+names[i],' = ','tregister(',numbers[i],')',';'); + write(numfile,'tregister(',numbers[i],')'); write(stdfile,'''',stdnames[i],''''); write(stabfile,stabs[i]); write(rnifile,regnumber_index[i]); @@ -293,6 +293,9 @@ begin end. { $Log$ -Revision 1.2 2003-12-10 02:22:59 karoly +Revision 1.3 2004-01-30 13:42:03 florian + * fixed more alignment issues + +Revision 1.2 2003/12/10 02:22:59 karoly * fixed logs } diff --git a/compiler/x86/cpubase.pas b/compiler/x86/cpubase.pas index 00533af4d9..3cf4d955c4 100644 --- a/compiler/x86/cpubase.pas +++ b/compiler/x86/cpubase.pas @@ -228,7 +228,7 @@ uses type { reference record } preference = ^treference; - treference = packed record + treference = record segment, base, index : tregister; @@ -253,7 +253,7 @@ uses References are given from the caller's point of view. The usual TLocation isn't used, because contains a lot of unnessary fields. } - tparalocation = packed record + tparalocation = record size : TCGSize; loc : TCGLoc; alignment : byte; @@ -535,7 +535,10 @@ implementation end. { $Log$ - Revision 1.37 2004-01-15 14:01:32 florian + Revision 1.38 2004-01-30 13:42:03 florian + * fixed more alignment issues + + Revision 1.37 2004/01/15 14:01:32 florian + x86 instruction tables for x86-64 extended Revision 1.36 2004/01/14 23:39:05 florian