Changeset 14098


Ignore:
Timestamp:
Aug 1, 2010, 5:21:34 AM (9 years ago)
Author:
gb
Message:

Fix braino in UNBOX-S8; new subprim call/jump scheme.

File:
1 edited

Legend:

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

    r14087 r14098  
    12071207(define-arm-vinsn unbox-s8 (((dest :s8))
    12081208                            ((src :lisp)))
    1209   (mov dest (:lsl dest (:$ (- 24 arm::fixnumshift))))
     1209  (mov dest (:lsl src (:$ (- 24 arm::fixnumshift))))
    12101210  (mov dest (:asr dest (:$ 24)))
    12111211  (cmp src (:lsl dest (:$ arm::fixnumshift)))
     
    12561256  (fmsr dest imm)
    12571257  (fsitos dest dest)
    1258   (bl .SPcheck-fpu-exception))
     1258  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1259  (blx lr))
    12591260
    12601261(define-arm-vinsn (shift-left-variable-word :predicatable)
     
    14681469  (fmxr fpscr imm)
    14691470  (faddd result x y)
    1470   (bl .SPcheck-fpu-exception))
     1471  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1472  (blx lr))
    14711473
    14721474(define-arm-vinsn (double-float--2 :predicatable)
     
    14851487  (fmxr fpscr imm)
    14861488  (fsubd result x y)
    1487   (bl .SPcheck-fpu-exception))
     1489  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1490  (blx lr))
    14881491
    14891492(define-arm-vinsn (double-float*-2 :predicatable)
     
    14961499    (((result :double-float))
    14971500     ((x :double-float)
    1498       (y :double-float)))
     1501      (y :double-float))
     1502     ((imm :u32)))
     1503  (fmrx imm fpscr)
     1504  (bic imm imm (:$ #xff))
     1505  (fmxr fpscr imm)
    14991506  (fmuld result x y)
    1500   (bl .SPcheck-fpu-exception))
     1507  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1508  (blx lr))
    15011509
    15021510(define-arm-vinsn (double-float/-2 :predicatable)
     
    15151523  (fmxr fpscr imm)
    15161524  (fdivd result x y)
    1517   (bl .SPcheck-fpu-exception))
     1525  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1526  (blx lr))
    15181527
    15191528
     
    15411550  (fmxr fpscr imm)
    15421551  (fadds result x y)
    1543   (bl .SPcheck-fpu-exception))
     1552  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1553  (blx lr))
    15441554
    15451555(define-arm-vinsn (single-float--2 :predicatable)
     
    15581568  (fmxr fpscr imm)
    15591569  (fsubs result x y)
    1560   (bl .SPcheck-fpu-exception))
     1570  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1571  (blx lr))
    15611572
    15621573(define-arm-vinsn (single-float*-2 :predicatable)
     
    15751586  (fmxr fpscr imm)
    15761587  (fmuls result x y)
    1577   (bl .SPcheck-fpu-exception))
     1588  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1589  (blx lr))
    15781590
    15791591(define-arm-vinsn (single-float/-2 :predicatable)
     
    15921604  (fmxr fpscr imm)
    15931605  (fdivs result x y)
    1594   (bl .SPcheck-fpu-exception))
     1606  (mov lr (:$ (subprim-name->offset '.SPcheck-fpu-exception)))
     1607  (blx lr))
    15951608
    15961609
     
    18441857(define-arm-vinsn (call-subprim :call :subprim-call) (()
    18451858                                                      ((spno :s32const)))
    1846   (bl spno))
     1859  (mov lr (:$ spno))
     1860  (blx lr))
    18471861
    18481862(define-arm-vinsn (jump-subprim :jumpLR) (()
    1849                                           ((spno :s32const)))
    1850   (ba spno))
     1863                                          ((spno :s32const)
     1864                                           (reg :imm)))
     1865  (mov reg (:$ spno))
     1866  (bx reg))
    18511867
    18521868;;; Same as "call-subprim", but gives us a place to
     
    18541870(define-arm-vinsn (call-subprim-0 :call :subprim-call) (((dest t))
    18551871                                                        ((spno :s32const)))
    1856   (bl spno))
     1872  (mov lr (:$ spno))
     1873  (blx lr))
    18571874
    18581875(define-arm-vinsn (call-subprim-1 :call :subprim-call) (((dest t))
    18591876                                                        ((spno :s32const)
    18601877                                                         (z t)))
    1861   (bl spno))
     1878  (mov lr (:$ spno))
     1879  (blx lr))
    18621880 
    18631881(define-arm-vinsn (call-subprim-2 :call :subprim-call) (((dest t))
     
    18651883                                                         (y t)
    18661884                                                         (z t)))
    1867   (bl spno))
     1885  (mov lr (:$ spno))
     1886  (blx lr))
    18681887
    18691888(define-arm-vinsn (call-subprim-3 :call :subprim-call) (((dest t))
     
    18721891                                                         (y t)
    18731892                                                         (z t)))
    1874   (bl spno))
     1893  (mov lr (:$ spno))
     1894  (blx lr))
    18751895
    18761896
     
    21522172     ((frame-offset :u16const)
    21532173      (cur-vsp :u16const)))
    2154   (ldr dest (:@ vsp (:$ (:apply - (:apply - cur-vsp 4) frame-offset)))))
     2174  ((:pred < (:apply - (:apply - cur-vsp 4) frame-offset) 4096)
     2175   (ldr dest (:@ vsp (:$ (:apply - (:apply - cur-vsp 4) frame-offset)))))
     2176  ((:pred >= (:apply - (:apply - cur-vsp 4) frame-offset) 4096)
     2177   (movw dest (:$ (:apply - (:apply - cur-vsp 4) frame-offset)))
     2178   (ldr dest (:@ vsp dest))))
    21552179
    21562180(define-arm-vinsn (lcell-store :predicatable)
     
    21682192      (frame-offset :u16const)
    21692193      (cur-vsp :u16const)))
    2170   (str src (:@ vsp (:$ (:apply - (:apply - cur-vsp 4) frame-offset)))))
     2194  ((:pred < (:apply - (:apply - cur-vsp 4) frame-offset) 4096)
     2195   (str src (:@ vsp (:$ (:apply - (:apply - cur-vsp 4) frame-offset)))))
     2196  ((:pred >= (:apply - (:apply - cur-vsp 4) frame-offset) 4096)
     2197   (str rcontext (:@! vsp (:$ (- arm::node-size))))
     2198   (movw rcontext (:$ (:apply - cur-vsp frame-offset)))
     2199   (str src (:+@ vsp rcontext))
     2200   (ldr rcontext (:@+ vsp (:$ arm::node-size)))))
    21712201
    21722202(define-arm-vinsn (load-vframe-address :predicatable)
     
    25382568                                              )
    25392569  (rsbs arm::arg_z src (:$ 0))
    2540   (blvs .SPfix-overflow))
     2570  (movvs lr (:$ (subprim-name->offset '.SPfix-overflow)))
     2571  (blxvs lr))
    25412572 
    25422573                                                 
     
    27442775                                           ())
    27452776  (adds arm::arg_z x y)
    2746   (blvs .SPfix-overflow))
     2777  (movvs lr (:$ (subprim-name->offset '.SPfix-overflow)))
     2778  (blxvs lr))
    27472779
    27482780(define-arm-vinsn fixnum-add-overflow-inline (((dest :lisp))
     
    28062838
    28072839
    2808 (define-arm-vinsn fixnum-sub-overflow-ool (((result (:lisp #.arm::arg_z)))
    2809                                            ((x :imm)
    2810                                             (y :imm)))
     2840(define-arm-vinsn (fixnum-sub-overflow-ool :call :subprim-call)
     2841    (((result (:lisp #.arm::arg_z)))
     2842     ((x :imm)
     2843      (y :imm)))
    28112844  (subs arm::arg_z x y)
    2812   (blvs .SPfix-overflow))
     2845  (movvs lr (:$ (subprim-name->offset '.SPfix-overflow)))
     2846  (blxvs lr))
    28132847
    28142848(define-arm-vinsn fixnum-sub-overflow-inline (((dest :lisp))
     
    28942928    (((val :lisp))
    28952929     ((sym (:lisp (:ne val)))))
    2896   (bl .SPspecrefcheck))
     2930  (mov lr (:$ (subprim-name->offset '.SPspecrefcheck)))
     2931  (blx lr))
    28972932
    28982933(define-arm-vinsn ref-symbol-value-inline (((dest :lisp))
     
    29142949    (((val :lisp))
    29152950     ((sym (:lisp (:ne val)))))
    2916   (bl .SPspecref))
     2951  (mov lr (:$ (subprim-name->offset '.SPspecref)))
     2952  (blx lr))
    29172953
    29182954(define-arm-vinsn %ref-symbol-value-inline (((dest :lisp))
     
    29332969     ((sym :lisp)
    29342970      (val :lisp)))
    2935   (bl .SPspecset))
     2971  (mov  lr (:$ (subprim-name->offset '.SPspecset)))
     2972  (blx lr))
    29362973
    29372974
     
    30143051  ((:pred > n 1)
    30153052   (mov temp (:$ n))
    3016    (bl .SPunbind-n))
     3053   (mov lr (:$ (subprim-name->offset '.SPunbind-n))))
    30173054  ((:pred = n 1)
    3018    (bl .SPunbind)))
     3055   (mov lr (:$ (subprim-name->offset '.SPunbind))))
     3056  (blx lr))
    30193057
    30203058(define-arm-vinsn (zero-double-float-register :predicatable)
     
    31363174;; Vpush the argument registers.  We got at least "min-fixed" args;
    31373175;; that knowledge may help us generate better code.
    3138 (define-arm-vinsn (save-lexpr-argregs :call :subprim-call)
     3176(define-arm-vinsn save-lexpr-argregs
    31393177    (()
    31403178     ((min-fixed :u16const))
     
    32953333(define-arm-vinsn (default-optionals :call :subprim-call) (()
    32963334                                                           ((n :u16const)))
     3335  (mov lr (:$ (subprim-name->offset '.SPdefault-optional-args)))
    32973336  (mov imm0 (:$ (:apply ash n 2)))
    3298   (bl .SPdefault-optional-args))
     3337  (blx lr))
    32993338
    33003339;;; fname contains a known symbol
     
    35273566(defmacro define-arm-subprim-call-vinsn ((name &rest other-attrs) spno)
    35283567  `(define-arm-vinsn (,name :call :subprim-call ,@other-attrs) (() ())
    3529     (bl ,spno)))
    3530 
    3531 (defmacro define-arm-subprim-jump-vinsn ((name &rest other-attrs) spno)
     3568    (mov lr (:$ (subprim-name->offset ',spno)))
     3569    (blx lr)))
     3570
     3571(defmacro define-arm-subprim-jump-vinsn ((name &rest other-attrs) spno &optional (reg 'imm0))
    35323572  `(define-arm-vinsn (,name  :jumpLR ,@other-attrs) (() ())
    3533     (ba ,spno)))
     3573    (mov ,reg (:$ (subprim-name->offset ',spno)))
     3574    (bx ,reg)))
    35343575
    35353576
     
    35673608(define-arm-vinsn (tail-funcall-vsp :jumpLR :predicatable) (() ())
    35683609  (ldmia (:! sp) (imm0 vsp fn lr))
    3569   (ba .SPfuncall))
     3610  (mov imm0 (:$ (subprim-name->offset '.SPfuncall)))
     3611  (bx imm0))
    35703612
    35713613(define-arm-subprim-call-vinsn (spread-lexpr)  .SPspread-lexprz)
     
    36433685(define-arm-vinsn (nth-value :call :subprim-call) (((result :lisp))
    36443686                                                   ())
    3645   (bl .SPnthvalue))
     3687  (mov lr (:$ (subprim-name->offset '.SPnthvalue)))
     3688  (blx lr))
    36463689
    36473690(define-arm-subprim-call-vinsn (fitvals) .SPfitvals)
     
    36593702(define-arm-vinsn (throw :jump-unknown) (()
    36603703                                         ())
    3661   (bl .SPthrow))
     3704  (mov lr (:$ (subprim-name->offset '.SPthrow)))
     3705  (blx lr))
    36623706
    36633707(define-arm-subprim-call-vinsn (mkcatchmv) .SPmkcatchmv)
Note: See TracChangeset for help on using the changeset viewer.