more rex stuff

This commit is contained in:
2026-06-12 22:57:01 -04:00
parent fa2a6db2e2
commit 550d58d6f4
2 changed files with 1 additions and 5 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ impl Code {
} }
self.prefix32(&dst)?; self.prefix32(&dst)?;
self.prefix16(encode_width); self.prefix16(encode_width);
if dst.reg.requires_mem_rex() || dst.width == Width::B64 { if dst.reg.gt8() || dst.width == Width::B64 {
self.bytes.push(rex(dst, 0, 0, dst)); self.bytes.push(rex(dst, 0, 0, dst));
} }
self.bytes.push(0xc6 | encode_width.not8()); self.bytes.push(0xc6 | encode_width.not8());
-4
View File
@@ -72,10 +72,6 @@ impl Reg {
|| (self.gt4() && self.width == Width::B8 && !self.high) || (self.gt4() && self.width == Width::B8 && !self.high)
} }
pub fn requires_mem_rex(&self) -> bool {
self.gt8() || (self.gt4() && self.width == Width::B8 && !self.high)
}
pub fn incompatible(&self, other: &Reg) -> bool { pub fn incompatible(&self, other: &Reg) -> bool {
(self.requires_rex() && other.high) || (self.high && other.requires_rex()) (self.requires_rex() && other.high) || (self.high && other.requires_rex())
} }