Changeset 13846


Ignore:
Timestamp:
Jun 16, 2010, 9:44:31 AM (9 years ago)
Author:
gb
Message:

%make[-short]-float-from-fixnums.

File:
1 edited

Legend:

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

    r13805 r13846  
    3030;;; no error checks, no tweaks, no nuthin
    3131
    32 #+later
     32
    3333(defarmlapfunction %make-float-from-fixnums ((float 4)(hi 0) (lo arg_x) (exp arg_y) (sign arg_z))
    34   (rlwinm imm0 sign 0 0 0)  ; just leave sign bit
    35   (rlwimi imm0 exp (- 20 arm::fixnumshift)  1 11) ;  exp left 20 right 2 keep 11 bits
     34  (and imm0 sign (:$ #x80000000))  ; just leave sign bit
    3635  (ldr imm1 (:@ vsp (:$ hi)))
    37   (srawi imm1 imm1 arm::fixnumshift)   ; fold into below? nah keep for later
    38   (rlwimi imm0 imm1 (- 32 4) 12 31)   ; right 4 - keep  20 - stuff into hi result
    39   (rlwinm imm1 imm1 28 0 3)  ; hi goes left 28 - keep 4 hi bits
    40   (rlwimi imm1 lo (- 32 arm::fixnumshift) 4 31) ; stuff in 28 bits of lo
     36  (orr imm0 imm0 (:lsl exp (:$ (- 20 arm::fixnumshift)))) ;  exp left 20 right 2 keep 11 bits
     37  (unbox-fixnum imm1 imm1)
     38  (orr imm0 imm0 (:lsr imm1 (:$ 4)))
     39  (and imm1 imm1 (:$ #xf0000000))
     40  (orr imm1 imm1 (:lsr lo (:$ arm::fixnumshift)))
    4141  (ldr temp0 (:@ vsp (:$ float)))         ; the float
    42   (stw imm0 arm::double-float.value temp0)
    43   (stw imm1 arm::double-float.val-low temp0)
    44   (la vsp 8 vsp)
    45   (blr))
    46 
    47 
    48 #+later
     42  (str imm0 (:@ temp0 (:$ arm::double-float.val-high)))
     43  (str imm1 (:@ temp0 (:$ arm::double-float.val-low)))
     44  (add vsp vsp '2)
     45  (bx lr))
     46
     47
    4948(defarmlapfunction %make-short-float-from-fixnums ((float 0) (sig arg_x) (exp arg_y) (sign arg_z))
    5049  (unbox-fixnum imm0 sig)
    51   (rlwimi imm0 exp (- 29 8) 1 8)
    52   (inslwi imm0 sign 1 0)
    53   (vpop arg_z)
    54   (stw imm0 arm::single-float.value arg_z)
    55   (blr))
     50  (and imm1 sign (:$ #x800000000))
     51  (orr imm0 imm0 (:lsl exp (:$ (- 23 arm::fixnumshift))))
     52  (orr imm0 imm0 imm1)
     53  (vpop1 arg_z)
     54  (str imm0 (:@ arg_z (:$ arm::single-float.value)))
     55  (bx lr))
    5656
    5757
Note: See TracChangeset for help on using the changeset viewer.