forked from OSchip/llvm-project
[X86] Add AVX512 tests for vector rotations
This commit is contained in:
parent
e25eee4db7
commit
98e37af272
|
@ -1,11 +1,17 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=bdver4 | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=bdver4 | FileCheck %s --check-prefixes=CHECK,XOP
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=skylake-avx512 | FileCheck %s --check-prefixes=CHECK,AVX512
|
||||
|
||||
define <4 x i32> @rot_v4i32_splat(<4 x i32> %x) {
|
||||
; CHECK-LABEL: rot_v4i32_splat:
|
||||
; CHECK: # %bb.0:
|
||||
; CHECK-NEXT: vprotd $31, %xmm0, %xmm0
|
||||
; CHECK-NEXT: retq
|
||||
; XOP-LABEL: rot_v4i32_splat:
|
||||
; XOP: # %bb.0:
|
||||
; XOP-NEXT: vprotd $31, %xmm0, %xmm0
|
||||
; XOP-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: rot_v4i32_splat:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vprold $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: retq
|
||||
%1 = lshr <4 x i32> %x, <i32 1, i32 1, i32 1, i32 1>
|
||||
%2 = shl <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
|
||||
%3 = or <4 x i32> %1, %2
|
||||
|
@ -13,10 +19,15 @@ define <4 x i32> @rot_v4i32_splat(<4 x i32> %x) {
|
|||
}
|
||||
|
||||
define <4 x i32> @rot_v4i32_non_splat(<4 x i32> %x) {
|
||||
; CHECK-LABEL: rot_v4i32_non_splat:
|
||||
; CHECK: # %bb.0:
|
||||
; CHECK-NEXT: vprotd {{.*}}(%rip), %xmm0, %xmm0
|
||||
; CHECK-NEXT: retq
|
||||
; XOP-LABEL: rot_v4i32_non_splat:
|
||||
; XOP: # %bb.0:
|
||||
; XOP-NEXT: vprotd {{.*}}(%rip), %xmm0, %xmm0
|
||||
; XOP-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: rot_v4i32_non_splat:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vprolvd {{.*}}(%rip), %xmm0, %xmm0
|
||||
; AVX512-NEXT: retq
|
||||
%1 = lshr <4 x i32> %x, <i32 1, i32 2, i32 3, i32 4>
|
||||
%2 = shl <4 x i32> %x, <i32 31, i32 30, i32 29, i32 28>
|
||||
%3 = or <4 x i32> %1, %2
|
||||
|
@ -24,11 +35,17 @@ define <4 x i32> @rot_v4i32_non_splat(<4 x i32> %x) {
|
|||
}
|
||||
|
||||
define <4 x i32> @rot_v4i32_splat_2masks(<4 x i32> %x) {
|
||||
; CHECK-LABEL: rot_v4i32_splat_2masks:
|
||||
; CHECK: # %bb.0:
|
||||
; CHECK-NEXT: vprotd $31, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
|
||||
; CHECK-NEXT: retq
|
||||
; XOP-LABEL: rot_v4i32_splat_2masks:
|
||||
; XOP: # %bb.0:
|
||||
; XOP-NEXT: vprotd $31, %xmm0, %xmm0
|
||||
; XOP-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
|
||||
; XOP-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: rot_v4i32_splat_2masks:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vprold $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
|
||||
; AVX512-NEXT: retq
|
||||
%1 = lshr <4 x i32> %x, <i32 1, i32 1, i32 1, i32 1>
|
||||
%2 = and <4 x i32> %1, <i32 4294901760, i32 4294901760, i32 4294901760, i32 4294901760>
|
||||
|
||||
|
@ -39,11 +56,17 @@ define <4 x i32> @rot_v4i32_splat_2masks(<4 x i32> %x) {
|
|||
}
|
||||
|
||||
define <4 x i32> @rot_v4i32_non_splat_2masks(<4 x i32> %x) {
|
||||
; CHECK-LABEL: rot_v4i32_non_splat_2masks:
|
||||
; CHECK: # %bb.0:
|
||||
; CHECK-NEXT: vprotd {{.*}}(%rip), %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
|
||||
; CHECK-NEXT: retq
|
||||
; XOP-LABEL: rot_v4i32_non_splat_2masks:
|
||||
; XOP: # %bb.0:
|
||||
; XOP-NEXT: vprotd {{.*}}(%rip), %xmm0, %xmm0
|
||||
; XOP-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
|
||||
; XOP-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: rot_v4i32_non_splat_2masks:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vprolvd {{.*}}(%rip), %xmm0, %xmm0
|
||||
; AVX512-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
|
||||
; AVX512-NEXT: retq
|
||||
%1 = lshr <4 x i32> %x, <i32 1, i32 2, i32 3, i32 4>
|
||||
%2 = and <4 x i32> %1, <i32 4294901760, i32 4294901760, i32 4294901760, i32 4294901760>
|
||||
|
||||
|
|
Loading…
Reference in New Issue