[M3devel] small set comparisons understood, now just to understand the front end code..

Jay jayk123 at hotmail.com
Tue Apr 15 13:23:38 CEST 2008


PM3 has it wrong too.
 
http://dcvs.elegosoft.com/cgi-bin/cvsweb.cgi/pm3/m3/pm3/language/modula3/m3compiler/m3front/src/misc/CG.m3?rev=1.4;content-type=text%2FplainPROCEDURE Set_compare (s: Size;  op: Cmp) =  BEGIN    IF Force_pair (commute := TRUE) THEN      op := M3CG.SwappedCompare [op];    END;    IF (s <= Target.Integer.size)      THEN cg.compare (Target.Word.cg_type, Target.Integer.cg_type, op);      ELSE cg.set_compare (AsBytes (s), op, Target.Integer.cg_type);    END;    SPop (2, "Set_eq");    SPush (Type.Int32);  END Set_compare;
 
I didn't run it and look at the generate code, but this is the same as cm3 had and it just generated <,<=,>,>= for integers.
 
Anyway, I checked in a fix for it.
 
 - Jay
 



> Date: Tue, 15 Apr 2008 07:09:19 -0400> From: hendrik at topoi.pooq.com> To: m3devel at elegosoft.com> Subject: Re: [M3devel] small set comparisons understood, now just to understand the front end code..> > On Mon, Apr 14, 2008 at 07:03:00PM +0000, Jay wrote:> > > Should also 1) check the history; I suspect it never worked 2) as a stopgap if really desparate can probably omit the optimization and just use the functions but that's lame.. well, for < and >, the inline code might be kind of large actually.. could write helpers just for int-sized sets...> > You might compare the cm3 code with the pm3 code. I think I may have > used it on pm3 long ago without mishap.> > -- hendrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080415/c65d9ad2/attachment-0002.html>


More information about the M3devel mailing list