aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-20 19:21:34 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-20 19:21:34 +0000
commit5887c54d95b5bc62167a5e22e56e515cda7a7244 (patch)
treeedc430accc6075c307a40f252f7f50643b6c9f0f /src/interp
parentadac8d95735aa3dc001658f2438b79d1c38a58d4 (diff)
downloadopen-axiom-5887c54d95b5bc62167a5e22e56e515cda7a7244.tar.gz
* interp/g-opt.boot ($VMsideEffectFreeOperators): Include
%bytevec2str and %str2bytevec opcode. * interp/lisp-backend.boot: Expand them. * algebra/data.spad.pamphlet (ByteBuffer): Tidy.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/g-opt.boot2
-rw-r--r--src/interp/lisp-backend.boot10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index aca6a00c..2d1f9151 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -448,7 +448,7 @@ $VMsideEffectFreeOperators ==
%ccst %ccstmax %ceq %clt %cle %cgt %cge %c2i %i2c %s2c %c2s %cup %cdown
%sname
%strlength %streq %i2s %schar %strlt %strconc %strcopy
- %vector %aref %vref %vlength
+ %vector %aref %vref %vlength %bytevec2str %str2bytevec
%bitvector
%bitvecnot %bitvecand %bitvecnand %bivecor %bitvecnor %bitvecxor
%bitveccopy %bitvecconc %bitveclength %bitvecref %bitveceq %bitveclt
diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot
index 8a9a2a4c..b5c47b39 100644
--- a/src/interp/lisp-backend.boot
+++ b/src/interp/lisp-backend.boot
@@ -317,6 +317,12 @@ expandStrlt ['%strlt,x,y] ==
expandStrstc ['%strstc,x,y,z] ==
expandToVMForm ['%store,['%schar,x,y],z]
+expandBytevec2str ['%bytevec2str,x,y] ==
+ ['COERCE,['SUBSEQ,expandToVMForm x,0,expandToVMForm y],quoteForm '%String]
+
+expandStr2bytevec ['%str2bytevec,x] ==
+ ['COERCE,expandToVMForm x,quoteForm ['%Vector,'%Byte]]
+
-- bit vector operations
expandBitvecnot ['%bitvecnot,x] ==
['BIT_-NOT,expandToVMForm x]
@@ -447,7 +453,7 @@ for x in [
['%or, :'OR],
-- character operations
- ['%ccstmax,:'_$CharCodeMax],
+ ['%ccstmax,:'_$CharCodeMaximum],
['%ceq, :'CHAR_=],
['%clt, :'CHAR_<],
['%cle, :'CHAR_<_=],
@@ -643,6 +649,8 @@ for x in [
['%streq, :function expandStreq],
['%strlt, :function expandStrlt],
['%strstc, :function expandStrstc],
+ ['%bytevec2str, :function expandBytevec2str],
+ ['%str2bytevec, :function expandStr2bytevec],
['%bitvecnot, :function expandBitvecnot],
['%bitvecand, :function expandBitvecand],