From 0b252ef7247d7c46b66c8996d52e80cff75e7062 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 28 Jul 2010 03:02:17 +0000 Subject: * interp/g-opt.boot: Transform %iquo and %irem expressions. ($VMsideEffectFreeOperators): Include %irem and %iquo. --- src/ChangeLog | 5 +++++ src/interp/g-opt.boot | 11 +++++++++++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 564676c1..981e07de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-07-27 Gabriel Dos Reis + + * interp/g-opt.boot: Transform %iquo and %irem expressions. + ($VMsideEffectFreeOperators): Include %irem and %iquo. + 2010-07-27 Gabriel Dos Reis * boot/tokens.boot: quo and rem are now keywords and infix operators. diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index ca4dd8a4..af4eb981 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -443,6 +443,7 @@ $VMsideEffectFreeOperators == %beq %blt %ble %bgt %bge %bitand %bitior %bitnot %bcompl %icst0 %icst1 %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd? %iinc + %irem %iquo %feq %flt %fle %fgt %fge %fmul %fadd %fsub %fexp %fmin %fmax %float? %fpow %fdiv %fneg %i2f %fminval %fmaxval %fbase %fprec %ftrunc %nil %pair? %lconcat %llength %lfirst %lsecond %lthird @@ -732,6 +733,14 @@ optIneg(x is ['%ineg,a]) == integer? a => -a x +optIrem(x is ['%irem,a,b]) == + integer? a and integer? b => a rem b + x + +optIquo(x is ['%iquo,a,b]) == + integer? a and integer? b => a quo b + x + --% --% optimizer hash table --% @@ -755,6 +764,8 @@ for x in '( (%call optCall) _ (%ineg optIneg)_ (%iadd optIadd)_ (%isub optIsub)_ + (%irem optIrem)_ + (%iquo optIquo)_ (%imul optImul)_ (LIST optLIST)_ (QSMINUS optQSMINUS)_ -- cgit v1.2.3