Skip to content
Snippets Groups Projects
Commit efcaaa70 authored by dtc's avatar dtc
Browse files

From Raymound Toy:

o Fix the ash deftransform which sometimes incorrectly transforms
  a right shift of a (signed-byte 32) into -1.
parent 0405d7df
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/arith.lisp,v 1.22 2001/01/03 08:45:52 dtc Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/arith.lisp,v 1.23 2001/01/03 15:07:08 dtc Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -1270,7 +1270,6 @@
;; direction of the shift at run-time.
(in-package "C")
#+nil
(deftransform ash ((num shift) (integer integer))
(let ((num-type (continuation-type num))
(shift-type (continuation-type shift)))
......@@ -1285,11 +1284,11 @@
;; s-expr and depend on other parts of the compiler to delete the
;; unreachable parts, if any?)
(cond ((csubtypep num-type (specifier-type '(signed-byte #.vm:word-bits)))
;; A right shift by 31 is the same as a right shift by
;; larger amount. We get just the sign.
(if (csubtypep shift-type (specifier-type '(integer #.(- 1 vm:word-bits) 0)))
`(sparc::ash-right-signed num (- shift))
`(if (<= shift #.(- vm:word-bits))
-1
(sparc::ash-right-signed num (- shift)))))
`(sparc::ash-right-signed num (min (- shift) #.(1- vm:word-bits)))))
((csubtypep num-type (specifier-type '(unsigned-byte #.vm:word-bits)))
(if (csubtypep shift-type (specifier-type '(integer #.(- 1 vm:word-bits) 0)))
`(sparc::ash-right-unsigned num (- shift))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment