[M3devel] completing M3CG_Binary.Op?

Antony Hosking hosking at cs.purdue.edu
Thu Oct 11 02:18:03 CEST 2012


Why not simply capture the state of the existing ops?  e.g,, cvt_int.

On Oct 10, 2012, at 7:33 PM, Jay K <jay.krell at cornell.edu> wrote:

> 
> Look at M3CG_MultiPass.
> 
> For each function, it creates a record to hold the parameters.
>     So they can be later be looped over in a different order and/or multiple times.
> The record includes an enum.
> I need an enum that looks almost exactly like M3CG_Binary.Op,
> except that I need those few missing elements.
>  
>  M3CG_MultiPass already has most of this, except 
>    1) I somehow forgot got to handle a bunch of them  
>    2) I need the below diff for it to be complete, or some other nearly identical enum instead.  
>  
>  - Jay
>  
> Subject: Re: [M3devel] completing M3CG_Binary.Op?
> From: hosking at cs.purdue.edu
> Date: Wed, 10 Oct 2012 12:13:51 -0400
> CC: m3devel at elegosoft.com
> To: jay.krell at cornell.edu
> 
> I still don’t understand why the change is needed.
> 
> On Oct 10, 2012, at 11:53 AM, Jay K <jay.krell at cornell.edu> wrote:
> 
> M3CG.T, M3CG_Ops.T also same thing, I use them interchangably in email and checkin comments. My code is more careful.
> 
>  - Jay
> 
> From: hosking at cs.purdue.edu
> Date: Wed, 10 Oct 2012 02:33:13 -0400
> To: jay.krell at cornell.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] completing M3CG_Binary.Op?
> 
> Hmm.  But the M3CG calls don’t include those operations.  e.g., cvt_int is defined in M3CG_Ops.  Why wouldn’t you just have a record for that?
> 
> On Oct 10, 2012, at 1:59 AM, Jay <jay.krell at cornell.edu> wrote:
> 
> I have an array of records, one per M3CG.T call. See M3CG_MultiPass -- which I guess is where I'd put the enum, if I can't reuse the existing one.
> 
>  - Jay (briefly/pocket-sized-computer-aka-phone)
> 
> On Oct 9, 2012, at 10:35 PM, Antony Hosking <hosking at cs.purdue.edu> wrote:
> 
> Why?
> 
> On Oct 10, 2012, at 12:52 AM, Jay <jay.krell at cornell.edu> wrote:
> 
> I need an enumeration with a member per M3CG.T method. M3CG_Binary.Op is very nearly it.
> 
> 
>  - Jay (briefly/pocket-sized-computer-aka-phone)
> 
> On Oct 9, 2012, at 9:36 PM, Antony Hosking <hosking at cs.purdue.edu> wrote:
> 
> Forgive me, but I don’t understand the purpose of this change.
> 
> On Oct 10, 2012, at 12:08 AM, Jay K <jay.krell at cornell.edu> wrote:
> 
> M3CG_Binary.Op currently represents
> what we write to ".mc" files for the gcc
> backend to read in. This is very very close
> to what you'd want to fully represent M3CG.T.
> 
> 
> It missing an operation that takes a function pointer -- can't
> be stored in a file. It is missing operations that get converted
> to different operations by M3CG_Wr. There is no real
> value in the transform but it doesn't hurt either.
> 
> 
> I'd like to add the missing operations.
> It seems like a very sensible reasonable change to me.
> 
> 
> 
> ===================================================================
> RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_BinRd.m3,v
> retrieving revision 1.19
> diff -u -r1.19 M3CG_BinRd.m3
> --- M3CG_BinRd.m3	4 Sep 2012 14:29:54 -0000	1.19
> +++ M3CG_BinRd.m3	10 Oct 2012 04:04:19 -0000
> @@ -37,7 +37,7 @@
>    END;
>  
>  CONST
> -  CmdMap = ARRAY Bop OF Cmd {
> +  CmdMap = ARRAY [Bop.begin_unit..Bop.fetch_and_xor] OF Cmd {
>      Cmd {Bop.begin_unit, begin_unit},
>      Cmd {Bop.end_unit, end_unit},
>      Cmd {Bop.import_unit, import_unit},
> Index: M3CG_Binary.i3
> ===================================================================
> RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Binary.i3,v
> retrieving revision 1.6
> diff -u -r1.6 M3CG_Binary.i3
> --- M3CG_Binary.i3	1 Nov 2010 09:59:44 -0000	1.6
> +++ M3CG_Binary.i3	10 Oct 2012 04:04:19 -0000
> @@ -38,7 +38,17 @@
>      call_indirect, pop_param, pop_struct, pop_static_link,
>      load_procedure, load_static_link, comment,
>      store_ordered, load_ordered, exchange, compare_exchange, fence,
> -    fetch_and_add, fetch_and_sub, fetch_and_or, fetch_and_and, fetch_and_xor
> +    fetch_and_add, fetch_and_sub, fetch_and_or, fetch_and_and, fetch_and_xor,
> +
> +    (* These only occur in memory, not in files.
> +       Conversely, what they are converted to only occur in files,
> +       not in memory. *)
> +    set_error_handler,  (* disk: contains a pointer, silently skipped *)
> +    compare             (* converted to eq/ne/etc. *)
> +    cvt_int,            (* converted to trunc/ceiling/etc. *)
> +    fetch_and_op,       (* converted to fetch_and_add/fetch_and_sub/etc. *)
> +    if_compare,         (* converted to if_eq/if_ne/etc. *)
> +    set_compare,        (* converted to set_eq/set_ne/etc. *)
>    };

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


More information about the M3devel mailing list