1 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=AVX2
2 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f,+avx512vl -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=AVX512VL
3 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f,+avx512vl,+avx512bw -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=AVX512BWVL
6 define <32 x i8> @test_sub_v32i8(<32 x i8> %arg1, <32 x i8> %arg2) {
7 %ret = sub <32 x i8> %arg1, %arg2
11 define <16 x i16> @test_sub_v16i16(<16 x i16> %arg1, <16 x i16> %arg2) {
12 %ret = sub <16 x i16> %arg1, %arg2
16 define <8 x i32> @test_sub_v8i32(<8 x i32> %arg1, <8 x i32> %arg2) {
17 %ret = sub <8 x i32> %arg1, %arg2
21 define <4 x i64> @test_sub_v4i64(<4 x i64> %arg1, <4 x i64> %arg2) {
22 %ret = sub <4 x i64> %arg1, %arg2
28 # ALL-LABEL: name: test_sub_v32i8
33 - { id: 0, class: vecr }
34 - { id: 1, class: vecr }
35 - { id: 2, class: vecr }
36 # AVX2: %2:vr256 = VPSUBBYrr %0, %1
38 # AVX512VL: %2:vr256 = VPSUBBYrr %0, %1
40 # AVX512BWVL: %2:vr256x = VPSUBBZ256rr %0, %1
45 %0(<32 x s8>) = COPY $ymm0
46 %1(<32 x s8>) = COPY $ymm1
47 %2(<32 x s8>) = G_SUB %0, %1
48 $ymm0 = COPY %2(<32 x s8>)
54 # ALL-LABEL: name: test_sub_v16i16
59 - { id: 0, class: vecr }
60 - { id: 1, class: vecr }
61 - { id: 2, class: vecr }
62 # AVX2: %2:vr256 = VPSUBWYrr %0, %1
64 # AVX512VL: %2:vr256 = VPSUBWYrr %0, %1
66 # AVX512BWVL: %2:vr256x = VPSUBWZ256rr %0, %1
71 %0(<16 x s16>) = COPY $ymm0
72 %1(<16 x s16>) = COPY $ymm1
73 %2(<16 x s16>) = G_SUB %0, %1
74 $ymm0 = COPY %2(<16 x s16>)
80 # ALL-LABEL: name: test_sub_v8i32
85 - { id: 0, class: vecr }
86 - { id: 1, class: vecr }
87 - { id: 2, class: vecr }
88 # AVX2: %2:vr256 = VPSUBDYrr %0, %1
90 # AVX512VL: %2:vr256x = VPSUBDZ256rr %0, %1
92 # AVX512BWVL: %2:vr256x = VPSUBDZ256rr %0, %1
97 %0(<8 x s32>) = COPY $ymm0
98 %1(<8 x s32>) = COPY $ymm1
99 %2(<8 x s32>) = G_SUB %0, %1
100 $ymm0 = COPY %2(<8 x s32>)
101 RET 0, implicit $ymm0
106 # ALL-LABEL: name: test_sub_v4i64
109 regBankSelected: true
111 - { id: 0, class: vecr }
112 - { id: 1, class: vecr }
113 - { id: 2, class: vecr }
114 # AVX2: %2:vr256 = VPSUBQYrr %0, %1
116 # AVX512VL: %2:vr256x = VPSUBQZ256rr %0, %1
118 # AVX512BWVL: %2:vr256x = VPSUBQZ256rr %0, %1
121 liveins: $ymm0, $ymm1
123 %0(<4 x s64>) = COPY $ymm0
124 %1(<4 x s64>) = COPY $ymm1
125 %2(<4 x s64>) = G_SUB %0, %1
126 $ymm0 = COPY %2(<4 x s64>)
127 RET 0, implicit $ymm0