Changeset 13906


Ignore:
Timestamp:
Jul 1, 2010, 1:25:40 PM (9 years ago)
Author:
gb
Message:

arm-spentry.s: 32-bit misc-set: arg_y is the index, not arg_z.

arm-bignum.lisp: %FLOOR-99.

arm-float.lisp: several fixes.

arm-asm.lisp: fmrrd and fmdrr were encoded wrong. fabss and fabsd need
to mask more bits in disassembler.

arm-vinsns.lisp: zero-single-float-register, zero-double-float-register
were backwards.

Location:
branches/arm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/compiler/ARM/arm-asm.lisp

    r13903 r13906  
    596596   (define-arm-instruction fabsd (:dd :dm)
    597597     #x0eb00bc0
    598      #x0ff00ff0
     598     #x0fff0ff0
    599599     ())
    600600   (define-arm-instruction fabss (:sd :sm)
    601601     #x0eb00ac0
    602      #x0fb00fb0
     602     #x0fbf0fb0
    603603     ())
    604604   (define-arm-instruction fnegd (:dd :dm)
     
    635635     ())
    636636   (define-arm-instruction fmrrd (:rd :rn :dm)
    637      #x0e500b10
     637     #x0c500b10
    638638     #x0ff00ff0
    639639     ())
    640640   (define-arm-instruction fmdrr (:dm :rd :rn)
    641      #x0e400b10
     641     #x0c400b10
    642642     #x0ff00ff0
    643643     ())
  • branches/arm/compiler/ARM/arm-vinsns.lisp

    r13897 r13906  
    27542754(define-arm-vinsn zero-double-float-register (((dest :double-float))
    27552755                                              ()
    2756                                               ((temp :imm)))
    2757   (mov temp (:$ 0))
    2758   (fmsr dest temp))
     2756                                              ((low (:u32 #.arm::imm0))))
     2757  (mov low (:$ 0))
     2758  (fmdrr dest low low))
    27592759
    27602760(define-arm-vinsn zero-single-float-register (((dest :single-float))
     
    27622762                                              ((temp :imm)))
    27632763  (mov temp (:$ 0))
    2764   (fmdrr dest temp temp))
     2764  (fmsr dest temp))
    27652765
    27662766(define-arm-vinsn load-double-float-constant (((dest :double-float))
  • branches/arm/level-0/ARM/arm-bignum.lisp

    r13903 r13906  
    12291229    (bx lr)))
    12301230
     1231;;; If x[i] = y[j], return the all ones digit (as two halves).
     1232;;; Otherwise, compute floor x[i]x[i-1] / y[j].
     1233(defarmlapfunction %floor-99 ((x-stk 0) (xidx arg_x) (yptr arg_y) (yidx arg_z))
     1234  (add imm1 vsp (:$ 4))
     1235  (build-lisp-frame imm0 imm1)
     1236  (ldr temp0 (:@ vsp (:$ x-stk)))
     1237  (add imm0 xidx (:$ arm::misc-data-offset))
     1238  (add imm1 yidx (:$ arm::misc-data-offset))
     1239  (ldr imm0 (:@ temp0 imm0))
     1240  (ldr imm2 (:@ yptr imm1))
     1241  (cmp imm0 imm2)
     1242  (bne @more)
     1243  (mov imm0 (:$ (ash #xff arm::fixnumshift)))
     1244  (orr imm0 imm0 (:$ (ash #xff00 arm::fixnumshift)))
     1245  (vpush1 imm0)
     1246  (vpush1 imm0)
     1247  (set-nargs 2)
     1248  (ba .SPnvalret)
     1249  @more
     1250  (add imm1 xidx (:$ (- arm::misc-data-offset arm::node-size)))
     1251  (ldr imm0 (:@ temp0 imm1))
     1252  (add imm1 imm1 (:$ arm::node-size))
     1253  (ldr imm1 (:@ temp0 imm1))
     1254  (bl .SPudiv64by32)
     1255  (mov arg_y '-1)
     1256  (and arg_y arg_y (:lsr imm0 (:$ (- 16 arm::fixnumshift))))
     1257  (mov imm0 (:lsl imm0 (:$ 16)))
     1258  (mov arg_z '-1)
     1259  (and arg_z arg_z (:lsr imm0 (:$ (- 16 arm::fixnumshift))))
     1260  (stmdb (:! vsp) (arg_z arg_y))
     1261  (set-nargs 2)
     1262  (ba .SPnvalret))
     1263
     1264
    12311265; End of arm-bignum.lisp
  • branches/arm/level-0/ARM/arm-float.lisp

    r13903 r13906  
    3232
    3333(defarmlapfunction %make-float-from-fixnums ((float 4)(hi 0) (lo arg_x) (exp arg_y) (sign arg_z))
    34   (and imm0 sign (:$ #x80000000))  ; just leave sign bit
    35   (ldr imm1 (:@ vsp (:$ hi)))
     34  (ldr imm0 (:@ vsp (:$ hi)))
     35  (unbox-fixnum imm0 imm0)
     36  (unbox-fixnum imm1 lo)
     37  (cmp sign (:$ 0))
     38  (orr imm1 imm1 (:lsl imm0 (:$ 28)))
     39  (mov imm0 (:lsr imm0 (:$ 4)))
    3640  (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)))
    41   (ldr temp0 (:@ vsp (:$ float)))         ; the float
    42   (str imm0 (:@ temp0 (:$ arm::double-float.val-high)))
    43   (str imm1 (:@ temp0 (:$ arm::double-float.val-low)))
     41  (ldr arg_z (:@ vsp (:$ float)))
     42  (orrmi imm0 imm0 (:$ #x80000000))
     43  (str imm0 (:@ arg_z (:$ arm::double-float.val-high)))
     44  (str imm1 (:@ arg_z (:$ arm::double-float.val-low)))
    4445  (add vsp vsp '2)
    4546  (bx lr))
     
    8687
    8788;;; rets hi (25 bits) lo (28 bits) exp sign
    88 #+later
    8989(defarmlapfunction %integer-decode-double-float ((n arg_z))
    90   (ldr imm0  (:@ n (:$ arm::double-float.value)))
    91   (rlwinm imm1 imm0 (+ 1 arm::fixnumshift) (- 32 arm::fixnumshift 1) ; sign boxed
    92                                            (- 32 arm::fixnumshift 1))
    93   (add imm1 imm1 imm1)  ; imm1 = (fixnum 2) (neg) or 0 (pos)
    94   (subfic temp0 imm1 '1)  ; sign boxed
    95   (rlwinm. imm2 imm0 (- 32 20)  21  31)   ; right 20, keep 11 bits exp - test for 0
    96   ;(subi imm2 imm2 (+ 53 1022))            ; unbias and scale
    97   (slwi imm2 imm2 arm::fixnumshift)      ; box
    98   (mr temp1 imm2)                        ; boxed unbiased exponent
    99   (rlwinm imm0 imm0 12  0 19)            ; 20 bits of hi float left 12
    100   (beq @denorm)                          ; cr set way back
    101   (addi imm0 imm0 1)                     ;  add implied 1
    102   @denorm
    103   (rlwinm imm0 imm0 (+ (- 32 12) 4 arm::fixnumshift) 0 31)
    104   (ldr imm1 (:@ n (:$ arm::double-float.val-low))) ;
    105   (rlwimi imm0 imm1 (+ 4 arm::fixnumshift)
    106                     (1+ (- 31 4 arm::fixnumshift))
    107                     (- 31 arm::fixnumshift))  ; high 4 bits in fixnum pos
    108   (rlwinm imm1 imm1 (- 4 arm::fixnumshift)
    109                     (- 4 arm::fixnumshift)
    110                     (- 31 arm::fixnum-shift)) ; 28 bits  thats 2 2 29
    111   (vpush imm0)   ; hi 25 bits of mantissa (includes implied 1)
    112   (vpush imm1)   ; lo 28 bits of mantissa
    113   (vpush temp1)  ; exp
    114   (vpush temp0)  ; sign
     90  (ldr imm0  (:@ n (:$ arm::double-float.val-high)))
     91  (mov temp0 '1)
     92  (tst imm0 (:$ #x80000000))
     93  (movne temp0 '-1)
     94  (bic imm1 imm0 (:$ #x80000000))
     95  (mov temp1 '-1)
     96  (ands temp1 temp1 (:lsr imm1 (:$ (- (- IEEE-double-float-exponent-offset 32)
     97                                      arm::fixnumshift))))
     98  (mov imm0 (:lsl imm0 (:$ 12)))
     99  (mov imm0 (:lsr imm0 (:$ 12)))
     100  (ldr imm1 (:@ n (:$ arm::double-float.val-low)))
     101  (orrne imm0 imm0 (:$ (ash 1 (- IEEE-double-float-hidden-bit 32))))
     102  (mov imm0 (:lsl imm0 (:$ 4)))
     103  (orr imm0 imm0 (:lsr imm1 (:$ (- 32 4))))
     104  (box-fixnum imm0 imm0)
     105  (mov imm1 (:lsl imm1 (:$ 4)))
     106  (mov imm1 (:lsr imm1 (:$ (- 4 arm::fixnumshift))))
     107  (vpush1 imm0)   ; hi 25 bits of mantissa (includes implied 1)
     108  (vpush1 imm1)   ; lo 28 bits of mantissa
     109  (vpush1 temp1)  ; exp
     110  (vpush1 temp0)  ; sign
    115111  (set-nargs 4)
    116   (la temp0 '4 vsp)
     112  (add temp0 vsp '4)
    117113  (ba .SPvalues))
    118114
     
    120116;;; hi is 25 bits lo is 28 bits
    121117;;; big is 32 lo, 21 hi right justified
    122 
    123 #+later
    124118(defarmlapfunction make-big-53 ((hi arg_x)(lo arg_y)(big arg_z))
    125   (rlwinm imm0 lo (- 32 arm::fixnumshift) 4 31)
    126   (rlwimi imm0 hi (- 32 4 arm::fixnumshift) 0 3)
    127   (stw imm0 (+ arm::misc-data-offset 0) big)   ; low goes in 1st wd
    128   (rlwinm imm0 hi (- 32 (+ arm::fixnumshift 4)) 11 31)  ; high in second
    129   (stw imm0 (+ arm::misc-data-offset 4) big)
    130   (bx lr))
    131 
    132 
    133 #+later
     119  (unbox-fixnum imm0 hi)
     120  (unbox-fixnum imm1 lo)
     121  (orr imm1 imm1 (:lsl imm0 (:$ 28)))
     122  (mov imm0 (:lsr imm0 (:$ 4)))
     123  (str imm0 (:@ big (:$ arm::double-float.val-high)))
     124  (str imm1 (:@ big (:$ arm::double-float.val-low)))
     125  (bx lr))
     126
     127
    134128(defarmlapfunction dfloat-significand-zeros ((dfloat arg_z))
    135129  (ldr imm1 (:@ dfloat (:$ arm::double-float.value)))
    136   (rlwinm. imm1 imm1 12 0 19)
    137   (cntlzw imm1 imm1)
    138   (beq @golo)
    139   (box-fixnum arg_z imm1)
    140   (bx lr)
     130  (movs imm1 (:lsl imm1 (:$ 12)))
     131  (clz imm1 imm1)
     132  (movne arg_z (:lsl imm1 (:$ arm::fixnumshift)))
     133  (bxne lr)
    141134  @golo
    142135  (ldr imm1 (:@ dfloat (:$ arm::double-float.val-low)))
    143   (cntlzw imm1 imm1)
    144   (addi imm1 imm1 20)
     136  (clz imm1 imm1)
     137  (add imm1 imm1 (:$ 20))
    145138  (box-fixnum arg_z imm1)
    146139  (bx lr))
    147140
    148 #+later
    149141(defarmlapfunction sfloat-significand-zeros ((sfloat arg_z))
    150    (ldr imm1 (:@ sfloat (:$ arm::single-float.value)))
    151   (rlwinm imm1 imm1 9 0 22)
    152   (cntlzw imm1 imm1)
     142  (ldr imm1 (:@ sfloat (:$ arm::single-float.value)))
     143  (mov imm1 (:lsl imm1 (:$ 9)))
     144  (clz imm1 imm1)
    153145  (box-fixnum arg_z imm1)
    154146  (bx lr))
  • branches/arm/lisp-kernel/arm-spentry.s

    r13903 r13906  
    36893689        __(b _SPksignalerr)
    36903690local_label(misc_set_fixnum_vector):   
    3691         __(add imm0,arg_z,#misc_data_offset)
     3691        __(add imm0,arg_y,#misc_data_offset)
    36923692        __(test_fixnum(arg_z))
    36933693        __(bne local_label(set_bad))
     
    36963696        __(bx lr)
    36973697local_label(misc_set_new_string):   
    3698         __(add imm0,arg_z,#misc_data_offset)
     3698        __(add imm0,arg_y,#misc_data_offset)
    36993699        __(extract_lowbyte(imm2,arg_z))
    37003700        __(cmp imm2,#subtag_character)
     
    37043704        __(bx lr)
    37053705local_label(misc_set_s32):
    3706         __(add imm0,arg_z,#misc_data_offset)
     3706        __(add imm0,arg_y,#misc_data_offset)
    37073707        __(test_fixnum(arg_z))
    37083708        __(moveq imm1,arg_z,asr #fixnumshift)
     
    37183718        __(b local_label(set_bad))
    37193719local_label(misc_set_single_float_vector):
    3720         __(add imm0,arg_z,#misc_data_offset)
     3720        __(add imm0,arg_y,#misc_data_offset)
    37213721        __(extract_typecode(imm2,arg_z))
    37223722        __(cmp imm2,#subtag_single_float)
Note: See TracChangeset for help on using the changeset viewer.