Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
the semantics of the stm thumb2 instruction
(declare (context (target arm)))
(in-package thumb)
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8 r9 r10))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8 r9)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8 r9))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7 r8)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7 r8))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6 r7)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6 r7))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5 r6)
(stmdb_upd dst base r1 r2 r3 r4 r5 r6))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4 r5)
(stmdb_upd dst base r1 r2 r3 r4 r5))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3 r4)
(stmdb_upd dst base r1 r2 r3 r4))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2 r3)
(stmdb_upd dst base r1 r2 r3))
(defun t2STMDB_UPD (dst base _pred _?
r1 r2)
(stmdb_upd dst base r1 r2))
(defun t2STMDB_UPD (dst base _pred _?
r1)
(stmdb_upd dst base r1))
(defmacro stmdb_upd (dst base regs)
(let ((len (length regs))
(stride (sizeof word-width))
(ptr (- base (* len stride))))
(store-registers ptr stride 0 regs)
(set$ dst ptr)))
(defmacro store-registers (base stride off reg)
(store-word (+ base (* stride off)) reg))
(defmacro store-registers (base stride off reg regs)
(prog
(store-registers base stride off reg)
(store-registers base stride (+ off 1) regs)))
(defmacro length (r) 1)
(defmacro length (_ rs) (+ 1 (length rs)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment