Skip to content

Commit

Permalink
[X86ISA] Fix bug in CMOVcc.
Browse files Browse the repository at this point in the history
This was reported in GitHub Issue #1528.
  • Loading branch information
acoglio committed May 14, 2024
1 parent 9520a8b commit c4fa69a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion books/projects/x86isa/machine/instructions/conditional.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,18 @@
reg/mem
rex-byte
x86)
x86))
;; The pseudocode in the Intel manual says that
;; the high 32 bits are zeroed
;; when in 64-bit mode the operand size is 32,
;; even when the condition is false.
(if (and (equal operand-size 4) ; 32 bits
(equal proc-mode #.*64-bit-mode*))
(!rgfi-size operand-size
(reg-index reg rex-byte #.*r*)
(loghead 32 (rgfi-size operand-size reg rex-byte x86))
rex-byte
x86)
x86)))
(x86 (write-*ip proc-mode temp-rip x86)))
x86))

Expand Down

0 comments on commit c4fa69a

Please sign in to comment.