From bcff036777b4f79aa17513849fc0e0a2ee5f9099 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 9 Mar 2011 19:17:32 +0000 Subject: * interp/g-opt.boot: %pair, %list, %vector, %bitvector are now considered side-effect free functions. * algebra/boolean.spad.pamphlet: Reflect change. * algebra/Makefile.in (oa_strap_0_sources): Include MAYBE. --- src/interp/g-opt.boot | 11 ++++++----- src/interp/lisp-backend.boot | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src/interp') diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index b7a72aca..59cb8363 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -443,11 +443,12 @@ $VMsideEffectFreeOperators == %val2z %z2val %zlit %zreal %zimag %zexp %zlog %zsin %zcos %ztan %zasin %zacos %zatan %zsinh %zcosh %ztanh %zasinh %zacosh %zatanh - %nil %pair? %lconcat %llength %lfirst %lsecond %lthird + %nil %pair %list %pair? %lconcat %llength %lfirst %lsecond %lthird %lreverse %lempty? %hash %ismall? %string? %f2s %ccst %ceq %clt %cle %cgt %cge %c2i %i2c %s2c %c2s %cup %cdown %sname %strlength %streq %i2s %schar %strlt %strconc %strcopy - %aref %vref %vlength + %vector %aref %vref %vlength + %bitvector %bitvecnot %bitvecand %bitvecnand %bivecor %bitvecnor %bitvecxor %bitveccopy %bitvecconc %bitveclength %bitvecref %bitveceq %bitveclt %before? %equal %sptreq %ident? %property %tref) @@ -455,9 +456,8 @@ $VMsideEffectFreeOperators == ++ List of simple VM operators $simpleVMoperators == append($VMsideEffectFreeOperators, - ['STRINGIMAGE,'FUNCALL,'%gensym, '%lreverse_!,'%pair,'%list, - '%strstc,'%makebitvec,'%makevector,'%vector, - "MAKE-FULL-CVEC","BVEC-MAKE-FULL"]) + ['STRINGIMAGE,'FUNCALL,'%gensym, '%lreverse_!, + '%strstc,"MAKE-FULL-CVEC","BVEC-MAKE-FULL"]) ++ Return true if the `form' is semi-simple with respect to ++ to the list of operators `ops'. @@ -495,6 +495,7 @@ isVMConstantForm: %Code -> %Boolean isVMConstantForm form == integer? form or string? form => true form isnt [op,:args] => false + op in '(%list %pair %vector) => false MEMQ(op,$VMsideEffectFreeOperators) and "and"/[isVMConstantForm arg for arg in args] diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot index 7a068efb..1899ec39 100644 --- a/src/interp/lisp-backend.boot +++ b/src/interp/lisp-backend.boot @@ -354,7 +354,7 @@ expandBitveceq ['%bitveceq,x,y] == expandBitveclt ['%bitveclt,x,y] == ['BVEC_-GREATER,expandToVMForm y,expandToVMForm x] -expandMakebitvec ['%makebitvec,x,y] == +expandBitvector ['%bitvector,x,y] == ['MAKE_-ARRAY,['LIST,expandToVMForm x], KEYWORD::ELEMENT_-TYPE,quoteForm '%Bit, KEYWORD::INITIAL_-ELEMENT,expandToVMForm y] @@ -651,7 +651,7 @@ for x in [ ['%bitveceq, :function expandBitveceq], ['%bitveclt, :function expandBitveclt], ['%bitvecref, :function expandBitvecref], - ['%makebitvec, :function expandMakebitvec], + ['%bitvector, :function expandBitvector], ['%peq, :function expandPeq], ['%before?, :function expandBefore?], -- cgit v1.2.3