diff options
author | dos-reis <gdr@axiomatics.org> | 2011-01-03 02:45:16 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-01-03 02:45:16 +0000 |
commit | 102fe7a6693f1aa8282890b25d634079ddc86e13 (patch) | |
tree | cb96e44f1a80f89701944df07665e0ae7225c43b /src/interp/g-util.boot | |
parent | 2b2ae9894f66dba65af62fb08b9d79b2aee2a2a8 (diff) | |
download | open-axiom-102fe7a6693f1aa8282890b25d634079ddc86e13.tar.gz |
* interp/g-util.boot: Expand new bit vector operators.
* interp/g-opt.boot (opt2bit): New.
(opt2bool): Likewise.
* interp/bits.lisp (BVEC-SIZE): Remove.
(BVEC-COPY): Likewise.
(BVEC-CONCAT): Likewise.
(BVEC-EQUAL): Likewise.
(BVEC-AND): Likewise.
(BVEC-OR): Likewise.
(BVEC-XOR): Likewise.
(BVEC-NAND): Likewise.
(BVEC-NOR): Likewise.
(BVEC-NOT): Likewise.
* algebra/boolean.spad.pamphlet (IndexedBits): Remove uses of
Lisp-level functions.
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r-- | src/interp/g-util.boot | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index fb98bc83..197da15a 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -366,6 +366,45 @@ expandStrlt ['%strlt,x,y] == expandStrstc ['%strstc,x,y,z] == expandToVMForm ['%store,['%schar,x,y],z] +-- bit vector operations +expandBitvecnot ['%bitvecnot,x] == + ['BIT_-NOT,expandToVMForm x] + +expandBitvecand ['%bitvecand,x,y] == + ['BIT_-AND,expandToVMForm x,expandToVMForm y] + +expandBitvecnand ['%bitvecnand,x,y] == + ['BIT_-NAND,expandToVMForm x,expandToVMForm y] + +expandBitvecor ['%bitvecor,x,y] == + ['BIT_-IOR,expandToVMForm x,expandToVMForm y] + +expandBitvecnor ['%bitvecnor,x,y] == + ['BIT_-NOR,expandToVMForm x,expandToVMForm y] + +expandBitvecxor ['%bitvecxor,x,y] == + ['BIT_-XOR,expandToVMForm x,expandToVMForm y] + +expandBitveclength ['%bitveclength,x] == + ['LENGTH,expandToVMForm x] + +expandBitveccopy ['%bitveccopy,x] == + ['COPY_-SEQ,expandToVMForm x] + +expandBitvecconc ['%bitvecconc,x,y] == + ['CONCATENATE, quoteForm '%BitVector,expandToVMForm x,expandToVMForm y] + +expandBitvecref ['%bitvecref,x,y] == + ['SBIT,expandToVMForm x,expandToVMForm y] + +expandBitveceq ['%bitveceq,x,y] == + ['EQUAL,expandToVMForm x,expandToVMForm y] + +expandMakebitvec ['%makebitvec,x,y] == + ['MAKE_-ARRAY,['LIST,expandToVMForm x], + KEYWORD::ELEMENT_-TYPE,quoteForm '%Bit, + KEYWORD::INITIAL_-ELEMENT,expandToVMForm y] + -- Local variable bindings expandBind ['%bind,inits,:body] == body := expandToVMForm body @@ -583,6 +622,19 @@ for x in [ ['%strlt, :function expandStrlt], ['%strstc, :function expandStrstc], + ['%bitvecnot, :function expandBitvecnot], + ['%bitvecand, :function expandBitvecand], + ['%bitvecnand, :function expandBitvecnand], + ['%bitvecor, :function expandBitvecor], + ['%bitvecxor, :function expandBitvecxor], + ['%bitvecnor, :function expandBitvecnor], + ['%bitveclength, :function expandBitveclength], + ['%bitveccopy, :function expandBitveccopy], + ['%bitvecconc, :function expandBitvecconc], + ['%bitveceq, :function expandBitveceq], + ['%bitvecref, :function expandBitvecref], + ['%makebitvec, :function expandMakebitvec], + ['%peq, :function expandPeq], ['%before?, :function expandBefore?], |