File: waitpkg-intrinsics.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-20
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,496,436 kB
  • sloc: cpp: 5,593,990; ansic: 986,873; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,547; xml: 953; cs: 573; fortran: 567
file content (67 lines) | stat: -rw-r--r-- 1,999 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-linux -mattr=+waitpkg | FileCheck %s --check-prefix=X64
; RUN: llc < %s -mtriple=i386-pc-linux -mattr=+waitpkg | FileCheck %s --check-prefix=X32

define void @test_umonitor(i8* %address) {
; X64-LABEL: test_umonitor:
; X64:       # %bb.0: # %entry
; X64-NEXT:    umonitor %rdi
; X64-NEXT:    retq
;
; X32-LABEL: test_umonitor:
; X32:       # %bb.0: # %entry
; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X32-NEXT:    umonitor %eax
; X32-NEXT:    retl
entry:
  call void @llvm.x86.umonitor(i8* %address)
  ret void
}

define i8 @test_umwait(i32 %control, i32 %counter_high, i32 %counter_low) {
; X64-LABEL: test_umwait:
; X64:       # %bb.0: # %entry
; X64-NEXT:    movl %edx, %eax
; X64-NEXT:    movl %esi, %edx
; X64-NEXT:    umwait %edi
; X64-NEXT:    setb %al
; X64-NEXT:    retq
;
; X32-LABEL: test_umwait:
; X32:       # %bb.0: # %entry
; X32-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X32-NEXT:    umwait %ecx
; X32-NEXT:    setb %al
; X32-NEXT:    retl
entry:
  call i8 @llvm.x86.umwait(i32 %control, i32 %counter_high, i32 %counter_low)
  ret i8 %0
}

define i8 @test_tpause(i32 %control, i32 %counter_high, i32 %counter_low) {
; X64-LABEL: test_tpause:
; X64:       # %bb.0: # %entry
; X64-NEXT:    movl %edx, %eax
; X64-NEXT:    movl %esi, %edx
; X64-NEXT:    tpause %edi
; X64-NEXT:    setb %al
; X64-NEXT:    retq
;
; X32-LABEL: test_tpause:
; X32:       # %bb.0: # %entry
; X32-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X32-NEXT:    tpause %ecx
; X32-NEXT:    setb %al
; X32-NEXT:    retl
entry:
  call i8 @llvm.x86.tpause(i32 %control, i32 %counter_high, i32 %counter_low)
  ret i8 %0
}

declare void @llvm.x86.umonitor(i8*)
declare i8 @llvm.x86.umwait(i32, i32, i32)
declare i8 @llvm.x86.tpause(i32, i32, i32)