From b07ae7fbddfabe8deabc67b02c1d5715d162eb07 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Sun, 7 May 2006 23:50:00 +0000
Subject: [PATCH] ppc/arith.lisp: o Comment out the +/fixnum and -/fixnum.  The
 C code doesn't support   the fixnum-additive-overflow-trap, and this vop
 doesn't do enough   checking of the args.

  (defun foo (x y) (the fixnum (+ (the fixnum x) (the fixnum y))))

  triggers bad behavior if there's an overflow, or if x or y is not a
  fixnum.

  Everything still works without these vops.  The check for fixnum
  args becomes explicit, and the result is explicitly checked for a
  fixnum result.

  I'm guessing this was modeled after the Sparc version of these vops,
  which actually checked the tag bits and for overflow.

ppc/parms.lisp:
o Remove the fixnum-additive-overflow trap because we don't use it
  anymore.
---
 compiler/ppc/arith.lisp | 5 ++++-
 compiler/ppc/parms.lisp | 5 ++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/compiler/ppc/arith.lisp b/compiler/ppc/arith.lisp
index f1eca41fa..6f8413512 100644
--- a/compiler/ppc/arith.lisp
+++ b/compiler/ppc/arith.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman (FAHLMAN@CMUC). 
 ;;; **********************************************************************
 ;;;
-;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/arith.lisp,v 1.10 2005/11/04 04:29:46 rtoy Exp $
+;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/arith.lisp,v 1.11 2006/05/07 23:50:00 rtoy Exp $
 ;;;
 ;;;    This file contains the VM definition arithmetic VOPs for the MIPS.
 ;;;
@@ -270,6 +270,8 @@
 ;;; Special case fixnum + and - that trap on overflow.  Useful when we
 ;;; don't know that the output type is a fixnum.
 ;;;
+#+nil
+(progn
 (define-vop (+/fixnum fast-+/fixnum=>fixnum)
   (:policy :safe)
   (:results (r :scs (any-reg descriptor-reg)))
@@ -298,6 +300,7 @@
       (inst unimp (logior (ash (reg-tn-encoding r) 5)
 			  fixnum-additive-overflow-trap))
       (emit-label no-overflow))))
+)
 
 (define-vop (fast-*/fixnum=>fixnum fast-fixnum-binop)
   (:temporary (:scs (non-descriptor-reg)) temp)
diff --git a/compiler/ppc/parms.lisp b/compiler/ppc/parms.lisp
index cafad62b1..98398beec 100644
--- a/compiler/ppc/parms.lisp
+++ b/compiler/ppc/parms.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/ppc/parms.lisp,v 1.10 2006/01/18 15:21:26 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/parms.lisp,v 1.11 2006/05/07 23:50:00 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -173,8 +173,7 @@
   cerror
   breakpoint
   function-end-breakpoint
-  after-breakpoint
-  fixnum-additive-overflow)
+  after-breakpoint)
 
 (defenum (:prefix object-not- :suffix -trap :start 16)
   list
-- 
GitLab