2018-06-03 22:31:30 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s
|
2014-12-17 02:24:07 +08:00
|
|
|
|
|
|
|
define <64 x i8> @vpaddb512_test(<64 x i8> %i, <64 x i8> %j) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddb512_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vpaddb %zmm1, %zmm0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = add <64 x i8> %i, %j
|
|
|
|
ret <64 x i8> %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @vpaddb512_fold_test(<64 x i8> %i, <64 x i8>* %j) nounwind {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddb512_fold_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vpaddb (%rdi), %zmm0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load <64 x i8>, <64 x i8>* %j, align 4
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = add <64 x i8> %i, %tmp
|
|
|
|
ret <64 x i8> %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpaddw512_test(<32 x i16> %i, <32 x i16> %j) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddw512_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vpaddw %zmm1, %zmm0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = add <32 x i16> %i, %j
|
|
|
|
ret <32 x i16> %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpaddw512_fold_test(<32 x i16> %i, <32 x i16>* %j) nounwind {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddw512_fold_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vpaddw (%rdi), %zmm0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load <32 x i16>, <32 x i16>* %j, align 4
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = add <32 x i16> %i, %tmp
|
|
|
|
ret <32 x i16> %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpaddw512_mask_test(<32 x i16> %i, <32 x i16> %j, <32 x i16> %mask1) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddw512_mask_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vptestmw %zmm2, %zmm2, %k1
|
|
|
|
; CHECK-NEXT: vpaddw %zmm1, %zmm0, %zmm0 {%k1}
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%mask = icmp ne <32 x i16> %mask1, zeroinitializer
|
|
|
|
%x = add <32 x i16> %i, %j
|
|
|
|
%r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %i
|
|
|
|
ret <32 x i16> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpaddw512_maskz_test(<32 x i16> %i, <32 x i16> %j, <32 x i16> %mask1) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddw512_maskz_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vptestmw %zmm2, %zmm2, %k1
|
|
|
|
; CHECK-NEXT: vpaddw %zmm1, %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%mask = icmp ne <32 x i16> %mask1, zeroinitializer
|
|
|
|
%x = add <32 x i16> %i, %j
|
|
|
|
%r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpaddw512_mask_fold_test(<32 x i16> %i, <32 x i16>* %j.ptr, <32 x i16> %mask1) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddw512_mask_fold_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vptestmw %zmm1, %zmm1, %k1
|
|
|
|
; CHECK-NEXT: vpaddw (%rdi), %zmm0, %zmm0 {%k1}
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%mask = icmp ne <32 x i16> %mask1, zeroinitializer
|
2015-02-28 05:17:42 +08:00
|
|
|
%j = load <32 x i16>, <32 x i16>* %j.ptr
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = add <32 x i16> %i, %j
|
|
|
|
%r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %i
|
|
|
|
ret <32 x i16> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpaddw512_maskz_fold_test(<32 x i16> %i, <32 x i16>* %j.ptr, <32 x i16> %mask1) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpaddw512_maskz_fold_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vptestmw %zmm1, %zmm1, %k1
|
|
|
|
; CHECK-NEXT: vpaddw (%rdi), %zmm0, %zmm0 {%k1} {z}
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%mask = icmp ne <32 x i16> %mask1, zeroinitializer
|
2015-02-28 05:17:42 +08:00
|
|
|
%j = load <32 x i16>, <32 x i16>* %j.ptr
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = add <32 x i16> %i, %j
|
|
|
|
%r = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer
|
|
|
|
ret <32 x i16> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @vpsubb512_test(<64 x i8> %i, <64 x i8> %j) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpsubb512_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vpsubb %zmm1, %zmm0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = sub <64 x i8> %i, %j
|
|
|
|
ret <64 x i8> %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpsubw512_test(<32 x i16> %i, <32 x i16> %j) nounwind readnone {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpsubw512_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vpsubw %zmm1, %zmm0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = sub <32 x i16> %i, %j
|
|
|
|
ret <32 x i16> %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @vpmullw512_test(<32 x i16> %i, <32 x i16> %j) {
|
2018-06-03 22:31:30 +08:00
|
|
|
; CHECK-LABEL: vpmullw512_test:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: vpmullw %zmm1, %zmm0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-12-17 02:24:07 +08:00
|
|
|
%x = mul <32 x i16> %i, %j
|
|
|
|
ret <32 x i16> %x
|
|
|
|
}
|
|
|
|
|