1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=bdver4 | FileCheck %s
4 define <4 x i32> @rot_v4i32_splat(<4 x i32> %x) {
5 ; CHECK-LABEL: rot_v4i32_splat:
7 ; CHECK-NEXT: vprotd $31, %xmm0, %xmm0
9 %1 = lshr <4 x i32> %x, <i32 1, i32 1, i32 1, i32 1>
10 %2 = shl <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
11 %3 = or <4 x i32> %1, %2
15 define <4 x i32> @rot_v4i32_non_splat(<4 x i32> %x) {
16 ; CHECK-LABEL: rot_v4i32_non_splat:
18 ; CHECK-NEXT: vprotd {{.*}}(%rip), %xmm0, %xmm0
20 %1 = lshr <4 x i32> %x, <i32 1, i32 2, i32 3, i32 4>
21 %2 = shl <4 x i32> %x, <i32 31, i32 30, i32 29, i32 28>
22 %3 = or <4 x i32> %1, %2
26 define <4 x i32> @rot_v4i32_splat_2masks(<4 x i32> %x) {
27 ; CHECK-LABEL: rot_v4i32_splat_2masks:
29 ; CHECK-NEXT: vprotd $31, %xmm0, %xmm0
30 ; CHECK-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
32 %1 = lshr <4 x i32> %x, <i32 1, i32 1, i32 1, i32 1>
33 %2 = and <4 x i32> %1, <i32 4294901760, i32 4294901760, i32 4294901760, i32 4294901760>
35 %3 = shl <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
36 %4 = and <4 x i32> %3, <i32 0, i32 4294901760, i32 0, i32 4294901760>
37 %5 = or <4 x i32> %2, %4
41 define <4 x i32> @rot_v4i32_non_splat_2masks(<4 x i32> %x) {
42 ; CHECK-LABEL: rot_v4i32_non_splat_2masks:
44 ; CHECK-NEXT: vprotd {{.*}}(%rip), %xmm0, %xmm0
45 ; CHECK-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
47 %1 = lshr <4 x i32> %x, <i32 1, i32 2, i32 3, i32 4>
48 %2 = and <4 x i32> %1, <i32 4294901760, i32 4294901760, i32 4294901760, i32 4294901760>
50 %3 = shl <4 x i32> %x, <i32 31, i32 30, i32 29, i32 28>
51 %4 = and <4 x i32> %3, <i32 0, i32 4294901760, i32 0, i32 4294901760>
52 %5 = or <4 x i32> %2, %4