aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/g-opt.boot2
-rw-r--r--src/interp/g-util.boot16
3 files changed, 16 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 37929af2..7cfdc4e1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2010-06-27 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-util.boot: Add new opcode %before?.
+ * interp/g-opt.boot ($VMsideEffectFreeOperators): Include it.
+
+2010-06-27 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* algebra/matcat.spad.pamphlet (MatrixCategory) [matrix]:
Add overload that takes sizes and function to compute entries.
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 8c7c4a10..6786bbbf 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -479,7 +479,7 @@ $VMsideEffectFreeOperators ==
%nil %pair? %lconcat %llength %lfirst %lsecond %lthird
%lreverse %lempty? %hash %ismall? %string? %f2s
%ceq %clt %cle %cgt %cge %c2i %i2c
- %vref %vlength)
+ %vref %vlength %before?)
++ List of simple VM operators
$simpleVMoperators ==
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 97519045..284a7e98 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -227,6 +227,9 @@ expandPeq ['%peq,x,y] ==
y = '%nil => ['NULL,expandToVMForm x]
['EQ,expandToVMForm x, expandToVMForm y]
+expandBefore? ['%before?,x,y] ==
+ ['GGREATER,expandToVMForm y,expandToVMForm x]
+
-- Integer operations
expandIneg ['%ineg,x] ==
x := expandToVMForm x
@@ -393,8 +396,8 @@ for x in [
++ Table of opcode-expander pairs.
for x in [
- ['%collect,:function expandCollect],
- ['%loop, :function expandLoop],
+ ['%collect, :function expandCollect],
+ ['%loop, :function expandLoop],
['%return, :function expandReturn],
['%igt, :function expandIgt],
@@ -410,11 +413,12 @@ for x in [
['%fneg, :function expandFneg],
['%fprec, :function expandFprec],
- ["%peq",:function expandPeq],
+ ['%peq, :function expandPeq],
+ ['%before?, :function expandBefore?],
- ["%bind",:function expandBind],
- ["%store",:function expandStore],
- ["%dynval",:function expandDynval]
+ ["%bind", :function expandBind],
+ ["%store", :function expandStore],
+ ["%dynval", :function expandDynval]
] repeat property(first x,"%Expander") := rest x
++ Return the expander of a middle-end opcode, or nil if there is none.