Changeset 14914 for release


Ignore:
Timestamp:
Jul 28, 2011, 4:50:29 PM (8 years ago)
Author:
rme
Message:

Merge ARM assembler changes from trunk.

Location:
release/1.7/source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • release/1.7/source

  • release/1.7/source/compiler/ARM/arm-asm.lisp

    r14772 r14914  
    8181          (arm-constant-index quoted))))
    8282    (progn
    83       (unless (and (consp form) (eq (keywordize (car form)) :$))
     83      (unless (and (consp form) (eq (car form) :$))
    8484        (error "Invalid constant syntax in ~s" form))
    8585      (destructuring-bind (val) (cdr form)
     
    124124    :fpux
    125125    :imm16
     126    :srcount                            ;single register count
     127    :drcount
    126128    ))
    127129
     
    787789     #x0f300f00
    788790     ())
     791   (define-arm-instruction fstmdbs (:sd :rnw :srcount)
     792     #x0d200a00
     793     #x0fb00f00
     794     ())
     795   (define-arm-instruction fstmdbd (:dd :rnw :drcount)
     796     #x0d200b00
     797     #x0fb00f00
     798     ())
    789799   (define-arm-instruction fldd (:dd :fpaddr)
    790800     #x0d100b00
     
    795805     #x0f300f00
    796806     ())
     807   (define-arm-instruction fldmias (:sd :rnw :srcount)
     808     #x0cb00a00
     809     #x0fb00f00
     810     ())
     811   (define-arm-instruction fldmiad (:dd :rnw :srcount)
     812     #x0cb00b00
     813     #x0fb00f00
     814     ())     
    797815   (define-arm-instruction ftosid (:sd :dm)
    798816     #x0ebd0b40
     
    873891        (values nil nil nil)))))
    874892
    875 (defun keywordize (name)
    876   (if (typep name 'keyword)
    877     name
    878     (intern (string-upcase (string name)) "KEYWORD")))
     893
    879894
    880895(defun arm-rotate-left (u32 nbits)
     
    11121127    (if (ccl::quoted-form-p form)
    11131128      (insert-shifter-constant (need-constant form) instruction)
    1114       (let* ((op (keywordize (car form))))
     1129      (let* ((op (car form)))
    11151130        (ecase op
    11161131          (:$ (destructuring-bind (value) (cdr form)
     
    11281143                                        (ash (encode-arm-shift-type op) 5)
    11291144                                        (ash (need-arm-gpr count) 8)))
    1130                (ecase (keywordize (car count))
     1145               (ecase (car count)
    11311146                 (:$ (destructuring-bind (countval) (cdr count)
    11321147                       (set-field-value instruction (byte 12 0)
     
    11971212  (if (atom form)
    11981213    (error "Invalid memory operand ~s" form)   
    1199     (let* ((mode (keywordize (car form))))
     1214    (let* ((mode (car form)))
    12001215      (if (eq mode :=)
    12011216        (destructuring-bind (label) (cdr form)
     
    12111226          (set-field-value instruction (byte 4 16) (need-arm-gpr rn))
    12121227          (let* ((quoted (ccl::quoted-form-p index))
    1213                  (index-op (if quoted :quote (and (consp index) (keywordize (car index)))))
     1228                 (index-op (if quoted :quote (and (consp index) (car index))))
    12141229                 (constant-index (or quoted (eq index-op :$))))
    12151230            (cond (constant-index
     
    12381253                       (destructuring-bind (rm shift-expr) (cdr index)
    12391254                         (unless (and (consp shift-expr)
    1240                                       (eq (keywordize (car shift-expr)) :$))
     1255                                      (eq (car shift-expr) :$))
    12411256                           (error "Shift count must be immediate : ~s" shift-expr))
    12421257                         (destructuring-bind (count-expr) (cdr shift-expr)
     
    12631278  (if (atom form)
    12641279    (set-field-value instruction (byte 4 16) (need-arm-gpr form))
    1265     (if (eq (keywordize (car form)) :!)
     1280    (if (eq (car form) :!)
    12661281      (destructuring-bind (rn) (cdr form)
    12671282        (set-field-value instruction (byte 1 21) 1)
     
    12841299  (let* ((regno (if (typep form '(unsigned-byte 4))
    12851300                  form
    1286                   (ecase (keywordize form)
     1301                  (ecase form
    12871302                    (:fpsid 0)
    12881303                    (:fpscr 1)
     
    12921307(defun parse-imm16-operand (form instruction)
    12931308  (unless (and (consp form)
    1294                (eq (keywordize (car form)) :$)
     1309               (eq (car form) :$)
    12951310               (consp (cdr form))
    12961311               (null (cddr form)))
     
    13001315    (set-field-value instruction (byte 4 16) (ldb (byte 4 12) val))))
    13011316   
     1317(defun parse-srcount-operand (form instruction)
     1318  (let* ((val (eval form)))
     1319    (unless (and (typep val 'fixnum)
     1320                 (> (the fixnum val) 0)
     1321                 (< (the fixnum val) 33))
     1322      (ccl::report-bad-arg form `(integer (0) (33))))
     1323    (set-field-value instruction (byte 8 0) val)))
     1324
     1325(defun parse-drcount-operand (form instruction)
     1326  (let* ((val (eval form)))
     1327    (unless (and (typep val 'fixnum)
     1328                 (> (the fixnum val) 0)
     1329                 (< (the fixnum val) 33))
     1330      (ccl::report-bad-arg form `(integer (0) (33))))
     1331    (set-field-value instruction (byte 7 1) val)))
    13021332
    13031333(defun parse-rm-operand (form instruction)
     
    13261356  (if (atom form)
    13271357    (error "Invalid memory operand ~s." form)
    1328     (let* ((mode (keywordize (car form)))
     1358    (let* ((mode (car form))
    13291359           (constant-index nil))
    13301360      (destructuring-bind (rn index) (cdr form)
     
    13321362        (cond ((atom index)
    13331363               (set-field-value instruction (byte 4 0) (need-arm-gpr index)))
    1334               (t (unless (eq (keywordize (car index)) :$)
     1364              (t (unless (eq (car index) :$)
    13351365                   (error "Invalid index: ~s." index))
    13361366                 (destructuring-bind (val) (cdr index)
     
    13821412    (error "Invalid FP address: ~s" form)
    13831413    (destructuring-bind (op rn offset) form
    1384       (unless (eq (keywordize op) :@)
     1414      (unless (eq op :@)
    13851415        (error "Invalid FP addressing mode ~s in ~s." op form))
    13861416      (set-field-value instruction (byte 4 16) (need-arm-gpr rn))
    1387       (unless (and (consp offset) (eq (keywordize (car offset)) :$))
     1417      (unless (and (consp offset) (eq (car offset) :$))
    13881418        (error "Invalid FP address offset ~s in ~s." offset form))
    13891419      (destructuring-bind (offset-form) (cdr offset)
     
    13981428(defun parse-@rn-operand (form instruction)
    13991429  (when (or (atom form)
    1400           (not (eq (keywordize (car form)) :@)))
     1430          (not (eq (car form) :@)))
    14011431    (error "Invalid register indirect operand: ~s" form))
    14021432  (destructuring-bind (rn) (cdr form)
     
    14301460      parse-fpux-operand
    14311461      parse-imm16-operand
     1462      parse-srcount-operand
     1463      parse-drcount-operand
    14321464      ))
    14331465
     
    14641496          (error "Unknown ARM instruction - ~s" form))
    14651497        (let* ((cond-indicator (and (consp (car opvals))
    1466                                     (keywordize (caar opvals)))))
     1498                                    (caar opvals))))
    14671499          (when (or (eq cond-indicator :?)
    14681500                    (eq cond-indicator :~))
     
    17241756    :uuoC
    17251757    :imm16
     1758    :srcount
     1759    :drcount
    17261760    )))
    17271761
     
    17571791      vinsn-parse-fpux-operand
    17581792      vinsn-parse-imm16-operand
     1793      vinsn-parse-srcount-operand
     1794      vinsn-parse-drcount-operand
    17591795      ))
    17601796
     
    19521988  (let* ((regno (if (typep value '(unsigned-byte 4))
    19531989                  value
    1954                   (ecase (keywordize value)
     1990                  (ecase value
    19551991                    (:fpsid 0)
    19561992                    (:fpscr 1)
     
    20772113      (set-avi-opcode-field avi (byte 4 16) (ldb (byte 4 12) val)))))
    20782114
     2115(defun vinsn-parse-srcount-operand (avi value vinsn-params)
     2116  (let* ((val (vinsn-arg-or-constant avi value vinsn-params (encode-vinsn-field-type :srcount) nil)))
     2117    (when val
     2118      (check-type val (integer 1 32))
     2119      (set-avi-opcode-field avi (byte 8 0) val))))
     2120
     2121(defun vinsn-parse-drcount-operand (avi value vinsn-params)
     2122  (let* ((val (vinsn-arg-or-constant avi value vinsn-params (encode-vinsn-field-type :drcount) nil)))
     2123    (when val
     2124      (check-type val (integer 1 32))
     2125      (set-avi-opcode-field avi (byte 7 1) val))))
    20792126
    20802127(defun vinsn-simplify-instruction (form vinsn-params)
     
    20902137           (error "Unknown ARM instruction - ~s" form))
    20912138         (let* ((cond-indicator (and (consp (car opvals))
    2092                                      (keywordize (caar opvals))))
     2139                                     (caar opvals)))
    20932140                (avi (make-arm-vinsn-instruction (arm-instruction-template-val template))))
    20942141           (when (or (eq cond-indicator :?)
     
    21552202    vinsn-insert-uuoc-operand
    21562203    vinsn-insert-imm16-operand
     2204    vinsn-insert-srcount-operand
     2205    vinsn-insert-drcount-operand
    21572206    ))
    21582207
     
    22692318  (set-field-value instruction (byte 4 16) (ldb (byte 4 12) value)))
    22702319
     2320(defun vinsn-insert-srcount-operand (instruction value)
     2321  (set-field-value instruction (byte 8 0) value))
     2322
     2323(defun vinsn-insert-drcount-operand (instruction value)
     2324  (set-field-value instruction (byte 7 1) value)) 
     2325
    22712326
    22722327
  • release/1.7/source/compiler/ARM/arm-disassemble.lisp

    r14843 r14914  
    287287                           (ldb (byte 1 7) opcode)))))
    288288
     289(defun extract-arm-srcount-operand (opcodes i)
     290  (let* ((opcode (adi-opcode (svref opcodes i))))
     291    (ldb (byte 8 0) opcode)))
     292
     293(defun extract-arm-drcount-operand (opcodes i)
     294  (let* ((opcode (adi-opcode (svref opcodes i))))
     295    (ldb (byte 7 1) opcode)))
    289296
    290297(defparameter *arm-operand-extract-functions*
     
    315322    extract-arm-fpux-operand
    316323    extract-arm-imm16-operand
     324    extract-arm-srcount-operand
     325    extract-arm-drcount-operand
    317326    ))
    318327
  • release/1.7/source/compiler/ARM/arm-lapmacros.lisp

    r14764 r14914  
    2424(defarmlapmacro set-nargs (n)
    2525  (check-type n (unsigned-byte 8))
    26   `(mov nargs ($ (ash ,n arm::fixnumshift))))
     26  `(mov nargs (:$ (ash ,n arm::fixnumshift))))
    2727
    2828(defarmlapmacro check-nargs (min &optional (max min))
     
    4444        (if (= min 0)
    4545          `(progn
    46             (cmp nargs ($ (ash ,max arm::fixnumshift)))
     46            (cmp nargs (:$ (ash ,max arm::fixnumshift)))
    4747            (bls ,ok1)
    4848            (uuo-error-wrong-nargs (:? hi))
    4949            ,ok1)
    5050          `(progn
    51             (cmp nargs ($ (ash ,min arm::fixnumshift)))
     51            (cmp nargs (:$ (ash ,min arm::fixnumshift)))
    5252            (bhs ,ok1)
    5353            (uuo-error-wrong-nargs (:? lo))
    5454            ,ok1
    55             (cmp nargs ($ (ash ,max arm::fixnumshift)))
     55            (cmp nargs (:$ (ash ,max arm::fixnumshift)))
    5656            (bls ,ok2)
    5757            (uuo-error-wrong-nargs (:? hi))
     
    7272(defarmlapmacro build-lisp-frame (&optional (marker-reg 'imm0) (vsp 'vsp))
    7373  `(progn
    74     (mov ,marker-reg ($ arm::lisp-frame-marker))
     74    (mov ,marker-reg (:$ arm::lisp-frame-marker))
    7575    (stmdb (:! sp) (,marker-reg ,vsp fn lr))))
    7676
  • release/1.7/source/compiler/ARM/arm-vinsns.lisp

    r14847 r14914  
    12871287     ((src :lisp))
    12881288     ((imm :s32)))
    1289   (fmrx imm fpscr)
     1289  (fmrx imm :fpscr)
    12901290  (bic imm imm (:$ #xff))
    1291   (fmxr fpscr imm)
     1291  (fmxr :fpscr imm)
    12921292  (mov imm (:asr src (:$ arm::fixnumshift)))
    12931293  (fmsr dest imm)
     
    15211521      (y :double-float))
    15221522     ((imm :u32)))
    1523   (fmrx imm fpscr)
     1523  (fmrx imm :fpscr)
    15241524  (bic imm imm (:$ #xff))
    1525   (fmxr fpscr imm)
     1525  (fmxr :fpscr imm)
    15261526  (faddd result x y)
    15271527  (bla .SPcheck-fpu-exception))
     
    15381538      (y :double-float))
    15391539     ((imm :u32)))
    1540   (fmrx imm fpscr)
     1540  (fmrx imm :fpscr)
    15411541  (bic imm imm (:$ #xff))
    1542   (fmxr fpscr imm)
     1542  (fmxr :fpscr imm)
    15431543  (fsubd result x y)
    15441544  (bla .SPcheck-fpu-exception))
     
    15551555      (y :double-float))
    15561556     ((imm :u32)))
    1557   (fmrx imm fpscr)
     1557  (fmrx imm :fpscr)
    15581558  (bic imm imm (:$ #xff))
    1559   (fmxr fpscr imm)
     1559  (fmxr :fpscr imm)
    15601560  (fmuld result x y)
    15611561  (bla .SPcheck-fpu-exception))
     
    15721572      (y :double-float))
    15731573     ((imm :u32)))
    1574   (fmrx imm fpscr)
     1574  (fmrx imm :fpscr)
    15751575  (bic imm imm (:$ #xff))
    1576   (fmxr fpscr imm)
     1576  (fmxr :fpscr imm)
    15771577  (fdivd result x y)
    15781578  (bla .SPcheck-fpu-exception))
     
    16031603      (y :single-float))
    16041604     ((imm :u32)))
    1605   (fmrx imm fpscr)
     1605  (fmrx imm :fpscr)
    16061606  (bic imm imm (:$ #xff))
    1607   (fmxr fpscr imm)
     1607  (fmxr :fpscr imm)
    16081608  (fadds result x y)
    16091609  (bla .SPcheck-fpu-exception))
     
    16201620      (y :single-float))
    16211621     ((imm :u32)))
    1622   (fmrx imm fpscr)
     1622  (fmrx imm :fpscr)
    16231623  (bic imm imm (:$ #xff))
    1624   (fmxr fpscr imm)
     1624  (fmxr :fpscr imm)
    16251625  (fsubs result x y)
    16261626  (bla .SPcheck-fpu-exception))
     
    16371637      (y :single-float))
    16381638     ((imm :u32)))
    1639   (fmrx imm fpscr)
     1639  (fmrx imm :fpscr)
    16401640  (bic imm imm (:$ #xff))
    1641   (fmxr fpscr imm)
     1641  (fmxr :fpscr imm)
    16421642  (fmuls result x y)
    16431643  (bla .SPcheck-fpu-exception))
     
    16541654      (y :single-float))
    16551655     ((imm :u32)))
    1656   (fmrx imm fpscr)
     1656  (fmrx imm :fpscr)
    16571657  (bic imm imm (:$ #xff))
    1658   (fmxr fpscr imm)
     1658  (fmxr :fpscr imm)
    16591659  (fdivs result x y)
    16601660  (bla .SPcheck-fpu-exception))
     
    24672467     ((arg :double-float))
    24682468     ((imm :u32)))
    2469   (fmrx imm fpscr)
     2469  (fmrx imm :fpscr)
    24702470  (bic imm imm (:$ #xff))
    2471   (fmxr fpscr imm)
     2471  (fmxr :fpscr imm)
    24722472  (fcvtsd result arg)
    24732473  (bla .SPcheck-fpu-exception))
  • release/1.7/source/level-0/ARM/arm-def.lisp

    r14887 r14914  
    113113  @ok2
    114114  (bne @one)
    115   (cmp imm1 ($ 0))
     115  (cmp imm1 (:$ 0))
    116116  (beq @store)
    117117  (uuo-error-reg-not-xtype new-value (:$ arm::xtype-u32))
    118118  @one
    119   (cmp imm2 ($ 0))
     119  (cmp imm2 (:$ 0))
    120120  (bge @store)
    121121  (uuo-error-reg-not-xtype new-value (:$ arm::xtype-u32))
  • release/1.7/source/level-0/ARM/arm-float.lisp

    r14119 r14914  
    270270(defarmlapfunction %ffi-exception-status ()
    271271  (ldr imm1 (:@ rcontext (:$ arm::tcr.lisp-fpscr)))
    272   (fmrx imm2 fpscr)
     272  (fmrx imm2 :fpscr)
    273273  (and imm0 imm2 (:$ #xff))
    274274  (ands imm0 imm0 (:lsr imm1 (:$ 8)))
     
    277277  (mov arg_z (:lsl imm0 (:$ arm::fixnumshift)))
    278278  (bic imm0 imm2 (:$ #xff))
    279   (fmxr fpscr imm0)
     279  (fmxr :fpscr imm0)
    280280  (bx lr))
    281281
     
    517517(defarmlapfunction %double-float-sign ((n arg_z))
    518518  (ldr imm0 (:@ n (:$ arm::double-float.val-high)))
    519   (cmp imm0 ($ 0))
     519  (cmp imm0 (:$ 0))
    520520  (mov arg_z 'nil)
    521521  (addlt arg_z arg_z (:$ arm::t-offset))
     
    524524(defarmlapfunction %short-float-sign ((n arg_z))
    525525  (ldr imm0 (:@ n (:$ arm::single-float.value)))
    526   (cmp imm0 ($ 0))
     526  (cmp imm0 (:$ 0))
    527527  (mov arg_z 'nil)
    528528  (addlt arg_z arg_z (:$ arm::t-offset))
     
    532532  (build-lisp-frame)
    533533  (get-single-float s0 src imm0)
    534   (fmrx imm0 fpscr)
     534  (fmrx imm0 :fpscr)
    535535  (bic imm0 imm0 (:$ #xff))
    536   (fmxr fpscr imm0)
     536  (fmxr :fpscr imm0)
    537537  (fsqrts s1 s0)
    538538  (bla .SPcheck-fpu-exception)
     
    545545  (build-lisp-frame)
    546546  (get-double-float d0 src)
    547   (fmrx imm0 fpscr)
     547  (fmrx imm0 :fpscr)
    548548  (bic imm0 imm0 (:$ #xff))
    549   (fmxr fpscr imm0)
     549  (fmxr :fpscr imm0)
    550550  (fsqrtd d1 d0)
    551551  (bla .SPcheck-fpu-exception)
  • release/1.7/source/level-0/ARM/arm-io.lisp

    r14119 r14914  
    2222
    2323(defarmlapfunction %get-errno ()
    24   (mov temp0 ($ 0))
     24  (mov temp0 (:$ 0))
    2525  (ldr imm1 (:@ rcontext (:$ arm::tcr.errno-loc)))
    2626  (ldr imm0 (:@ imm1 (:$ 0)))
  • release/1.7/source/level-0/ARM/arm-misc.lisp

    r14708 r14914  
    330330  (ldrne  imm0 (:@ temp0 (:$ arm::area.active)))
    331331  (cmp imm1 imm0)
    332   (mov imm0 ($ 0))
     332  (mov imm0 (:$ 0))
    333333  (push1 imm0 imm1)
    334334  (streq imm1 (:@ temp0 (:$ arm::area.active)))
     
    395395  (add imm1 imm0 (:$ (arm::kernel-global gc-inhibit-count)))
    396396  @again
    397   (mov arg_x ($ 0))
     397  (mov arg_x (:$ 0))
    398398  (ldrex arg_y (:@ imm1))
    399399  (cmp arg_y '-1)
     
    402402  (addle arg_z arg_y '1)
    403403  (strex imm0 arg_z (:@ imm1))
    404   (cmp imm0 ($ 0))
     404  (cmp imm0 (:$ 0))
    405405  (bne @again)
    406406  (cmp arg_x '0)
  • release/1.7/source/level-0/ARM/arm-pred.lisp

    r14119 r14914  
    6161  @win
    6262  (mov arg_z 'nil)
    63   (add arg_z arg_z ($ arm::t-offset))
     63  (add arg_z arg_z (:$ arm::t-offset))
    6464  (bx lr)
    6565  @macptr
Note: See TracChangeset for help on using the changeset viewer.