Fix bug. The val register was not preserved around flonum calls.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Tue, 27 Jul 1993 17:47:34 +0000 (17:47 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Tue, 27 Jul 1993 17:47:34 +0000 (17:47 +0000)
(flo:+ (flo:sin x) (flo:expt x y))

was failing because the result of flo:expt (close-coded) was left in
val around the call to sin, and the stub (and C code, potentially)
were clobbering it.

v7/src/microcode/cmpauxmd/hppa.m4
v8/src/microcode/cmpauxmd/hppa.m4

index c6751a5082dada638e3d79d059e4f6cd412c712d..c1bbfd697bbdb88c9963bf56df46a3f87d3b6da7 100644 (file)
@@ -1,6 +1,6 @@
 changecom(`;');;; -*-Midas-*-
 ;;;
-;;;    $Id: hppa.m4,v 1.27 1993/06/30 03:35:29 gjr Exp $
+;;;    $Id: hppa.m4,v 1.28 1993/07/27 17:47:34 gjr Exp $
 ;;;
 ;;;    Copyright (c) 1989-1993 Massachusetts Institute of Technology
 ;;;
@@ -1030,6 +1030,7 @@ floating_vector_cons
 \f
 define(define_floating_point_util,
 "flonum_$1
+       STW     2,8(0,4)                        ; preserve val
        COPY    22,18                           ; preserve regs
        COPY    21,17
        COPY    19,16
@@ -1039,6 +1040,7 @@ define(define_floating_point_util,
        COPY    16,19
        COPY    17,21
        COPY    18,22
+       LDW     8(0,4),2                        ; restore val
        BE      0(5,15)
        LDW     0(0,4),20")
 
@@ -1055,6 +1057,7 @@ define_floating_point_util(ceiling,ceil)
 define_floating_point_util(floor,floor)
 
 flonum_atan2
+       STW     2,8(0,4)                        ; preserve val
        COPY    22,18                           ; preserve regs
        COPY    21,17
        COPY    19,16
@@ -1064,6 +1067,7 @@ flonum_atan2
        COPY    16,19
        COPY    17,21
        COPY    18,22
+       LDW     8(0,4),2                        ; restore val
        BE      0(5,15)
        LDW     0(0,4),20
 
index c6751a5082dada638e3d79d059e4f6cd412c712d..c1bbfd697bbdb88c9963bf56df46a3f87d3b6da7 100644 (file)
@@ -1,6 +1,6 @@
 changecom(`;');;; -*-Midas-*-
 ;;;
-;;;    $Id: hppa.m4,v 1.27 1993/06/30 03:35:29 gjr Exp $
+;;;    $Id: hppa.m4,v 1.28 1993/07/27 17:47:34 gjr Exp $
 ;;;
 ;;;    Copyright (c) 1989-1993 Massachusetts Institute of Technology
 ;;;
@@ -1030,6 +1030,7 @@ floating_vector_cons
 \f
 define(define_floating_point_util,
 "flonum_$1
+       STW     2,8(0,4)                        ; preserve val
        COPY    22,18                           ; preserve regs
        COPY    21,17
        COPY    19,16
@@ -1039,6 +1040,7 @@ define(define_floating_point_util,
        COPY    16,19
        COPY    17,21
        COPY    18,22
+       LDW     8(0,4),2                        ; restore val
        BE      0(5,15)
        LDW     0(0,4),20")
 
@@ -1055,6 +1057,7 @@ define_floating_point_util(ceiling,ceil)
 define_floating_point_util(floor,floor)
 
 flonum_atan2
+       STW     2,8(0,4)                        ; preserve val
        COPY    22,18                           ; preserve regs
        COPY    21,17
        COPY    19,16
@@ -1064,6 +1067,7 @@ flonum_atan2
        COPY    16,19
        COPY    17,21
        COPY    18,22
+       LDW     8(0,4),2                        ; restore val
        BE      0(5,15)
        LDW     0(0,4),20