1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+lwp | FileCheck %s --check-prefixes=X86,X86_LWP
3 ; RUN: llc < %s -mtriple=i686-unknown -mcpu=bdver1 | FileCheck %s --check-prefixes=X86,X86_BDVER
4 ; RUN: llc < %s -mtriple=i686-unknown -mcpu=bdver2 | FileCheck %s --check-prefixes=X86,X86_BDVER
5 ; RUN: llc < %s -mtriple=i686-unknown -mcpu=bdver3 | FileCheck %s --check-prefixes=X86,X86_BDVER
6 ; RUN: llc < %s -mtriple=i686-unknown -mcpu=bdver4 | FileCheck %s --check-prefixes=X86,X86_BDVER
7 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+lwp | FileCheck %s --check-prefix=X64
8 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=bdver1 | FileCheck %s --check-prefix=X64
9 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=bdver2 | FileCheck %s --check-prefix=X64
10 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=bdver3 | FileCheck %s --check-prefix=X64
11 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=bdver4 | FileCheck %s --check-prefix=X64
13 define void @test_llwpcb(ptr%a0) nounwind {
14 ; X86-LABEL: test_llwpcb:
16 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
17 ; X86-NEXT: llwpcb %eax
20 ; X64-LABEL: test_llwpcb:
22 ; X64-NEXT: llwpcb %rdi
24 tail call void @llvm.x86.llwpcb(ptr%a0)
28 define ptr @test_slwpcb(ptr%a0) nounwind {
29 ; X86-LABEL: test_slwpcb:
31 ; X86-NEXT: slwpcb %eax
34 ; X64-LABEL: test_slwpcb:
36 ; X64-NEXT: slwpcb %rax
38 %1 = tail call ptr @llvm.x86.slwpcb()
42 define i8 @test_lwpins32_rri(i32 %a0, i32 %a1) nounwind {
43 ; X86_LWP-LABEL: test_lwpins32_rri:
45 ; X86_LWP-NEXT: movl {{[0-9]+}}(%esp), %eax
46 ; X86_LWP-NEXT: movl {{[0-9]+}}(%esp), %ecx
47 ; X86_LWP-NEXT: addl %ecx, %ecx
48 ; X86_LWP-NEXT: lwpins $-1985229329, %ecx, %eax # imm = 0x89ABCDEF
49 ; X86_LWP-NEXT: setb %al
52 ; X86_BDVER-LABEL: test_lwpins32_rri:
54 ; X86_BDVER-NEXT: movl {{[0-9]+}}(%esp), %ecx
55 ; X86_BDVER-NEXT: movl {{[0-9]+}}(%esp), %eax
56 ; X86_BDVER-NEXT: addl %ecx, %ecx
57 ; X86_BDVER-NEXT: lwpins $-1985229329, %ecx, %eax # imm = 0x89ABCDEF
58 ; X86_BDVER-NEXT: setb %al
59 ; X86_BDVER-NEXT: retl
61 ; X64-LABEL: test_lwpins32_rri:
63 ; X64-NEXT: addl %esi, %esi
64 ; X64-NEXT: lwpins $-1985229329, %esi, %edi # imm = 0x89ABCDEF
68 %2 = tail call i8 @llvm.x86.lwpins32(i32 %a0, i32 %1, i32 2309737967)
72 define i8 @test_lwpins32_rmi(i32 %a0, ptr%p1) nounwind {
73 ; X86-LABEL: test_lwpins32_rmi:
75 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
76 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
77 ; X86-NEXT: lwpins $1985229328, (%eax), %ecx # imm = 0x76543210
81 ; X64-LABEL: test_lwpins32_rmi:
83 ; X64-NEXT: lwpins $1985229328, (%rsi), %edi # imm = 0x76543210
86 %a1 = load i32, ptr%p1
87 %1 = tail call i8 @llvm.x86.lwpins32(i32 %a0, i32 %a1, i32 1985229328)
91 define void @test_lwpval32_rri(i32 %a0, i32 %a1) nounwind {
92 ; X86_LWP-LABEL: test_lwpval32_rri:
94 ; X86_LWP-NEXT: movl {{[0-9]+}}(%esp), %eax
95 ; X86_LWP-NEXT: movl {{[0-9]+}}(%esp), %ecx
96 ; X86_LWP-NEXT: addl %ecx, %ecx
97 ; X86_LWP-NEXT: lwpval $-19088744, %ecx, %eax # imm = 0xFEDCBA98
100 ; X86_BDVER-LABEL: test_lwpval32_rri:
101 ; X86_BDVER: # %bb.0:
102 ; X86_BDVER-NEXT: movl {{[0-9]+}}(%esp), %ecx
103 ; X86_BDVER-NEXT: movl {{[0-9]+}}(%esp), %eax
104 ; X86_BDVER-NEXT: addl %ecx, %ecx
105 ; X86_BDVER-NEXT: lwpval $-19088744, %ecx, %eax # imm = 0xFEDCBA98
106 ; X86_BDVER-NEXT: retl
108 ; X64-LABEL: test_lwpval32_rri:
110 ; X64-NEXT: addl %esi, %esi
111 ; X64-NEXT: lwpval $-19088744, %esi, %edi # imm = 0xFEDCBA98
113 %1 = add i32 %a1, %a1
114 tail call void @llvm.x86.lwpval32(i32 %a0, i32 %1, i32 4275878552)
118 define void @test_lwpval32_rmi(i32 %a0, ptr%p1) nounwind {
119 ; X86-LABEL: test_lwpval32_rmi:
121 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
122 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
123 ; X86-NEXT: lwpval $305419896, (%eax), %ecx # imm = 0x12345678
126 ; X64-LABEL: test_lwpval32_rmi:
128 ; X64-NEXT: lwpval $305419896, (%rsi), %edi # imm = 0x12345678
130 %a1 = load i32, ptr%p1
131 tail call void @llvm.x86.lwpval32(i32 %a0, i32 %a1, i32 305419896)
135 declare void @llvm.x86.llwpcb(ptr) nounwind
136 declare ptr @llvm.x86.slwpcb() nounwind
137 declare i8 @llvm.x86.lwpins32(i32, i32, i32) nounwind
138 declare void @llvm.x86.lwpval32(i32, i32, i32) nounwind