aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/g-opt.boot6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 8224b450..47f3ca2d 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -714,14 +714,20 @@ optBge ['%bge,a,b] ==
optIadd(x is ['%iadd,a,b]) ==
integer? a and integer? b => a + b
+ integer? a and a = 0 => b
+ integer? b and b = 0 => a
x
optIsub(x is ['%isub,a,b]) ==
integer? a and integer? b => a - b
+ integer? a and a = 0 => ['%ineg,b]
+ integer? b and b = 0 => a
x
optImul(x is ['%imul,a,b]) ==
integer? a and integer? b => a * b
+ integer? a and a = 1 => b
+ integer? b and b = 1 => a
x
optIneg(x is ['%ineg,a]) ==