Commit 4663279e authored by Raymond Toy's avatar Raymond Toy
Browse files

Remove bignum-shld and bignum-shrd vops and functions.

parent 9e4c9d0a
Loading
Loading
Loading
Loading
+0 −26
Changes for src/code/bignum.lisp: 0 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -3697,29 +3697,3 @@ friends is working.
    (unless (= newlen len)
      (%bignum-set-length result newlen))
    result))

;; Shift X left by Shift bits, shifting in bits from Carry-in.
;; Basically treat x:carry-in as a 64-bit value and shift it left,
;; returning the top bignum-type bits.
(defun %shld (x carry-in shift)
  (declare (type bignum-element-type x carry-in)
	   (type (unsigned-byte 5) shift))
  #+x86
  (%shld x carry-in shift)
  #-x86
  (ldb (byte vm:word-bits 0)
       (logior (ash x shift)
	       (ash carry-in (- shift vm:word-bits)))))

;; Shift X right by Shift bits, shifting in bits from Carry-in.
;; Basically treat carry-in:x as a 64-bit value and shift it right,
;; returning the low bignum-type bits.
(defun %shrd (x carry-in shift)
  (declare (type bignum-element-type x carry-in)
	   (type (unsigned-byte 5) shift))
  #+x86
  (%shrd x carry-in shift)
  #-x86
  (ldb (byte vm:word-bits 0)
       (logior (ash x (- shift))
	       (ash carry-in (- vm:word-bits shift)))))
+0 −47
Changes for src/compiler/x86/arith.lisp: 0 added lines, 47 removed lines.
Original line number Diff line number Diff line
@@ -1580,53 +1580,6 @@
    (inst shr tmp 18)
    (inst xor y tmp)))

(define-vop (bignum-shld)
  (:policy :fast-safe)
  (:translate bignum::%shld)
  (:args (x :scs (unsigned-reg unsigned-stack) :target r)
	 (shift-in :scs (unsigned-reg) :to :result)
	 (amount :scs (unsigned-reg) :target cl))
  (:arg-types unsigned-num unsigned-num unsigned-num)
  (:results (r :scs (unsigned-reg)
	       :load-if (not (and (sc-is r unsigned-stack)
				  (location= x r)))))
  (:result-types unsigned-num)
  (:temporary (:sc unsigned-reg :offset ecx-offset
		   :from (:argument 2)) cl)
  (:generator 3
    (move cl amount)
    (move r x)
    (inst shld r shift-in :cl)))
  
(define-vop (bignum-shld-c)
  (:policy :fast-safe)
  (:translate bignum::%shld)
  (:args (x :scs (unsigned-reg unsigned-stack) :target r)
	 (shift-in :scs (unsigned-reg) :to :save))
  (:info shift)
  (:arg-types unsigned-num unsigned-num (:constant (unsigned-byte 5)))
  (:results (r :scs (unsigned-reg)
	       :load-if (not (and (sc-is r unsigned-stack)
				  (location= x r)))))
  (:result-types unsigned-num)
  (:generator 2
    (move r x)
    (inst shld r shift-in shift)))

(define-vop (bignum-shrd bignum-shld)
  (:translate bignum::%shrd)
  (:generator 3
    (move cl amount)
    (move r x)
    (inst shrd r shift-in :cl)))

(define-vop (bignum-shrd-c bignum-shld-c)
  (:translate bignum::%shrd)
  (:generator 2
    (move r x)
    (inst shrd r shift-in shift)))



;;; Modular arithmetic
;;; logical operations