1 ; RUN: llc < %s -march=x86-64 -mattr=+bmi,+bmi2 | FileCheck %s
3 declare i8 @llvm.cttz.i8(i8, i1) nounwind readnone
4 declare i16 @llvm.cttz.i16(i16, i1) nounwind readnone
5 declare i32 @llvm.cttz.i32(i32, i1) nounwind readnone
6 declare i64 @llvm.cttz.i64(i64, i1) nounwind readnone
8 define i8 @t1(i8 %x) nounwind {
9 %tmp = tail call i8 @llvm.cttz.i8( i8 %x, i1 false )
15 define i16 @t2(i16 %x) nounwind {
16 %tmp = tail call i16 @llvm.cttz.i16( i16 %x, i1 false )
22 define i32 @t3(i32 %x) nounwind {
23 %tmp = tail call i32 @llvm.cttz.i32( i32 %x, i1 false )
29 define i64 @t4(i64 %x) nounwind {
30 %tmp = tail call i64 @llvm.cttz.i64( i64 %x, i1 false )
36 define i8 @t5(i8 %x) nounwind {
37 %tmp = tail call i8 @llvm.cttz.i8( i8 %x, i1 true )
43 define i16 @t6(i16 %x) nounwind {
44 %tmp = tail call i16 @llvm.cttz.i16( i16 %x, i1 true )
50 define i32 @t7(i32 %x) nounwind {
51 %tmp = tail call i32 @llvm.cttz.i32( i32 %x, i1 true )
57 define i64 @t8(i64 %x) nounwind {
58 %tmp = tail call i64 @llvm.cttz.i64( i64 %x, i1 true )
64 define i32 @andn32(i32 %x, i32 %y) nounwind readnone {
65 %tmp1 = xor i32 %x, -1
66 %tmp2 = and i32 %y, %tmp1
72 define i64 @andn64(i64 %x, i64 %y) nounwind readnone {
73 %tmp1 = xor i64 %x, -1
74 %tmp2 = and i64 %tmp1, %y
80 define i32 @bextr32(i32 %x, i32 %y) nounwind readnone {
81 %tmp = tail call i32 @llvm.x86.bmi.bextr.32(i32 %x, i32 %y)
87 declare i32 @llvm.x86.bmi.bextr.32(i32, i32) nounwind readnone
89 define i64 @bextr64(i64 %x, i64 %y) nounwind readnone {
90 %tmp = tail call i64 @llvm.x86.bmi.bextr.64(i64 %x, i64 %y)
96 declare i64 @llvm.x86.bmi.bextr.64(i64, i64) nounwind readnone
98 define i32 @bzhi32(i32 %x, i32 %y) nounwind readnone {
99 %tmp = tail call i32 @llvm.x86.bmi.bzhi.32(i32 %x, i32 %y)
105 declare i32 @llvm.x86.bmi.bzhi.32(i32, i32) nounwind readnone
107 define i64 @bzhi64(i64 %x, i64 %y) nounwind readnone {
108 %tmp = tail call i64 @llvm.x86.bmi.bzhi.64(i64 %x, i64 %y)
114 declare i64 @llvm.x86.bmi.bzhi.64(i64, i64) nounwind readnone
116 define i32 @blsi32(i32 %x) nounwind readnone {
118 %tmp2 = and i32 %x, %tmp
124 define i64 @blsi64(i64 %x) nounwind readnone {
126 %tmp2 = and i64 %tmp, %x
132 define i32 @blsmsk32(i32 %x) nounwind readnone {
134 %tmp2 = xor i32 %x, %tmp
140 define i64 @blsmsk64(i64 %x) nounwind readnone {
142 %tmp2 = xor i64 %tmp, %x
148 define i32 @blsr32(i32 %x) nounwind readnone {
150 %tmp2 = and i32 %x, %tmp
156 define i64 @blsr64(i64 %x) nounwind readnone {
158 %tmp2 = and i64 %tmp, %x
164 define i32 @pdep32(i32 %x, i32 %y) nounwind readnone {
165 %tmp = tail call i32 @llvm.x86.bmi.pdep.32(i32 %x, i32 %y)
171 declare i32 @llvm.x86.bmi.pdep.32(i32, i32) nounwind readnone
173 define i64 @pdep64(i64 %x, i64 %y) nounwind readnone {
174 %tmp = tail call i64 @llvm.x86.bmi.pdep.64(i64 %x, i64 %y)
180 declare i64 @llvm.x86.bmi.pdep.64(i64, i64) nounwind readnone
182 define i32 @pext32(i32 %x, i32 %y) nounwind readnone {
183 %tmp = tail call i32 @llvm.x86.bmi.pext.32(i32 %x, i32 %y)
189 declare i32 @llvm.x86.bmi.pext.32(i32, i32) nounwind readnone
191 define i64 @pext64(i64 %x, i64 %y) nounwind readnone {
192 %tmp = tail call i64 @llvm.x86.bmi.pext.64(i64 %x, i64 %y)
198 declare i64 @llvm.x86.bmi.pext.64(i64, i64) nounwind readnone