Skip to content

Commit 48235c0

Browse files
authored
Fixes a few bugs in the Thumb semantics (#1582)
* Fix use of `set-nzcv-from-registers` in Thumb `cmp` * Fix docstring * Fix `t2ADDrs`
1 parent e2ad80c commit 48235c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/arm/semantics/thumb.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
(in-package thumb)
1313

1414
(defun tCMPhir (rn rm cnd _)
15-
"cmp rn, rn"
15+
"cmp rn, rm"
1616
(when (condition-holds cnd)
1717
(let ((r (- rn rm)))
18-
(set-nzcv-from-registers r rn rm))))
18+
(set-nzcv-from-registers r rn (- rm)))))
1919

2020
(defun tADR (rd lbl cnd _)
2121
"adr rd, lbl"
@@ -98,7 +98,7 @@
9898
(defun t2ADDrs (rd rn rm simm cnd _ _)
9999
"add.w rd, rn, rm, simm"
100100
(when (condition-holds cnd)
101-
(set$ rd (+ rn (i-shift rn simm)))))
101+
(set$ rd (+ rn (i-shift rm simm)))))
102102

103103
(defun tSBC (rd _ rn rm cnd _)
104104
(add-with-carry/it-block rd rn (lnot rm) CF cnd))

0 commit comments

Comments
 (0)