x86 backend design

Stephen Weeks sweeks@intertrust.com
Mon, 26 Jun 2000 10:12:32 -0700 (PDT)


  The
> difficulty with arrayOffsets, contents, etc. is that there aren't
> "pointer" specific variants.  arrayOffsets and Contents both expect some
> pointer type (either register, global, stack offset), but with the current
> types, that's hidden away in the ty: field.

What I am proposing is something like the following in machine.sig

      structure ArrayOffsetBase:
	 sig
	    datatype t =
	       Global of Global.t
	     | Register of Register.t 
	     | StackOffset of int
	 end

Then, you would change structure Operand so that instead of

	val arrayOffset: {base: t, offset: t, ty: Type.t} -> t

you would have

	val arrayOffset: {base: ArrayOffsetBase.t, offset: t, ty: Type.t} -> t

You would of course create a new sum type for every place Operand.t
occurs on as a constructor argument in the Operand.t datatype (I count 
six such occurrences).

Does this seem reasonable?