Skip to content
Snippets Groups Projects
Commit 0a75e798 authored by wlott's avatar wlott
Browse files

Fixed %floor so the lifetimes are correct.

parent 7228a495
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.37 1990/11/03 03:25:10 wlott Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/arith.lisp,v 1.38 1990/11/16 04:44:12 wlott Exp $
;;; ;;;
;;; This file contains the VM definition arithmetic VOPs for the MIPS. ;;; This file contains the VM definition arithmetic VOPs for the MIPS.
;;; ;;;
...@@ -765,30 +765,30 @@ ...@@ -765,30 +765,30 @@
(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) :target rem) (:args (num-high :scs (unsigned-reg) :target rem)
(b :scs (unsigned-reg) :target rem-low) (num-low :scs (unsigned-reg) :target rem-low)
(c :scs (unsigned-reg) :to (:eval 1))) (denom :scs (unsigned-reg) :to (:eval 1)))
(:arg-types unsigned-num unsigned-num unsigned-num) (:arg-types unsigned-num unsigned-num unsigned-num)
(:temporary (:scs (unsigned-reg) :from (:argument 1)) rem-low) (:temporary (:scs (unsigned-reg) :from (:argument 1)) rem-low)
(:temporary (:scs (unsigned-reg) :from (:eval 0)) temp) (:temporary (:scs (unsigned-reg) :from (:eval 0)) temp)
(:results (quo :scs (unsigned-reg) :from (:eval 0)) (:results (quo :scs (unsigned-reg) :from (:eval 0))
(rem :scs (unsigned-reg) :from (:eval 0))) (rem :scs (unsigned-reg) :from (:argument 0)))
(:result-types unsigned-num unsigned-num) (:result-types unsigned-num unsigned-num)
(:generator 325 ; number of inst assuming targeting works. (:generator 325 ; number of inst assuming targeting works.
(move rem a) (move rem num-high)
(move rem-low b) (move rem-low num-low)
(flet ((maybe-subtract (&optional (guess temp)) (flet ((maybe-subtract (&optional (guess temp))
(inst subu temp guess 1) (inst subu temp guess 1)
(inst and temp c) (inst and temp denom)
(inst subu rem temp))) (inst subu rem temp)))
(inst sltu quo rem c) (inst sltu quo rem denom)
(maybe-subtract quo) (maybe-subtract quo)
(dotimes (i 32) (dotimes (i 32)
(inst sll rem 1) (inst sll rem 1)
(inst srl temp rem-low 31) (inst srl temp rem-low 31)
(inst or rem temp) (inst or rem temp)
(inst sll rem-low 1) (inst sll rem-low 1)
(inst sltu temp rem c) (inst sltu temp rem denom)
(inst sll quo 1) (inst sll quo 1)
(inst or quo temp) (inst or quo temp)
(maybe-subtract))) (maybe-subtract)))
......
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