[Instructions] [Search] [Current] [Syllabus] [Handouts] [Outlines] [Assignments]
Held Friday, November 20, 1998
Handouts
Notes
SEQ or ESEQ.
These are handled by putting the canonical IRTs in a sequence.
CALL, so that each
CALL is only used in a MOVE (which stores
the result somewhere) or EXP (which throws away the
result).
s can be executed before e1
is evaluated, as in BINOP(plus, ESEQ(s,e1), e2), we
can move the ESEQ to the top.
e1 must be evaluated before s
is executed, as in BINOP(plus, e1, ESEQ(s,e2)), then
we must create a new temporary, MOVE e1 to that temporary,
and then put stuff in the right sequence.
s) does not affect the value of the expression
(e1), then we can safely do s first
without augmenting the tree.
MOVE(MEM(TEMP(1)),CONST(1))
and MEM(TEMP(2)) commute? Not if TEMP(1) and
TEMP(2) contain the same value (which is often only possible
to determine at run time).
BINOP(op, e1, ESEQ(s, e2)) can be rewritten as
ESEQ(s, BINOP(op, e1, e2)) if s and e1 commute.
MEM
JUMP
CJUMP
MOVE
CALL
CALL that is not used in a legal format
must be translated.
CALL(fun,args)
ESEQ(MOVE(TEMP(t), CALL(fun,args)), TEMP(t))
A[++i] = i.
A[(i = i + 1; i)] = i History
Back to Canonical trees. On to Intermediate code, concluded.
[Instructions] [Search] [Current] [Syllabus] [Handouts] [Outlines] [Assignments]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Mon Nov 23 10:59:04 1998.
This page generated on Mon Nov 23 11:35:20 1998 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu