file-stream. (thanks to Robert J. Macomber)
* optimization: improved type inference for arithmetic-for
index variables in LOOP
+ * optimization: faster floating-point SQRT on x86-64
* fixed some bugs revealed by Paul Dietz' test suite:
** DOCUMENTATION returns NIL instead of "" for method combinations
that don't have a docstring
(def %log (x))
(def %exp (x)))
+#!+x86-64 ;; for constant folding
+(macrolet ((def (name ll)
+ `(defun ,name ,ll (,name ,@ll))))
+ (def %sqrt (x)))
+
;;;; stubs for the Unix math library
;;;;
;;;; Many of these are unnecessary on the X86 because they're built
#!-x86 (def-math-rtn "log" 1)
#!-x86 (def-math-rtn "log10" 1)
(def-math-rtn "pow" 2)
-#!-x86 (def-math-rtn "sqrt" 1)
+#!-(or x86 x86-64) (def-math-rtn "sqrt" 1)
(def-math-rtn "hypot" 2)
#!-(or hpux x86) (def-math-rtn "log1p" 1)
\f
;;; beginning with T specifies a default. If it appears, it must be
;;; last. If no default is specified, and no clause matches, then an
;;; error is signalled.
-(def!macro sc-case (tn &rest forms)
+(def!macro sc-case (tn &body forms)
(let ((n-sc (gensym))
(n-tn (gensym)))
(collect ((clauses))
'float-registers)))
(inst call function)
;; To give the debugger a clue. XX not really internal-error?
- (note-this-location vop :internal-error)
- ;; FLOAT15 needs to contain FP zero in Lispland
- (let ((float15 (make-random-tn :kind :normal
- :sc (sc-or-lose 'double-reg)
- :offset float15-offset)))
- (inst xorpd float15 float15))))
+ (note-this-location vop :internal-error)))
(define-vop (alloc-number-stack-space)
(:info amount)
(define-move-fun (load-fp-zero 1) (vop x y)
((fp-single-zero) (single-reg)
(fp-double-zero) (double-reg))
- (identity x) ; KLUDGE: IDENTITY as IGNORABLE...
- (inst movq y fp-double-zero-tn))
+ (identity x)
+ (sc-case y
+ (single-reg (inst xorps y y))
+ (double-reg (inst xorpd y y))))
(define-move-fun (load-single 2) (vop x y)
((single-stack) (single-reg))
(frob * mulss */single-float 4 mulsd */double-float 5 t)
(frob / divss //single-float 12 divsd //double-float 19 nil))
-
+(define-vop (fsqrt)
+ (:args (x :scs (double-reg)))
+ (:results (y :scs (double-reg)))
+ (:translate %sqrt)
+ (:policy :fast-safe)
+ (:arg-types double-float)
+ (:result-types double-float)
+ (:note "inline float arithmetic")
+ (:vop-var vop)
+ (:save-p :compute-only)
+ (:generator 1
+ (note-this-location vop :internal-error)
+ (inst sqrtsd y x)))
\f
(macrolet ((frob ((name translate sc type) &body body)
`(define-vop (,name)
(define-regular-sse-inst mulss #xf3 #x59)
(define-regular-sse-inst subsd #xf2 #x5c)
(define-regular-sse-inst subss #xf3 #x5c)
+ (define-regular-sse-inst sqrtsd #xf2 #x51)
+ (define-regular-sse-inst sqrtss #xf3 #x51)
;; conversion
(define-regular-sse-inst cvtsd2ss #xf2 #x5a)
(define-regular-sse-inst cvtss2sd #xf3 #x5a)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.7.7"
+"0.9.7.8"