aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-07-19 07:27:31 +0000
committerdos-reis <gdr@axiomatics.org>2010-07-19 07:27:31 +0000
commit108ea45edebe23267cc7f4d8620f034fd1b39b81 (patch)
treec6041cc375b9ea506df1a897a35d7335dbb0e2fa /src/interp
parent08966a5a24823ba5605d9baacebbbb95632842e2 (diff)
downloadopen-axiom-108ea45edebe23267cc7f4d8620f034fd1b39b81.tar.gz
* interp/g-opt.boot ($VMsideEffectFreeOperators): Include
byte relation operators and bitmakst operators. * interp/g-util.boot: Expand them. * algebra/data.spad.pamphlet (Byte): Now satisfies Logic. Tidy. (SystemNonNegativeInteger): Likewise. * algebra/java.spad.pamphlet (JVMBytecode): Rename from JavaBytecode. (JVMClassFileAccess): New. (JVMFieldAccess): Likewise. (JVMMethodAccess): Likewise. (JVMConstantTag): Likewise. (JVMOpcode): Likewise.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/g-opt.boot15
-rw-r--r--src/interp/g-util.boot27
2 files changed, 31 insertions, 11 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 9c4004ed..4d598b05 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -473,13 +473,14 @@ $VMsideEffectFreeOperators ==
MINUSP GREATERP ZEROP ODDP FLOAT_-RADIX FLOAT FLOAT_-SIGN FLOAT_-DIGITS
CGREATERP GGREATERP CHAR BOOLE GET BVEC_-GREATER %false %true
%and %or %not %peq %ieq %ilt %ile %igt %ige %head %tail %integer?
- %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd? %iinc
- %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
- %lreverse %lempty? %hash %ismall? %string? %f2s
- %ceq %clt %cle %cgt %cge %c2i %i2c %sname
- %vref %vlength %before?)
+ %beq %blt %ble %bgt %bge %bitand %bitior %bitnot
+ %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd? %iinc
+ %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
+ %lreverse %lempty? %hash %ismall? %string? %f2s
+ %ceq %clt %cle %cgt %cge %c2i %i2c %sname
+ %vref %vlength %before?)
++ List of simple VM operators
$simpleVMoperators ==
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index c2463dc5..df6628f9 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -244,6 +244,15 @@ expandIlt ['%ilt,x,y] ==
expandIgt ['%igt,x,y] ==
expandFlt ['%ilt,y,x]
+expandBitand ['%bitand,x,y] ==
+ ['BOOLE,'BOOLE_-AND,expandToVMForm x,expandToVMForm y]
+
+expandBitior ['%bitior,x,y] ==
+ ['BOOLE,'BOOLE_-IOR,expandToVMForm x,expandToVMForm y]
+
+expandBitnot ['%bitnot,x] ==
+ ['LOGNOT,expandToVMForm x]
+
-- Floating point support
expandFbase ['%fbase] ==
@@ -319,6 +328,13 @@ for x in [
['%c2i, :'CHAR_-CODE],
['%i2c, :'CODE_-CHAR],
+ -- byte operations
+ ['%beq, :'byteEqual],
+ ['%blt, :'byteLessThan],
+ ['%ble, :'byteLessEqual],
+ ['%bgt, :'byteGreaterThan],
+ ['%bge, :'byteGreaterEqual],
+
-- unary integer operations.
['%iabs, :'ABS],
['%ieven?, :'EVENP],
@@ -404,6 +420,9 @@ for x in [
['%igt, :function expandIgt],
['%ilt, :function expandIlt],
['%ineg, :function expandIneg],
+ ['%bitand, :function expandBitand],
+ ['%bitior, :function expandBitior],
+ ['%bitnot, :function expandBitnot],
['%i2f, :function expandI2f],
['%fbase, :function expandFbase],
@@ -417,10 +436,10 @@ for x in [
['%peq, :function expandPeq],
['%before?, :function expandBefore?],
- ["%bind", :function expandBind],
- ["%store", :function expandStore],
- ["%dynval", :function expandDynval]
- ] repeat property(first x,"%Expander") := rest x
+ ['%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.
getOpcodeExpander op ==