From: Christophe Rhodes Date: Wed, 8 Jun 2005 14:10:23 +0000 (+0000) Subject: 0.9.1.32: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=658b61abb1226fa07d376431277c158c677dcceb;p=sbcl.git 0.9.1.32: Implement direct ub32 -> float on PPC. --- diff --git a/NEWS b/NEWS index deef2aa..428c0ae 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,8 @@ changes in sbcl-0.9.2 relative to sbcl-0.9.1: x86-64 (thanks to James Knight) * optimization: improved the MIPS versions of generic (in the generic sense) arithmetic routines. (thanks to Thiemo Seufer) + * optimization: direct conversion of (unsigned-byte 32) to floats on + the PowerPC platform. * contrib improvement: it's harder to cause SOCKET-CLOSE to close() the wrong file descriptor; implementation of SOCKET-OPEN-P. (thanks to Tony Martinez) diff --git a/src/compiler/ppc/float.lisp b/src/compiler/ppc/float.lisp index 21750f9..d06334b 100644 --- a/src/compiler/ppc/float.lisp +++ b/src/compiler/ppc/float.lisp @@ -478,6 +478,36 @@ (frob %single-float/signed %single-float fsubs single-reg single-float) (frob %double-float/signed %double-float fsub double-reg double-float)) +(macrolet ((frob (name translate inst to-sc to-type) + `(define-vop (,name) + (:args (x :scs (unsigned-reg))) + (:temporary (:scs (double-stack)) temp) + (:temporary (:scs (double-reg)) fmagic) + (:temporary (:scs (signed-reg)) rtemp) + (:results (y :scs (,to-sc))) + (:arg-types unsigned-num) + (:result-types ,to-type) + (:policy :fast-safe) + (:note "inline float coercion") + (:translate ,translate) + (:vop-var vop) + (:save-p :compute-only) + (:generator 5 + (let* ((stack-offset (* (tn-offset temp) n-word-bytes)) + (nfp-tn (current-nfp-tn vop)) + (temp-offset-high (* stack-offset n-word-bytes)) + (temp-offset-low (* (1+ stack-offset) n-word-bytes))) + (inst lis rtemp #x4330) ; High word of magic constant + (inst stw rtemp nfp-tn temp-offset-high) + (inst stw zero-tn nfp-tn temp-offset-low) + (inst lfd fmagic nfp-tn temp-offset-high) + (inst stw x nfp-tn temp-offset-low) + (inst lfd y nfp-tn temp-offset-high) + (note-this-location vop :internal-error) + (inst ,inst y y fmagic)))))) + (frob %single-float/unsigned %single-float fsubs single-reg single-float) + (frob %double-float/unsigned %double-float fsub double-reg double-float)) + (macrolet ((frob (name translate inst from-sc from-type to-sc to-type) `(define-vop (,name) (:args (x :scs (,from-sc))) diff --git a/version.lisp-expr b/version.lisp-expr index bbf2b92..9a399b6 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; 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.1.31" +"0.9.1.32"