projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
1.0.18.16: many STYLE-WARNING changes.
[sbcl.git]
/
src
/
compiler
/
ppc
/
arith.lisp
diff --git
a/src/compiler/ppc/arith.lisp
b/src/compiler/ppc/arith.lisp
index
aca19f4
..
9f8c2f3
100644
(file)
--- a/
src/compiler/ppc/arith.lisp
+++ b/
src/compiler/ppc/arith.lisp
@@
-44,12
+44,12
@@
(define-vop (fast-lognot/fixnum fixnum-unop)
(:translate lognot)
(define-vop (fast-lognot/fixnum fixnum-unop)
(:translate lognot)
- (:generator 2
- (inst xori res x (fixnumize -1))))
+ (:generator 1
+ (inst subfic res x (fixnumize -1))))
(define-vop (fast-lognot/signed signed-unop)
(:translate lognot)
(define-vop (fast-lognot/signed signed-unop)
(:translate lognot)
- (:generator 1
+ (:generator 2
(inst not res x)))
\f
;;;; Binary fixnum operations.
(inst not res x)))
\f
;;;; Binary fixnum operations.
@@
-664,7
+664,11
@@
;;;; %LDB
(defknown %%ldb (integer unsigned-byte unsigned-byte) unsigned-byte
;;;; %LDB
(defknown %%ldb (integer unsigned-byte unsigned-byte) unsigned-byte
- (movable foldable flushable))
+ (movable foldable flushable always-translatable))
+
+;;; only for constant folding within the compiler
+(defun %%ldb (integer size posn)
+ (sb!kernel::%ldb size posn integer))
(define-vop (ldb-c/fixnum)
(:translate %%ldb)
(define-vop (ldb-c/fixnum)
(:translate %%ldb)
@@
-710,7
+714,7
@@
\f
;;;; Modular functions:
\f
;;;; Modular functions:
-(define-modular-fun lognot-mod32 (x) lognot :unsigned 32)
+(define-modular-fun lognot-mod32 (x) lognot :untagged nil 32)
(define-vop (lognot-mod32/unsigned=>unsigned)
(:translate lognot-mod32)
(:args (x :scs (unsigned-reg)))
(define-vop (lognot-mod32/unsigned=>unsigned)
(:translate lognot-mod32)
(:args (x :scs (unsigned-reg)))
@@
-741,7
+745,7
@@
(vop (symbolicate 'fast- fun '/unsigned=>unsigned))
(cvop (symbolicate 'fast- fun '-c/unsigned=>unsigned)))
`(progn
(vop (symbolicate 'fast- fun '/unsigned=>unsigned))
(cvop (symbolicate 'fast- fun '-c/unsigned=>unsigned)))
`(progn
- (define-modular-fun ,mfun-name (x y) ,fun :unsigned 32)
+ (define-modular-fun ,mfun-name (x y) ,fun :untagged nil 32)
(define-vop (,modvop ,vop)
(:translate ,mfun-name))
,@(when constantp
(define-vop (,modvop ,vop)
(:translate ,mfun-name))
,@(when constantp
@@
-750,7
+754,6
@@
(define-modular-backend + t)
(define-modular-backend - t)
(define-modular-backend * t)
(define-modular-backend + t)
(define-modular-backend - t)
(define-modular-backend * t)
- (define-modular-backend logxor t)
(define-modular-backend logeqv)
(define-modular-backend lognand)
(define-modular-backend lognor)
(define-modular-backend logeqv)
(define-modular-backend lognand)
(define-modular-backend lognor)
@@
-827,13
+830,18
@@
(define-logtest-vops))
(defknown %logbitp (integer unsigned-byte) boolean
(define-logtest-vops))
(defknown %logbitp (integer unsigned-byte) boolean
- (movable foldable flushable))
+ (movable foldable flushable always-translatable))
+
+;;; only for constant folding within the compiler
+(defun %logbitp (integer index)
+ (logbitp index integer))
;;; We only handle the constant cases because those are the only ones
;;; guaranteed to make it past COMBINATION-IMPLEMENTATION-STYLE.
;;; --njf, 06-02-2006
(define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum)
(:translate %logbitp)
;;; We only handle the constant cases because those are the only ones
;;; guaranteed to make it past COMBINATION-IMPLEMENTATION-STYLE.
;;; --njf, 06-02-2006
(define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum)
(:translate %logbitp)
+ (:arg-types tagged-num (:constant (integer 0 29)))
(:temporary (:scs (any-reg) :to (:result 0)) test)
(:generator 4
(if (< y 14)
(:temporary (:scs (any-reg) :to (:result 0)) test)
(:generator 4
(if (< y 14)
@@
-843,6
+851,7
@@
(define-vop (fast-logbitp-c/signed fast-conditional-c/signed)
(:translate %logbitp)
(define-vop (fast-logbitp-c/signed fast-conditional-c/signed)
(:translate %logbitp)
+ (:arg-types signed-num (:constant (integer 0 31)))
(:temporary (:scs (signed-reg) :to (:result 0)) test)
(:generator 4
(if (< y 16)
(:temporary (:scs (signed-reg) :to (:result 0)) test)
(:generator 4
(if (< y 16)
@@
-852,6
+861,7
@@
(define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned)
(:translate %logbitp)
(define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned)
(:translate %logbitp)
+ (:arg-types unsigned-num (:constant (integer 0 31)))
(:temporary (:scs (unsigned-reg) :to (:result 0)) test)
(:generator 4
(if (< y 16)
(:temporary (:scs (unsigned-reg) :to (:result 0)) test)
(:generator 4
(if (< y 16)