mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
[X86] Adding more tests for horizontal [F]HADD/[F]SUB for AVX512 vectors types
llvm-svn: 311847
This commit is contained in:
parent
e75012de8c
commit
6582a855c0
@ -1,6 +1,6 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
;RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=KNL
|
||||
;RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=skx | FileCheck %s --check-prefix=CHECK --check-prefix=SKX
|
||||
;RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=knl | FileCheck %s --check-prefix=KNL
|
||||
;RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=skx | FileCheck %s --check-prefix=SKX
|
||||
|
||||
define i32 @hadd_16(<16 x i32> %x225) {
|
||||
; KNL-LABEL: hadd_16:
|
||||
@ -110,3 +110,83 @@ define float @fhsub_16(<16 x float> %x225) {
|
||||
ret float %x230
|
||||
}
|
||||
|
||||
define <16 x i32> @hadd_16_3(<16 x i32> %x225, <16 x i32> %x227) {
|
||||
; CHECK-LABEL: hadd_16_3:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vphaddd %ymm1, %ymm0, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
; KNL-LABEL: hadd_16_3:
|
||||
; KNL: # BB#0:
|
||||
; KNL-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
|
||||
; KNL-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
|
||||
; KNL-NEXT: vpaddd %zmm0, %zmm2, %zmm0
|
||||
; KNL-NEXT: retq
|
||||
;
|
||||
; SKX-LABEL: hadd_16_3:
|
||||
; SKX: # BB#0:
|
||||
; SKX-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
|
||||
; SKX-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
|
||||
; SKX-NEXT: vpaddd %zmm0, %zmm2, %zmm0
|
||||
; SKX-NEXT: retq
|
||||
%x226 = shufflevector <16 x i32> %x225, <16 x i32> %x227, <16 x i32> <i32 0, i32 2, i32 16, i32 18
|
||||
, i32 4, i32 6, i32 20, i32 22, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%x228 = shufflevector <16 x i32> %x225, <16 x i32> %x227, <16 x i32> <i32 1, i32 3, i32 17, i32 19
|
||||
, i32 5 , i32 7, i32 21, i32 23, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef,
|
||||
i32 undef, i32 undef>
|
||||
%x229 = add <16 x i32> %x226, %x228
|
||||
ret <16 x i32> %x229
|
||||
}
|
||||
|
||||
define <16 x float> @fhadd_16_3(<16 x float> %x225, <16 x float> %x227) {
|
||||
; CHECK-LABEL: fhadd_16_3:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vhaddps %ymm1, %ymm0, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
; KNL-LABEL: fhadd_16_3:
|
||||
; KNL: # BB#0:
|
||||
; KNL-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
|
||||
; KNL-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
|
||||
; KNL-NEXT: vaddps %zmm0, %zmm2, %zmm0
|
||||
; KNL-NEXT: retq
|
||||
;
|
||||
; SKX-LABEL: fhadd_16_3:
|
||||
; SKX: # BB#0:
|
||||
; SKX-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
|
||||
; SKX-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
|
||||
; SKX-NEXT: vaddps %zmm0, %zmm2, %zmm0
|
||||
; SKX-NEXT: retq
|
||||
%x226 = shufflevector <16 x float> %x225, <16 x float> %x227, <16 x i32> <i32 0, i32 2, i32 16, i32 18
|
||||
, i32 4, i32 6, i32 20, i32 22, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%x228 = shufflevector <16 x float> %x225, <16 x float> %x227, <16 x i32> <i32 1, i32 3, i32 17, i32 19
|
||||
, i32 5 , i32 7, i32 21, i32 23, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%x229 = fadd <16 x float> %x226, %x228
|
||||
ret <16 x float> %x229
|
||||
}
|
||||
|
||||
define <8 x double> @fhadd_16_4(<8 x double> %x225, <8 x double> %x227) {
|
||||
; CHECK-LABEL: fhadd_16_4:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vunpcklpd {{.*#+}} ymm2 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
|
||||
; CHECK-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
|
||||
; CHECK-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
|
||||
; CHECK-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
|
||||
; CHECK-NEXT: vaddpd %zmm0, %zmm2, %zmm0
|
||||
; CHECK-NEXT: retq
|
||||
; KNL-LABEL: fhadd_16_4:
|
||||
; KNL: # BB#0:
|
||||
; KNL-NEXT: vunpcklpd {{.*#+}} ymm2 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
|
||||
; KNL-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
|
||||
; KNL-NEXT: vaddpd %zmm0, %zmm2, %zmm0
|
||||
; KNL-NEXT: retq
|
||||
;
|
||||
; SKX-LABEL: fhadd_16_4:
|
||||
; SKX: # BB#0:
|
||||
; SKX-NEXT: vunpcklpd {{.*#+}} ymm2 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
|
||||
; SKX-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
|
||||
; SKX-NEXT: vaddpd %zmm0, %zmm2, %zmm0
|
||||
; SKX-NEXT: retq
|
||||
%x226 = shufflevector <8 x double> %x225, <8 x double> %x227, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%x228 = shufflevector <8 x double> %x225, <8 x double> %x227, <8 x i32> <i32 1, i32 9, i32 3, i32 11, i32 undef ,i32 undef, i32 undef, i32 undef>
|
||||
%x229 = fadd <8 x double> %x226, %x228
|
||||
ret <8 x double> %x229
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user