Skip to content

Commit

Permalink
use :x (r16) register when comparing 16 bit values to ignore potent…
Browse files Browse the repository at this point in the history
…ial garbage in the register
  • Loading branch information
brxken128 committed Aug 18, 2023
1 parent aeb64bf commit e53d8f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmov/src/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl CmovEq for u16 {
#[inline]
fn cmoveq(&self, rhs: &Self, input: Condition, output: &mut Condition) {
cmov_eq!(
"xor {0:e}, {1:e}",
"xor {0:x}, {1:x}",
"cmovz {2:e}, {3:e}",
self,
rhs,
Expand All @@ -71,7 +71,7 @@ impl CmovEq for u16 {
#[inline]
fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) {
cmov_eq!(
"xor {0:e}, {1:e}",
"xor {0:x}, {1:x}",
"cmovnz {2:e}, {3:e}",
self,
rhs,
Expand Down

0 comments on commit e53d8f0

Please sign in to comment.