[M3devel] int32 vs. integer in compare result?

Tony Hosking hosking at cs.purdue.edu
Sun Dec 20 19:15:50 CET 2009


Yes, this seems odd...

Of course, the result is supposed to be a Boolean.  Will it matter?

On 20 Dec 2009, at 09:57, Jay K wrote:

> In m3front\src\misc\CG.m3:
>  
> PROCEDURE Compare (t: ZType;  op: Cmp) =
>   BEGIN
>     IF Force_pair (commute := TRUE) THEN
>       op := M3CG.SwappedCompare [op];
>     END;
>     cg.compare (t, Target.Integer.cg_type, op);
>     SPop (2, "Compare");
>     SPush (Type.Int32);
>   END Compare;
> 
>  
> compare(input type, output type, operation)
>  
> The integrated backend ignores the output type.
> The gcc backend does not.
>  
> Doesn't it seem like in the above, Target.Integer and Int32 should match?
> That compare is being asked to return a possibly larger result than the
> front end expects?
>  
>  - Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091220/b8d2bed5/attachment-0002.html>


More information about the M3devel mailing list