From ec292309893a71481e7fb3545086ba7b94132462 Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Wed, 11 Aug 2010 21:29:49 +0000 Subject: [PATCH] insts.lisp: o Add UCOMISS and UCOMISD instructions. float-sse2.lisp: o Use UCOMISS and UCOMISD in the =/single-float and =/double-float vops to match what we do on x87. This won't signal invalid operation if one of the operands is NaN. o Rename some vops to match the vop naming convention. --- compiler/x86/float-sse2.lisp | 14 +++++++------- compiler/x86/insts.lisp | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/compiler/x86/float-sse2.lisp b/compiler/x86/float-sse2.lisp index aefe27d6b..484ce4f21 100644 --- a/compiler/x86/float-sse2.lisp +++ b/compiler/x86/float-sse2.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float-sse2.lisp,v 1.17 2010/08/06 09:41:41 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float-sse2.lisp,v 1.18 2010/08/11 21:29:49 rtoy Rel $") ;;; ;;; ********************************************************************** ;;; @@ -879,7 +879,7 @@ (:vop-var vop) (:generator 3 (note-this-location vop :internal-error) - (inst comiss x y) + (inst ucomiss x y) ;; if PF&CF, there was a NaN involved => not equal ;; otherwise, ZF => equal (cond (not-p @@ -897,7 +897,7 @@ (:vop-var vop) (:generator 3 (note-this-location vop :internal-error) - (inst comisd x y) + (inst ucomisd x y) (cond (not-p (inst jmp :p target) (inst jmp :ne target)) @@ -907,7 +907,7 @@ (inst jmp :e target) (emit-label not-lab)))))) -(define-vop (<double-float double-float-compare) +(define-vop (</double-float double-float-compare) (:translate <) (:info target not-p) (:generator 3 @@ -921,7 +921,7 @@ (inst jmp :c target) (emit-label not-lab)))))) -(define-vop (<single-float single-float-compare) +(define-vop (</single-float single-float-compare) (:translate <) (:info target not-p) (:generator 3 @@ -935,7 +935,7 @@ (inst jmp :c target) (emit-label not-lab)))))) -(define-vop (>double-float double-float-compare) +(define-vop (>/double-float double-float-compare) (:translate >) (:info target not-p) (:generator 3 @@ -949,7 +949,7 @@ (inst jmp :a target) (emit-label not-lab)))))) -(define-vop (>single-float single-float-compare) +(define-vop (>/single-float single-float-compare) (:translate >) (:info target not-p) (:generator 3 diff --git a/compiler/x86/insts.lisp b/compiler/x86/insts.lisp index 9cc06aeff..14fe90d7f 100644 --- a/compiler/x86/insts.lisp +++ b/compiler/x86/insts.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/insts.lisp,v 1.36 2010/08/06 19:01:42 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/insts.lisp,v 1.37 2010/08/11 21:29:49 rtoy Rel $") ;;; ;;; ********************************************************************** ;;; @@ -3140,6 +3140,8 @@ ;; comparison (define-regular-sse-inst comisd #x66 #x2f) (define-regular-sse-inst comiss nil #x2f) + (define-regular-sse-inst ucomisd #x66 #x2e) + (define-regular-sse-inst ucomiss nil #x2e) ;; arithmetic (define-regular-sse-inst addsd #xf2 #x58) (define-regular-sse-inst addpd #x66 #x58 t) -- GitLab