Recognize monitor/mwait with explicit register arguments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Joerg Sonnenberger 2011-02-18 00:48:11 +00:00
parent c788f44642
commit 5ad596f9d2
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: