[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Wed Feb 10 14:53:11 CET 2010
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 10/02/10 14:53:11
Modified files:
cm3/m3-sys/m3front/src/misc/: CG.m3
Log message:
reapply Tony's fix for longint initialization
compare with http://dcvs.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-sys/m3front/src/misc/CG.m3.diff?r1=1.21;r2=1.22
seemingly identical except in the mean time "n_bits" renamed to "excess"
It works now that TWord.Extract has no size limit and just assumes zero extension.
Index: CG.m3
===================================================================
RCS file: /usr/cvs/cm3/m3-sys/m3front/src/misc/CG.m3,v
retrieving revision 1.31
diff -u -r1.31 CG.m3
--- CG.m3 8 Feb 2010 13:10:06 -0000 1.31
+++ CG.m3 10 Feb 2010 13:51:58 -0000
@@ -107,6 +107,9 @@
PROCEDURE Init () =
BEGIN
+
+ <* ASSERT TInt.Zero.n = Target.Longint.bytes *>
+
Max_alignment := Target.Alignments [LAST (Target.Alignments)];
FOR t := FIRST (Type) TO LAST (Type) DO StackType[t] := t; END;
@@ -143,7 +146,7 @@
fields[TRUE] := NIL;
in_init := FALSE;
init_pc := 0;
- init_bits := Target.Int{Target.Integer.bytes, Target.IBytes{0,..}};
+ init_bits := TInt.Zero;
free_temps := NIL;
busy_temps := NIL;
free_values := NIL;
@@ -797,7 +800,7 @@
cg.begin_init (v);
in_init := TRUE;
init_pc := 0;
- init_bits := Target.Int{Target.Integer.bytes, Target.IBytes{0,..}};
+ init_bits := TInt.Zero;
END Begin_init;
PROCEDURE End_init (v: Var) =
@@ -940,10 +943,10 @@
(* send out some number of bytes *)
EVAL FindInitType (n_bytes, init_pc, t);
size := TargetMap.CG_Size[t];
- excess := Target.Integer.size - size;
+ excess := Target.Longint.size - size;
IF (excess = 0) THEN
cg.init_int (init_pc DIV Target.Byte, init_bits, t);
- init_bits := Target.Int{Target.Integer.bytes, Target.IBytes{0,..}};
+ init_bits := TInt.Zero;
ELSIF Target.Little_endian
AND TWord.Extract (init_bits, 0, size, tmp)
AND TWord.Extract (init_bits, size, excess, new_bits) THEN
@@ -970,7 +973,7 @@
FOR i := LAST (TargetMap.Integer_types)
TO FIRST (TargetMap.Integer_types) BY -1 DO
WITH z = TargetMap.Integer_types[i] DO
- IF (z.bytes <= n_bytes) AND (z.size <= Target.Integer.size)
+ IF (z.bytes <= n_bytes)
AND (offset MOD z.align = 0) THEN
t := z.cg_type;
RETURN TRUE;
@@ -994,7 +997,7 @@
AdvanceInit (o);
IF Target.Little_endian
THEN bit_offset := o - init_pc;
- ELSE bit_offset := Target.Integer.size - (o - init_pc) - s;
+ ELSE bit_offset := Target.Longint.size - (o - init_pc) - s;
END;
IF (o = init_pc)
More information about the M3commit
mailing list