Avoid inferring REX prefixes in i64 mode; fixes #1421

This commit is contained in:
Andrew Brown
2020-03-31 15:48:27 -07:00
parent 3481e59673
commit 9336884db5

View File

@@ -313,10 +313,10 @@ impl PerCpuModeEncodings {
} }
/// Add two encodings for `inst`: /// Add two encodings for `inst`:
/// - X86_32, dynamically infer the REX prefix. /// - X86_32, no REX prefix, since this is not valid in 32-bit mode.
/// - X86_64, dynamically infer the REX prefix. /// - X86_64, dynamically infer the REX prefix.
fn enc_both_inferred(&mut self, inst: impl Clone + Into<InstSpec>, template: Template) { fn enc_both_inferred(&mut self, inst: impl Clone + Into<InstSpec>, template: Template) {
self.enc32(inst.clone(), template.infer_rex()); self.enc32(inst.clone(), template.clone());
self.enc64(inst, template.infer_rex()); self.enc64(inst, template.infer_rex());
} }
fn enc_both_inferred_maybe_isap( fn enc_both_inferred_maybe_isap(
@@ -325,7 +325,7 @@ impl PerCpuModeEncodings {
template: Template, template: Template,
isap: Option<SettingPredicateNumber>, isap: Option<SettingPredicateNumber>,
) { ) {
self.enc32_maybe_isap(inst.clone(), template.infer_rex(), isap); self.enc32_maybe_isap(inst.clone(), template.clone(), isap);
self.enc64_maybe_isap(inst, template.infer_rex(), isap); self.enc64_maybe_isap(inst, template.infer_rex(), isap);
} }