1 ; RUN: llc -mtriple=i386-unknown-unknown -mcpu=core-avx2 < %s | FileCheck --check-prefix=BMI2 %s
2 ; RUN: llc -mtriple=x86_64-unknown-unknown -mcpu=core-avx2 < %s | FileCheck --check-prefix=BMI264 %s
4 define i32 @shl32(i32 %x, i32 %shamt) nounwind uwtable readnone {
6 %shl = shl i32 %x, %shamt
16 define i32 @shl32i(i32 %x) nounwind uwtable readnone {
28 define i32 @shl32p(i32* %p, i32 %shamt) nounwind uwtable readnone {
31 %shl = shl i32 %x, %shamt
33 ; BMI2: shlxl %{{.+}}, ({{.+}}), %{{.+}}
36 ; BMI264: shlxl %{{.+}}, ({{.+}}), %{{.+}}
41 define i32 @shl32pi(i32* %p) nounwind uwtable readnone {
54 define i64 @shl64(i64 %x, i64 %shamt) nounwind uwtable readnone {
56 %shl = shl i64 %x, %shamt
63 define i64 @shl64i(i64 %x) nounwind uwtable readnone {
72 define i64 @shl64p(i64* %p, i64 %shamt) nounwind uwtable readnone {
75 %shl = shl i64 %x, %shamt
77 ; BMI264: shlxq %{{.+}}, ({{.+}}), %{{.+}}
82 define i64 @shl64pi(i64* %p) nounwind uwtable readnone {
92 define i32 @lshr32(i32 %x, i32 %shamt) nounwind uwtable readnone {
94 %shl = lshr i32 %x, %shamt
104 define i32 @lshr32p(i32* %p, i32 %shamt) nounwind uwtable readnone {
107 %shl = lshr i32 %x, %shamt
109 ; BMI2: shrxl %{{.+}}, ({{.+}}), %{{.+}}
112 ; BMI264: shrxl %{{.+}}, ({{.+}}), %{{.+}}
117 define i64 @lshr64(i64 %x, i64 %shamt) nounwind uwtable readnone {
119 %shl = lshr i64 %x, %shamt
126 define i64 @lshr64p(i64* %p, i64 %shamt) nounwind uwtable readnone {
129 %shl = lshr i64 %x, %shamt
131 ; BMI264: shrxq %{{.+}}, ({{.+}}), %{{.+}}
136 define i32 @ashr32(i32 %x, i32 %shamt) nounwind uwtable readnone {
138 %shl = ashr i32 %x, %shamt
148 define i32 @ashr32p(i32* %p, i32 %shamt) nounwind uwtable readnone {
151 %shl = ashr i32 %x, %shamt
153 ; BMI2: sarxl %{{.+}}, ({{.+}}), %{{.+}}
156 ; BMI264: sarxl %{{.+}}, ({{.+}}), %{{.+}}
161 define i64 @ashr64(i64 %x, i64 %shamt) nounwind uwtable readnone {
163 %shl = ashr i64 %x, %shamt
170 define i64 @ashr64p(i64* %p, i64 %shamt) nounwind uwtable readnone {
173 %shl = ashr i64 %x, %shamt
175 ; BMI264: sarxq %{{.+}}, ({{.+}}), %{{.+}}