[M3devel] completing M3CG_Binary.Op?

Antony Hosking hosking at cs.purdue.edu
Wed Oct 10 06:36:36 CEST 2012


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/412d86ff/attachment-0002.html>


More information about the M3devel mailing list