From 5bcd66d747349ff167ffcd3953c95faf08aa8c1e Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 24 Jan 2011 20:30:28 +0000 Subject: * interp/g-opt.boot (optMkRecord): Generate %makepair forms. ($VMsideEffectFreeOperators): Include %listlit and %veclit. * interp/g-util.boot: Translate them. --- src/ChangeLog | 6 ++++++ src/algebra/strap/INT.lsp | 2 +- src/algebra/strap/SINT.lsp | 2 +- src/interp/g-opt.boot | 9 +++++---- src/interp/g-util.boot | 3 +++ 5 files changed, 16 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 145f9768..cf12f64f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-01-24 Gabriel Dos Reis + + * interp/g-opt.boot (optMkRecord): Generate %makepair forms. + ($VMsideEffectFreeOperators): Include %listlit and %veclit. + * interp/g-util.boot: Translate them. + 2011-01-24 Gabriel Dos Reis * algebra/array1.spad.pamphlet: Use %aref instead of %vref. diff --git a/src/algebra/strap/INT.lsp b/src/algebra/strap/INT.lsp index 32e4f83b..356a972e 100644 --- a/src/algebra/strap/INT.lsp +++ b/src/algebra/strap/INT.lsp @@ -115,7 +115,7 @@ |INT;reducedSystem;MVR;30|)) (PUT '|INT;reducedSystem;MVR;30| '|SPADreplace| - '(XLAM (|m| |v|) (CONS |m| '|vec|))) + '(XLAM (|m| |v|) (|%makepair| |m| '|vec|))) (DECLAIM (FTYPE (FUNCTION (|%Integer| |%Shell|) |%Integer|) |INT;abs;2$;31|)) diff --git a/src/algebra/strap/SINT.lsp b/src/algebra/strap/SINT.lsp index cfb59ef4..70423f3e 100644 --- a/src/algebra/strap/SINT.lsp +++ b/src/algebra/strap/SINT.lsp @@ -265,7 +265,7 @@ (DECLAIM (FTYPE (FUNCTION (|%Thing| (|%Vector| *) |%Shell|) |%Pair|) |SINT;reducedSystem;MVR;57|)) -(PUT '|SINT;reducedSystem;MVR;57| '|SPADreplace| 'CONS) +(PUT '|SINT;reducedSystem;MVR;57| '|SPADreplace| '|%makepair|) (DECLAIM (FTYPE (FUNCTION (|%Short| |%Short| |%Shell|) |%Short|) |SINT;positiveRemainder;3$;58|)) diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 1de0de78..718c06aa 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -297,7 +297,7 @@ compileTimeBindingOf u == optMkRecord ["mkRecord",:u] == u is [x] => ["LIST",x] - #u=2 => ["CONS",:u] + #u=2 => ['%makepair,:u] ["VECTOR",:u] optCond (x is ['COND,:l]) == @@ -449,11 +449,11 @@ $VMsideEffectFreeOperators == %fpow %fdiv %fneg %i2f %fminval %fmaxval %fbase %fprec %ftrunc %fsin %fcos %ftan %fcot %fsec %fcsc %fatan %facot %fsinh %fcosh %ftanh %fcsch %fcoth %fsech %fasinh %facsch - %nil %pair? %lconcat %llength %lfirst %lsecond %lthird + %nil %pair? %lconcat %llength %lfirst %lsecond %lthird %listlit %lreverse %lempty? %hash %ismall? %string? %f2s %ccst %ceq %clt %cle %cgt %cge %c2i %i2c %s2c %cup %cdown %sname %strlength %streq %i2s %schar %strlt %strconc %strcopy %strstc - %aref %vref %vlength + %aref %vref %vlength %veclit %bitvecnot %bitvecand %bitvecnand %bivecor %bitvecnor %bitvecxor %bitveccopy %bitvecconc %bitveclength %bitvecref %bitveceq %before?) @@ -462,7 +462,8 @@ $VMsideEffectFreeOperators == $simpleVMoperators == append($VMsideEffectFreeOperators, ['CONS,'LIST,'VECTOR,'STRINGIMAGE,'FUNCALL,'%gensym, '%lreverse_!, - '%strstc,'%makebitvec,"MAKE-FULL-CVEC","BVEC-MAKE-FULL","COND"]) + '%strstc,'%makebitvec,'%makevector, + "MAKE-FULL-CVEC","BVEC-MAKE-FULL","COND"]) ++ Return true if the `form' is semi-simple with respect to ++ to the list of operators `ops'. diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index e0fc1d07..38882026 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -560,14 +560,17 @@ for x in [ ['%lthird, :'CADDR], ['%pair?, :'CONSP], ['%tail, :'CDR], + ['%listlit, :'LIST], -- binary list operations ['%lconcat, :'APPEND], -- simple vector operations ['%vfill, :'FILL], ['%vlength, :'sizeOfSimpleArray], + ['%veclit, :'VECTOR], ['%vref, :'SVREF], ['%aref, :'getSimpleArrayEntry], + ['%makevector,:'MAKE_-ARRAY], -- symbol unary functions ['%gensym, :'GENSYM], -- cgit v1.2.3