1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=+mwaitx | FileCheck %s
3 ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+mwaitx | FileCheck %s -check-prefix=WIN64
4 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=bdver4 | FileCheck %s
5 ; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=bdver4 | FileCheck %s -check-prefix=WIN64
7 define void @foo(i8* %P, i32 %E, i32 %H) nounwind {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: movl %esi, %ecx
11 ; CHECK-NEXT: movq %rdi, %rax
12 ; CHECK-NEXT: monitorx
16 ; WIN64: # %bb.0: # %entry
17 ; WIN64-NEXT: movq %rcx, %rax
18 ; WIN64-NEXT: movl %edx, %ecx
19 ; WIN64-NEXT: movl %r8d, %edx
20 ; WIN64-NEXT: monitorx
23 tail call void @llvm.x86.monitorx(i8* %P, i32 %E, i32 %H)
27 declare void @llvm.x86.monitorx(i8*, i32, i32) nounwind
29 define void @bar(i32 %E, i32 %H, i32 %C) nounwind {
31 ; CHECK: # %bb.0: # %entry
32 ; CHECK-NEXT: pushq %rbx
33 ; CHECK-NEXT: movl %edx, %ebx
34 ; CHECK-NEXT: movl %esi, %eax
35 ; CHECK-NEXT: movl %edi, %ecx
37 ; CHECK-NEXT: popq %rbx
41 ; WIN64: # %bb.0: # %entry
42 ; WIN64-NEXT: pushq %rbx
43 ; WIN64-NEXT: movl %r8d, %ebx
44 ; WIN64-NEXT: movl %edx, %eax
46 ; WIN64-NEXT: popq %rbx
49 tail call void @llvm.x86.mwaitx(i32 %E, i32 %H, i32 %C)
53 declare void @llvm.x86.mwaitx(i32, i32, i32) nounwind