[M3devel] cg.declare_subrange should pass on cgtype

Jay K jay.krell at cornell.edu
Thu Mar 7 03:50:25 CET 2013


For now I'll just check if min < 0, like cm3cg does.
m3gdb does not appear to use or parse out domain_typeid.
domain_typeid doesn't seem needed.


I think this stuff was clearly done slightly incorrectly in the first place.
Not a huge mistake.


There is also wierdness imho around empty subranges.
i.e. it is an unobvious language detail.
If it were up to me,
[10..0]  


would either be illegal, OR would be the same as [0..10], OR would contain the same elements as [0..10] but would iterate in reverse FOR i := FIRST([10..0]) TO LAST([10..0]) would be equivalent to FOR i := 10 to 0 BY -1.


However, it not any of those. It is legal and "empty". The FOR loop, I believe, never runs.
NUMBER of such an array is 0.



 - Jay


From: jay.krell at cornell.edu
Date: Tue, 5 Mar 2013 05:30:08 -0800
To: hosking at cs.purdue.edu
CC: m3devel at elegosoft.com; jay.krell at cornell.edu
Subject: Re: [M3devel] cg.declare_subrange should pass on cgtype


I want to view the value in a debugger. Without having to cast it.

By your reasoning, for record fields, among float, double, int32, int64, uint32, uint64, we'd only need 2.

We want strong accurate types in "declare", not just operations like "add".  
Declare_subrange: is there a point to domain_type? I.e. how about declare_subrange(cgtype, min, max)? I'd have to see if cm3cg and then m3gdb use it.

 - Jay
On Mar 4, 2013, at 10:29 PM, Tony Hosking <hosking at cs.purdue.edu> wrote:

Signedness should be irrelevant.
It is only the storage that is specified by this.The interpretation of the bits, including signed/unsigned, is in the operations performed on those bits.e.g., load 8 bits sign extended.
Why do you need to know the signedness?


Antony Hosking | Associate Professor | Computer Science | Purdue University305 N. University Street | West Lafayette | IN 47907 | USAMobile +1 765 427 5484


On Mar 5, 2013, at 5:21 PM, Jay <jay.krell at cornell.edu> wrote:Close, but also signedness.

 - Jay
On Mar 4, 2013, at 9:56 PM, Tony Hosking <hosking at cs.purdue.edu> wrote:

Isn’t it already there (implicitly) in the bitsize to be used to represent the range?The representation CG.Type chosen in the front-end dictates exactly what is needed in terms of bits (8, 16, 32, 64).The backend is supposed to respect the bitsize.So, why do you need to duplicate that information?
On Mar 5, 2013, at 4:33 PM, Jay K <jay.krell at cornell.edu> wrote:cg.declare_subrange should include the cgtype the frontend
is going to use for the type.


I'm pretty darn certain of this.


Otherwise a backend very might want/need to duplicate
the logic in m3front/types/SubrangeType.m3 SetRep.

The logic isn't that complicated, but really, declare_subrange
should take the information.

I intend to write and commit that either tonight or within a week.
I assume this is ok..as I'm pretty certain of it..


 - Jay




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


More information about the M3devel mailing list