Skip to content
Snippets Groups Projects
Commit 610d7027 authored by wlott's avatar wlott
Browse files

Removed package qualifier from error names.

Wrote %floor as a bit at a time shift and subtract divider.
parent e872a832
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC). ;;; Scott Fahlman (FAHLMAN@CMUC).
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/arith.lisp,v 1.22 1990/05/19 09:40:26 wlott Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/arith.lisp,v 1.23 1990/06/04 05:18:03 wlott Exp $
;;; ;;;
;;; This file contains the VM definition arithmetic VOPs for the MIPS. ;;; This file contains the VM definition arithmetic VOPs for the MIPS.
;;; ;;;
...@@ -341,7 +341,7 @@ ...@@ -341,7 +341,7 @@
(r :scs (signed-reg))) (r :scs (signed-reg)))
(:result-types * *) (:result-types * *)
(:generator 11 (:generator 11
(let ((zero (generate-error-code di:division-by-zero-error x y))) (let ((zero (generate-error-code division-by-zero-error x y)))
(inst beq y zero-tn zero)) (inst beq y zero-tn zero))
(inst div x y) (inst div x y)
(inst mflo q) (inst mflo q)
...@@ -354,7 +354,7 @@ ...@@ -354,7 +354,7 @@
(:results (r :scs (signed-reg))) (:results (r :scs (signed-reg)))
(:result-types *) (:result-types *)
(:generator 10 (:generator 10
(let ((zero (generate-error-code di:division-by-zero-error x y))) (let ((zero (generate-error-code division-by-zero-error x y)))
(inst beq y zero-tn zero)) (inst beq y zero-tn zero))
(inst div x y) (inst div x y)
(inst mfhi r))) (inst mfhi r)))
...@@ -690,15 +690,28 @@ ...@@ -690,15 +690,28 @@
(define-vop (bignum-floor) (define-vop (bignum-floor)
(:translate bignum::%floor) (:translate bignum::%floor)
(:policy :fast-safe) (:policy :fast-safe)
(:args (a :scs (unsigned-reg)) (:args (a :scs (unsigned-reg) :target rem)
(b :scs (unsigned-reg)) (b :scs (unsigned-reg))
(c :scs (unsigned-reg))) (c :scs (unsigned-reg)))
(:temporary (:scs (unsigned-reg)) temp result)
(:results (quo :scs (unsigned-reg)) (:results (quo :scs (unsigned-reg))
(rem :scs (unsigned-reg))) (rem :scs (unsigned-reg)))
(:generator 3 (:generator 230
(progn a b c quo rem) (flet ((maybe-subtract (&optional (guess temp))
(warn "Don't know how to divide a 64 bit number by a 32 bit number."))) (inst subu temp guess 1)
(inst and temp c)
(inst subu a temp)))
(inst sltu result a c)
(maybe-subtract result)
(dotimes (i 32)
(inst sll a 1)
(inst srl temp b 31)
(inst or a temp)
(inst sll b 1)
(inst sltu temp a c)
(maybe-subtract)))
(inst nor quo result)
(move rem a)))
(define-vop (signify-digit) (define-vop (signify-digit)
(:translate bignum::%fixnum-digit-with-correct-sign) (:translate bignum::%fixnum-digit-with-correct-sign)
......
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