1 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NO_AVX512VL --check-prefix=NO_AVX512F --check-prefix=SSE
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=NO_AVX512VL --check-prefix=NO_AVX512F --check-prefix=AVX
3 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=NO_AVX512VL --check-prefix=AVX512ALL --check-prefix=AVX512F
4 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f -mattr=+avx512vl -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=AVX512ALL --check-prefix=AVX512VL
7 define i64 @test_sub_i64(i64 %arg1, i64 %arg2) {
8 %ret = sub i64 %arg1, %arg2
12 define i32 @test_sub_i32(i32 %arg1, i32 %arg2) {
13 %ret = sub i32 %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 <4 x float> @test_sub_v4f32(<4 x float> %arg1, <4 x float> %arg2) {
23 %ret = fsub <4 x float> %arg1, %arg2
33 - { id: 0, class: gpr }
34 - { id: 1, class: gpr }
35 - { id: 2, class: gpr }
36 # ALL: %0:gr64 = COPY $rdi
37 # ALL-NEXT: %1:gr64 = COPY $rsi
38 # ALL-NEXT: %2:gr64 = SUB64rr %0, %1
45 %2(s64) = G_SUB %0, %1
55 - { id: 0, class: gpr }
56 - { id: 1, class: gpr }
57 - { id: 2, class: gpr }
58 # ALL: %0:gr32 = COPY $edi
59 # ALL-NEXT: %1:gr32 = COPY $esi
60 # ALL-NEXT: %2:gr32 = SUB32rr %0, %1
67 %2(s32) = G_SUB %0, %1
77 tracksRegLiveness: true
79 - { id: 0, class: vecr }
80 - { id: 1, class: vecr }
81 - { id: 2, class: vecr }
82 # NO_AVX512VL: %0:vr128 = COPY $xmm0
83 # AVX512VL: %0:vr128x = COPY $xmm0
84 # NO_AVX512VL: %1:vr128 = COPY $xmm1
85 # AVX512VL: %1:vr128x = COPY $xmm1
86 # SSE-NEXT: %2:vr128 = PSUBDrr %0, %1
87 # AVX-NEXT: %2:vr128 = VPSUBDrr %0, %1
88 # AVX512F-NEXT: %2:vr128 = VPSUBDrr %0, %1
89 # AVX512VL-NEXT: %2:vr128x = VPSUBDZ128rr %0, %1
94 %0(<4 x s32>) = COPY $xmm0
95 %1(<4 x s32>) = COPY $xmm1
96 %2(<4 x s32>) = G_SUB %0, %1
97 $xmm0 = COPY %2(<4 x s32>)
105 regBankSelected: true
107 tracksRegLiveness: true
109 - { id: 0, class: vecr }
110 - { id: 1, class: vecr }
111 - { id: 2, class: vecr }
112 # NO_AVX512VL: %0:vr128 = COPY $xmm0
113 # NO_AVX512VL: %1:vr128 = COPY $xmm1
114 # SSE-NEXT: %2:vr128 = SUBPSrr %0, %1
115 # AVX-NEXT: %2:vr128 = VSUBPSrr %0, %1
116 # AVX512F-NEXT: %2:vr128 = VSUBPSrr %0, %1
118 # AVX512VL: %0:vr128x = COPY $xmm0
119 # AVX512VL: %1:vr128x = COPY $xmm1
120 # AVX512VL-NEXT: %2:vr128x = VSUBPSZ128rr %0, %1
123 liveins: $xmm0, $xmm1
125 %0(<4 x s32>) = COPY $xmm0
126 %1(<4 x s32>) = COPY $xmm1
127 %2(<4 x s32>) = G_FSUB %0, %1
128 $xmm0 = COPY %2(<4 x s32>)
129 RET 0, implicit $xmm0