mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
fix the encodings of monitor and mwait, which were completely
busted in both encoders. I'm not bothering to fix it in the old one at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6ae7bbb5ea
commit
c4d3f662fc
@ -542,14 +542,9 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
|
|||||||
// FIXME: This is terrible, they should get proper encoding bits in TSFlags.
|
// FIXME: This is terrible, they should get proper encoding bits in TSFlags.
|
||||||
if (Opcode == X86::LFENCE || Opcode == X86::MFENCE ||
|
if (Opcode == X86::LFENCE || Opcode == X86::MFENCE ||
|
||||||
Opcode == X86::MONITOR || Opcode == X86::MWAIT) {
|
Opcode == X86::MONITOR || Opcode == X86::MWAIT) {
|
||||||
EmitByte(ModRMByte(3, (TSFlags & X86II::FormMask)-X86II::MRM0r, 0),
|
EmitByte(ModRMByte(3, (TSFlags & X86II::FormMask)-X86II::MRM0r,
|
||||||
|
Opcode == X86::MWAIT),
|
||||||
CurByte, OS);
|
CurByte, OS);
|
||||||
|
|
||||||
switch (Opcode) {
|
|
||||||
default: break;
|
|
||||||
case X86::MONITOR: EmitByte(0xC8, CurByte, OS); break;
|
|
||||||
case X86::MWAIT: EmitByte(0xC9, CurByte, OS); break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
EmitRegModRMByte(MI.getOperand(CurOp++),
|
EmitRegModRMByte(MI.getOperand(CurOp++),
|
||||||
(TSFlags & X86II::FormMask)-X86II::MRM0r,
|
(TSFlags & X86II::FormMask)-X86II::MRM0r,
|
||||||
|
14
test/MC/AsmParser/X86/x86_32-new-encoder.s
Normal file
14
test/MC/AsmParser/X86/x86_32-new-encoder.s
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding --enable-new-x86-encoder %s | FileCheck %s
|
||||||
|
|
||||||
|
lfence
|
||||||
|
// CHECK: lfence
|
||||||
|
// CHECK: encoding: [0x0f,0xae,0xe8]
|
||||||
|
mfence
|
||||||
|
// CHECK: mfence
|
||||||
|
// CHECK: encoding: [0x0f,0xae,0xf0]
|
||||||
|
monitor
|
||||||
|
// CHECK: monitor
|
||||||
|
// CHECK: encoding: [0x0f,0x01,0xc8]
|
||||||
|
mwait
|
||||||
|
// CHECK: mwait
|
||||||
|
// CHECK: encoding: [0x0f,0x01,0xc9]
|
Loading…
x
Reference in New Issue
Block a user