Home | History | Annotate | Download | only in X86
      1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
      2 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=+waitpkg | FileCheck %s --check-prefix=X64
      3 ; RUN: llc < %s -mtriple=i386-pc-linux -mattr=+waitpkg | FileCheck %s --check-prefix=X32
      4 
      5 define void @test_umonitor(i8* %address) {
      6 ; X64-LABEL: test_umonitor:
      7 ; X64:       # %bb.0: # %entry
      8 ; X64-NEXT:    umonitor %rdi
      9 ; X64-NEXT:    retq
     10 ;
     11 ; X32-LABEL: test_umonitor:
     12 ; X32:       # %bb.0: # %entry
     13 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
     14 ; X32-NEXT:    umonitor %eax
     15 ; X32-NEXT:    retl
     16 entry:
     17   call void @llvm.x86.umonitor(i8* %address)
     18   ret void
     19 }
     20 
     21 define i8 @test_umwait(i32 %control, i32 %counter_high, i32 %counter_low) {
     22 ; X64-LABEL: test_umwait:
     23 ; X64:       # %bb.0: # %entry
     24 ; X64-NEXT:    movl %edx, %eax
     25 ; X64-NEXT:    movl %esi, %edx
     26 ; X64-NEXT:    umwait %edi
     27 ; X64-NEXT:    setb %al
     28 ; X64-NEXT:    retq
     29 ;
     30 ; X32-LABEL: test_umwait:
     31 ; X32:       # %bb.0: # %entry
     32 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %edx
     33 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
     34 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
     35 ; X32-NEXT:    umwait %ecx
     36 ; X32-NEXT:    setb %al
     37 ; X32-NEXT:    retl
     38 entry:
     39   call i8 @llvm.x86.umwait(i32 %control, i32 %counter_high, i32 %counter_low)
     40   ret i8 %0
     41 }
     42 
     43 define i8 @test_tpause(i32 %control, i32 %counter_high, i32 %counter_low) {
     44 ; X64-LABEL: test_tpause:
     45 ; X64:       # %bb.0: # %entry
     46 ; X64-NEXT:    movl %edx, %eax
     47 ; X64-NEXT:    movl %esi, %edx
     48 ; X64-NEXT:    tpause %edi
     49 ; X64-NEXT:    setb %al
     50 ; X64-NEXT:    retq
     51 ;
     52 ; X32-LABEL: test_tpause:
     53 ; X32:       # %bb.0: # %entry
     54 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %edx
     55 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
     56 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
     57 ; X32-NEXT:    tpause %ecx
     58 ; X32-NEXT:    setb %al
     59 ; X32-NEXT:    retl
     60 entry:
     61   call i8 @llvm.x86.tpause(i32 %control, i32 %counter_high, i32 %counter_low)
     62   ret i8 %0
     63 }
     64 
     65 declare void @llvm.x86.umonitor(i8*)
     66 declare i8 @llvm.x86.umwait(i32, i32, i32)
     67 declare i8 @llvm.x86.tpause(i32, i32, i32)
     68