Changeset 12310


Ignore:
Timestamp:
Jun 27, 2009, 10:44:04 PM (10 years ago)
Author:
gb
Message:

In %INT-TO-SFLOAT[!], need to round double-precision result of
INT-TO-FREG to single-precision before storing in memory (both
to get the rounding right and to detect overflow.)

#+ppc64-target
(%short-float 150296004006954)

should be 1.50296E+14, not 1.5029599E+14.
(or at least the former answer is a much closer
approximation, and we've been getting the latter
because of a failure to do the FRSP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/PPC/ppc-float.lisp

    r5647 r12310  
    336336(defppclapfunction %int-to-sfloat! ((int arg_y) (sfloat arg_z))
    337337  (int-to-freg int fp0 imm0)
    338   (stfs fp0 ppc32::single-float.value sfloat)
     338  (frsp fp1 fp0)
     339  (stfs fp1 ppc32::single-float.value sfloat)
    339340  (blr))
    340341
     
    342343(defppclapfunction %int-to-sfloat ((int arg_z))
    343344  (int-to-freg int fp0 imm0)
    344   (stfs fp0 ppc64::tcr.single-float-convert ppc64::rcontext)
     345  (frsp fp1 fp0)
     346  (stfs fp1 ppc64::tcr.single-float-convert ppc64::rcontext)
    345347  (ld arg_z ppc64::tcr.single-float-convert ppc64::rcontext)
    346348  (blr))
Note: See TracChangeset for help on using the changeset viewer.