[llvm-commits] [llvm] r95947 - in /llvm/trunk: lib/Target/X86/X86MCCodeEmitter.cpp test/MC/AsmParser/X86/x86_32-new-encoder.s
Chris Lattner
sabre at nondot.org
Thu Feb 11 17:06:22 PST 2010
Author: lattner
Date: Thu Feb 11 19:06:22 2010
New Revision: 95947
URL: http://llvm.org/viewvc/llvm-project?rev=95947&view=rev
Log:
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.
Added:
llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s
Modified:
llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=95947&r1=95946&r2=95947&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Thu Feb 11 19:06:22 2010
@@ -542,14 +542,9 @@
// FIXME: This is terrible, they should get proper encoding bits in TSFlags.
if (Opcode == X86::LFENCE || Opcode == X86::MFENCE ||
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);
-
- switch (Opcode) {
- default: break;
- case X86::MONITOR: EmitByte(0xC8, CurByte, OS); break;
- case X86::MWAIT: EmitByte(0xC9, CurByte, OS); break;
- }
} else {
EmitRegModRMByte(MI.getOperand(CurOp++),
(TSFlags & X86II::FormMask)-X86II::MRM0r,
Added: llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s?rev=95947&view=auto
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s (added)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s Thu Feb 11 19:06:22 2010
@@ -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]
\ No newline at end of file
More information about the llvm-commits
mailing list