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 i32 @andn32(i32 %x, i32 %y) nounwind readnone {
37 %tmp1 = xor i32 %x, -1
38 %tmp2 = and i32 %y, %tmp1
44 define i64 @andn64(i64 %x, i64 %y) nounwind readnone {
45 %tmp1 = xor i64 %x, -1
46 %tmp2 = and i64 %tmp1, %y
52 define i32 @bextr32(i32 %x, i32 %y) nounwind readnone {
53 %tmp = tail call i32 @llvm.x86.bmi.bextr.32(i32 %x, i32 %y)
59 declare i32 @llvm.x86.bmi.bextr.32(i32, i32) nounwind readnone
61 define i64 @bextr64(i64 %x, i64 %y) nounwind readnone {
62 %tmp = tail call i64 @llvm.x86.bmi.bextr.64(i64 %x, i64 %y)
68 declare i64 @llvm.x86.bmi.bextr.64(i64, i64) nounwind readnone
70 define i32 @bzhi32(i32 %x, i32 %y) nounwind readnone {
71 %tmp = tail call i32 @llvm.x86.bmi.bzhi.32(i32 %x, i32 %y)
77 declare i32 @llvm.x86.bmi.bzhi.32(i32, i32) nounwind readnone
79 define i64 @bzhi64(i64 %x, i64 %y) nounwind readnone {
80 %tmp = tail call i64 @llvm.x86.bmi.bzhi.64(i64 %x, i64 %y)
86 declare i64 @llvm.x86.bmi.bzhi.64(i64, i64) nounwind readnone
88 define i32 @blsi32(i32 %x) nounwind readnone {
90 %tmp2 = and i32 %x, %tmp
96 define i64 @blsi64(i64 %x) nounwind readnone {
98 %tmp2 = and i64 %tmp, %x
104 define i32 @blsmsk32(i32 %x) nounwind readnone {
106 %tmp2 = xor i32 %x, %tmp
112 define i64 @blsmsk64(i64 %x) nounwind readnone {
114 %tmp2 = xor i64 %tmp, %x
120 define i32 @blsr32(i32 %x) nounwind readnone {
122 %tmp2 = and i32 %x, %tmp
128 define i64 @blsr64(i64 %x) nounwind readnone {
130 %tmp2 = and i64 %tmp, %x
136 define i32 @pdep32(i32 %x, i32 %y) nounwind readnone {
137 %tmp = tail call i32 @llvm.x86.bmi.pdep.32(i32 %x, i32 %y)
143 declare i32 @llvm.x86.bmi.pdep.32(i32, i32) nounwind readnone
145 define i64 @pdep64(i64 %x, i64 %y) nounwind readnone {
146 %tmp = tail call i64 @llvm.x86.bmi.pdep.64(i64 %x, i64 %y)
152 declare i64 @llvm.x86.bmi.pdep.64(i64, i64) nounwind readnone
154 define i32 @pext32(i32 %x, i32 %y) nounwind readnone {
155 %tmp = tail call i32 @llvm.x86.bmi.pext.32(i32 %x, i32 %y)
161 declare i32 @llvm.x86.bmi.pext.32(i32, i32) nounwind readnone
163 define i64 @pext64(i64 %x, i64 %y) nounwind readnone {
164 %tmp = tail call i64 @llvm.x86.bmi.pext.64(i64 %x, i64 %y)
170 declare i64 @llvm.x86.bmi.pext.64(i64, i64) nounwind readnone