1 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+sse2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NOVL --check-prefix=SSE2
2 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NOVL --check-prefix=AVX1
3 # 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
4 # 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
7 define <16 x i8> @test_sub_v16i8(<16 x i8> %arg1, <16 x i8> %arg2) {
8 %ret = sub <16 x i8> %arg1, %arg2
12 define <8 x i16> @test_sub_v8i16(<8 x i16> %arg1, <8 x i16> %arg2) {
13 %ret = sub <8 x i16> %arg1, %arg2
17 define <4 x i32> @test_sub_v4i32(<4 x i32> %arg1, <4 x i32> %arg2) {
18 %ret = sub <4 x i32> %arg1, %arg2
22 define <2 x i64> @test_sub_v2i64(<2 x i64> %arg1, <2 x i64> %arg2) {
23 %ret = sub <2 x i64> %arg1, %arg2
30 # ALL-LABEL: name: test_sub_v16i8
35 - { id: 0, class: vecr }
36 - { id: 1, class: vecr }
37 - { id: 2, class: vecr }
38 # SSE2: %2:vr128 = PSUBBrr %0, %1
40 # AVX1: %2:vr128 = VPSUBBrr %0, %1
42 # AVX512VL: %2:vr128 = VPSUBBrr %0, %1
44 # AVX512BWVL: %2:vr128x = VPSUBBZ128rr %0, %1
49 %0(<16 x s8>) = COPY $xmm0
50 %1(<16 x s8>) = COPY $xmm1
51 %2(<16 x s8>) = G_SUB %0, %1
52 $xmm0 = COPY %2(<16 x s8>)
58 # ALL-LABEL: name: test_sub_v8i16
63 - { id: 0, class: vecr }
64 - { id: 1, class: vecr }
65 - { id: 2, class: vecr }
66 # SSE2: %2:vr128 = PSUBWrr %0, %1
68 # AVX1: %2:vr128 = VPSUBWrr %0, %1
70 # AVX512VL: %2:vr128 = VPSUBWrr %0, %1
72 # AVX512BWVL: %2:vr128x = VPSUBWZ128rr %0, %1
77 %0(<8 x s16>) = COPY $xmm0
78 %1(<8 x s16>) = COPY $xmm1
79 %2(<8 x s16>) = G_SUB %0, %1
80 $xmm0 = COPY %2(<8 x s16>)
86 # ALL-LABEL: name: test_sub_v4i32
91 - { id: 0, class: vecr }
92 - { id: 1, class: vecr }
93 - { id: 2, class: vecr }
94 # SSE2: %2:vr128 = PSUBDrr %0, %1
96 # AVX1: %2:vr128 = VPSUBDrr %0, %1
98 # AVX512VL: %2:vr128x = VPSUBDZ128rr %0, %1
100 # AVX512BWVL: %2:vr128x = VPSUBDZ128rr %0, %1
103 liveins: $xmm0, $xmm1
105 %0(<4 x s32>) = COPY $xmm0
106 %1(<4 x s32>) = COPY $xmm1
107 %2(<4 x s32>) = G_SUB %0, %1
108 $xmm0 = COPY %2(<4 x s32>)
109 RET 0, implicit $xmm0
114 # ALL-LABEL: name: test_sub_v2i64
117 regBankSelected: true
119 - { id: 0, class: vecr }
120 - { id: 1, class: vecr }
121 - { id: 2, class: vecr }
122 # SSE2: %2:vr128 = PSUBQrr %0, %1
124 # AVX1: %2:vr128 = VPSUBQrr %0, %1
126 # AVX512VL: %2:vr128x = VPSUBQZ128rr %0, %1
128 # AVX512BWVL: %2:vr128x = VPSUBQZ128rr %0, %1
131 liveins: $xmm0, $xmm1
133 %0(<2 x s64>) = COPY $xmm0
134 %1(<2 x s64>) = COPY $xmm1
135 %2(<2 x s64>) = G_SUB %0, %1
136 $xmm0 = COPY %2(<2 x s64>)
137 RET 0, implicit $xmm0