Changeset 13998


Ignore:
Timestamp:
Jul 21, 2010, 4:03:14 AM (9 years ago)
Author:
gb
Message:

Fix in %MAKE-FLOAT-FROM-FIXNUMS.
Get control bits right in SET-FPU-MODE.
Given FPSCR status bits, use FP-CONDITION-NAME-FROM-FPSCR-STATUS to
derive a condition name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/level-0/ARM/arm-float.lisp

    r13968 r13998  
    3838  (orr imm1 imm1 (:lsl imm0 (:$ 28)))
    3939  (mov imm0 (:lsr imm0 (:$ 4)))
     40  (bic imm0 imm0 (:$ #xff000000))
     41  (bic imm0 imm0 (:$ #x00f00000))
    4042  (orr imm0 imm0 (:lsl exp (:$ (- 20 arm::fixnumshift)))) ;  exp left 20 right 2 keep 11 bits
    4143  (ldr arg_z (:@ vsp (:$ float)))
     
    322324    (when invalid-p
    323325      (if invalid
    324         (bitclrf arm::ioe new)
    325         (bitsetf arm::ioe new)))
     326        (bitsetf arm::ioe new)
     327        (bitclrf arm::ioe new)))
    326328    (when overflow-p
    327329      (if overflow
    328         (bitclrf arm::ofe new)
    329         (bitsetf arm::ofe new)))
     330        (bitsetf arm::ofe new)
     331        (bitclrf arm::ofe new)))
    330332    (when underflow-p
    331333      (if underflow
    332         (bitclrf arm::ufe new)
    333         (bitsetf arm::ufe new)))
     334        (bitsetf arm::ufe new)
     335        (bitclrf arm::ufe new)))
    334336    (when zero-p
    335337      (if division-by-zero
    336         (bitclrf arm::dze new)
    337         (bitsetf arm::dze new)))
     338        (bitsetf arm::dze new)
     339        (bitclrf arm::dze new)))
    338340    (when inexact-p
    339341      (if inexact
    340         (bitclrf arm::ixe new)
    341         (bitsetf arm::ixe new)))
     342        (bitsetf arm::ixe new)
     343        (bitclrf arm::ixe new)))
    342344    (unless (= current new)
    343345      (%set-fpscr-control new))
     
    403405  (bx lr))
    404406
     407(defun fp-condition-name-from-fpscr-status (status)
     408  (cond
     409    ((logbitp arm::ioc status) 'floating-point-invalid-operation)
     410    ((logbitp arm::dzc status) 'division-by-zero)
     411    ((logbitp arm::ofc status) 'floating-point-overflow)
     412    ((logbitp arm::ufc status) 'floating-point-underflow)
     413    ((logbitp arm::ixc status) 'floating-point-inexact)))
     414     
    405415 
    406416#+notyet
Note: See TracChangeset for help on using the changeset viewer.