diff options
author | dos-reis <gdr@axiomatics.org> | 2012-04-30 12:57:58 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-04-30 12:57:58 +0000 |
commit | 52d8ccbf25a71457f923860824696742328bdb35 (patch) | |
tree | dbfbf21d1ef7c887013a6171e12074663bf95abe /src/algebra | |
parent | ef0788534700412ae77cd7ce4377f57599b11f01 (diff) | |
download | open-axiom-52d8ccbf25a71457f923860824696742328bdb35.tar.gz |
* algebra/si.spad.pamphlet (SingleInteger): Use %iaddmod,
%isubmod, and %imulmod.
* interp/g-opt.boot: These are now builtin side-effect operators.
(optIaddmod): New optimizer. Register.
(optIsubmod): Likewise.
(optImulmod): Likewise.
* interp/sys-macros.lisp (QSADDMOD): Remove.
(QSDIFMOD): Likewise.
(QSMULMOD): Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/si.spad.pamphlet | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/algebra/si.spad.pamphlet b/src/algebra/si.spad.pamphlet index 4e3524b4..d982c432 100644 --- a/src/algebra/si.spad.pamphlet +++ b/src/algebra/si.spad.pamphlet @@ -180,7 +180,7 @@ IntegerNumberSystem(): Category == -- Lisp dependencies --- QSLEFTSHIFT, QSADDMOD, QSDIFMOD, QSMULTMOD +-- QSLEFTSHIFT SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic) with @@ -202,8 +202,11 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic) with import %icstmin: % from Foreign Builtin import %icstmax: % from Foreign Builtin import %iadd: (%,%) -> % from Foreign Builtin + import %iaddmod: (%,%,%) -> % from Foreign Builtin import %isub: (%,%) -> % from Foreign Builtin + import %isubmod: (%,%) -> % from Foreign Builtin import %imul: (%,%) -> % from Foreign Builtin + import %imulmod: (%,%,%) -> % from Foreign Builtin import %irem: (%,%) -> % from Foreign Builtin import %iquo: (%,%) -> % from Foreign Builtin import %ineg: % -> % from Foreign Builtin @@ -271,9 +274,9 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic) with hash(x) == %hash x length(x) == %ilength x shift(x,n) == QSLEFTSHIFT(x,n)$Lisp - mulmod(a,b,p) == QSMULTMOD(a,b,p)$Lisp - addmod(a,b,p) == QSADDMOD(a,b,p)$Lisp - submod(a,b,p) == QSDIFMOD(a,b,p)$Lisp + mulmod(a,b,p) == %imulmod(a,b,p) + addmod(a,b,p) == %iaddmod(a,b,p)$Lisp + submod(a,b,p) == %isubmod(a,b,p)$Lisp negative?(x) == %ilt(x,%icst0) size() == (%icstmax - %icstmin + %icst1) pretend NonNegativeInteger |