Changeset 14107 for branches


Ignore:
Timestamp:
Aug 1, 2010, 10:00:29 PM (9 years ago)
Author:
gb
Message:

More subprim changes.

Location:
branches/arm/compiler/ARM
Files:
2 edited

Legend:

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

    r14095 r14107  
    12741274  (lap-note-label-reference form instruction :b))
    12751275
    1276 (defun parse-subprim-operand (form instruction)
    1277   (let* ((address (or (arm-subprimitive-address form)
    1278                       (when (arm-subprimitive-name form) form))))
    1279     (unless address
    1280       (error "Unknown ARM subprimitive : ~s" form))
    1281     (set-field-value instruction (byte 12 0) (encode-arm-immediate address))))
     1276
    12821277   
    12831278(defun parse-m8-operand (form instruction)
     
    13731368      parse-rm-operand
    13741369      parse-b-operand
    1375       parse-subprim-operand
     1370      obsolete
    13761371      parse-m8-operand
    13771372      parse-dd-operand
     
    17211716      vinsn-parse-rm-operand
    17221717      vinsn-parse-b-operand
    1723       vinsn-parse-subprim-operand
     1718      obsolete
    17241719      vinsn-parse-m8-operand
    17251720      vinsn-parse-dd-operand
     
    19551950           (error "Unknown branch target: ~s." value)))))
    19561951
    1957 ;;; This can only appear in a BA (mov PC,(:$ addr)) instruction, which
    1958 ;;; already has bit 25 set.
    1959 (defun vinsn-parse-subprim-operand (avi value vinsn-params)
    1960   (let* ((p (position value vinsn-params)))
    1961     (if p
    1962       (add-avi-operand avi (encode-vinsn-field-type :subprim) (list p))
    1963       (let* ((addr (or (arm-subprimitive-address value)
    1964                    (and (typep value 'integer)
    1965                         (>= value #x4000)
    1966                         (< value #x10000)
    1967                         (not (logtest #x7f value))))))
    1968         (unless addr
    1969           (error "Unknown ARM subprimitive address: ~s." value))
    1970         (set-avi-opcode-field avi (byte 12 0) (encode-arm-immediate addr))))))
     1952
    19711953
    19721954(defun vinsn-parse-m8-operand (avi value vinsn-params)
     
    21312113    vinsn-insert-uuoB-operand
    21322114    vinsn-insert-label-operand
    2133     vinsn-insert-subprim-operand
     2115    obsolete
    21342116    vinsn-insert-data-label-operand
    21352117    vinsn-insert-dd-operand
     
    22092191    (push (cons instruction :b) (lap-label-refs label))))
    22102192
    2211 (defun vinsn-insert-subprim-operand (instruction value)
    2212   (insert-shifter-constant value instruction))
     2193
    22132194
    22142195(defun vinsn-insert-data-label-operand (instruction value)
  • branches/arm/compiler/ARM/arm-disassemble.lisp

    r14034 r14107  
    8585  (let* ((opcode (adi-opcode (svref opcodes i))))
    8686    (if (logbitp 25 opcode)
    87       (let* ((count (ash (ldb (byte 4 8) opcode) 1)))
    88         `(:$ ,(arm::arm-rotate-left (ldb (byte 8 0) opcode) (logand 31 (- 32 count)))))
     87      (let* ((count (ash (ldb (byte 4 8) opcode) 1))
     88             (mov-p (eql (ldb (byte 4 21) opcode) arm::opcode-mov))
     89             (value (arm::arm-rotate-left (ldb (byte 8 0) opcode) (logand 31 (- 32 count))))
     90             (spname (and mov-p (arm::arm-subprimitive-name value))))
     91        (if spname
     92          (progn
     93            (setf (adi-mnemonic (svref opcodes i)) "load-subprim")
     94            `(:spname ,spname))
     95          `(:$ ,value)))
    8996      (let* ((rn (arm-gpr-name (ldb (byte 4 0) opcode)))
    9097             (register-shifted (logbitp 4 opcode)))
     
    217224      `(:label ,target))))
    218225
    219 (defun extract-arm-subprim-operand (opcodes i)
    220   (let* ((opcode (adi-opcode (svref opcodes i)))
    221          (count (ash (ldb (byte 4 8) opcode) 1))
    222          (spaddr (arm::arm-rotate-left (ldb (byte 8 0) opcode) (logand 31 (- 32 count))))
    223          (name (arm::arm-subprimitive-name spaddr)))
    224     (if name
    225       `(:spname ,name)
    226       `(:$ ,spaddr))))
     226
    227227
    228228(defun extract-arm-m8-operand (opcodes i)
     
    292292    extract-arm-rm-operand
    293293    extract-arm-b-operand
    294     extract-arm-subprim-operand
     294    obsolete
    295295    extract-arm-m8-operand
    296296    extract-arm-dd-operand
     
    372372                           (if (< i 3)
    373373                             ch
    374                              (char-downcase ch))))))))
    375       (do* ((j (1- (length adi-vector)) (1- j)))
    376            ((< j 0))
    377         (let* ((info (svref adi-vector j))
    378                (name (adi-mnemonic info)))
    379           (when name
    380             (unless (equal name ":word")
    381               (unless (equal name "ba")
    382                 (return))
    383               (unless (eq (adi-labeled info) t)
    384                 (return))
    385               (setf (adi-labeled info)
    386                     (concatenate 'string "L"
    387                                  (with-output-to-string (s)
    388                                                         (format-spname (cadr (car (adi-operands info))) s))))))))
     374                             (char-downcase ch))))))))     
    389375      (when functionp
    390376        (let ((source-note (function-source-note xfunction)))
Note: See TracChangeset for help on using the changeset viewer.