1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Recognize monitor/mwait with explicit register arguments

llvm-svn: 125805
This commit is contained in:
Joerg Sonnenberger 2011-02-18 00:48:11 +00:00
parent 7f4a6afc42
commit efa8090e2a
3 changed files with 26 additions and 0 deletions

View File

@ -3673,6 +3673,14 @@ let Uses = [ECX, EAX] in
def MWAITrr : I<0x01, MRM_C9, (outs), (ins), "mwait", []>, TB,
Requires<[HasSSE3]>;
def : InstAlias<"mwait %eax, %ecx", (MWAITrr)>, Requires<[In32BitMode]>;
def : InstAlias<"mwait %rax, %rcx", (MWAITrr)>, Requires<[In64BitMode]>;
def : InstAlias<"monitor %eax, %ecx, %edx", (MONITORrrr)>,
Requires<[In32BitMode]>;
def : InstAlias<"monitor %rax, %rcx, %rdx", (MONITORrrr)>,
Requires<[In64BitMode]>;
//===---------------------------------------------------------------------===//
// Non-Instruction Patterns
//===---------------------------------------------------------------------===//

View File

@ -14,9 +14,15 @@
// CHECK: encoding: [0x0f,0xae,0xf0]
monitor
// CHECK: monitor
// CHECK: encoding: [0x0f,0x01,0xc8]
monitor %eax, %ecx, %edx
// CHECK: monitor
// CHECK: encoding: [0x0f,0x01,0xc8]
mwait
// CHECK: mwait
// CHECK: encoding: [0x0f,0x01,0xc9]
mwait %eax, %ecx
// CHECK: mwait
// CHECK: encoding: [0x0f,0x01,0xc9]
vmcall

View File

@ -2,6 +2,18 @@
// RUN: FileCheck < %t %s
// RUN: FileCheck --check-prefix=CHECK-STDERR < %t.err %s
monitor
// CHECK: monitor
// CHECK: encoding: [0x0f,0x01,0xc8]
monitor %rax, %rcx, %rdx
// CHECK: monitor
// CHECK: encoding: [0x0f,0x01,0xc8]
mwait
// CHECK: mwait
// CHECK: encoding: [0x0f,0x01,0xc9]
mwait %rax, %rcx
// CHECK: mwait
// CHECK: encoding: [0x0f,0x01,0xc9]
// Suffix inference: