Remove now unused and useless functions from compiler backend
This commit is contained in:
parent
92f2b02675
commit
4a52ff534f
1 changed files with 0 additions and 32 deletions
|
@ -126,21 +126,6 @@ is the responsibility of the pre-assembly compilation step."
|
|||
(emit-sta (data-reference data))))
|
||||
(setf *last-instruction* (list :store data)))))
|
||||
|
||||
(defun emit-store-bool (data)
|
||||
"Stores the inverse of the zeroflag to DATA. Inverse so that non-0 is TRUE."
|
||||
;; The "DATA is stored"-case
|
||||
(if (or (member (strategy (allocation-details data))
|
||||
'(:constant :branch :not-saved)))
|
||||
(setf *last-instruction* :useless)
|
||||
(progn
|
||||
(emit-asm-instruction :opcode :php :byte-length 1)
|
||||
(emit-asm-instruction :opcode :pla :byte-length 1)
|
||||
(emit-asm-instruction :opcode :and :operand #b00000010 :byte-length 2)
|
||||
(emit-asm-instruction :opcode :lsr-a :byte-length 1)
|
||||
(emit-asm-instruction :opcode :not :operand #b00000001 :byte-length 2)
|
||||
(emit-sta :address (data-reference data))
|
||||
(setf *last-instruction* (list :store-zero-flag data)))))
|
||||
|
||||
(defun emit-load-data (data)
|
||||
(cond ((eql (strategy (allocation-details data)) :not-saved)
|
||||
(error "Tried to load unallocated data ~A." data))
|
||||
|
@ -159,23 +144,6 @@ is the responsibility of the pre-assembly compilation step."
|
|||
(emit-lda (data-reference data))
|
||||
(setf *last-instruction* (list :load data)))))
|
||||
|
||||
(defun emit-load-bool (data)
|
||||
(if (or (eql (strategy (allocation-details data)) :flags)
|
||||
(equal *last-instruction* (list :store-zero-flag data))
|
||||
(equal *last-instruction* (list :load-zero-flag data)))
|
||||
(setf *last-instruction* :useless)
|
||||
(progn
|
||||
(if (eql (strategy (allocation-details data)) :constant)
|
||||
(progn
|
||||
(emit-lda :immediate (ir-constant-value data))
|
||||
(emit-asm-instruction :opcode :and :operand 1 :byte-length 1)
|
||||
(emit-cmp :immediate 1))
|
||||
(progn
|
||||
(emit-lda :address (data-reference data))
|
||||
(emit-asm-instruction :opcode :and :operand 1 :byte-length 1)
|
||||
(emit-cmp :immediate 1)))
|
||||
(setf *last-instruction* (list :load-zero-flag data)))))
|
||||
|
||||
(defmethod compile-ir ((inst ir-inst))
|
||||
(warn "Skipped compiling ~A; no COMPILE-IR method" inst))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue