1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=CHECK,SSE
3 ; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=CHECK,AVX
4 ; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=CHECK,AVX
5 ; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f -mattr=+avx512vl -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=CHECK,AVX
7 define i64 @test_sub_i64(i64 %arg1, i64 %arg2) {
8 ; CHECK-LABEL: test_sub_i64:
10 ; CHECK-NEXT: movq %rdi, %rax
11 ; CHECK-NEXT: subq %rsi, %rax
13 %ret = sub i64 %arg1, %arg2
17 define i32 @test_sub_i32(i32 %arg1, i32 %arg2) {
18 ; CHECK-LABEL: test_sub_i32:
20 ; CHECK-NEXT: movl %edi, %eax
21 ; CHECK-NEXT: subl %esi, %eax
23 %ret = sub i32 %arg1, %arg2
27 define float @test_add_float(float %arg1, float %arg2) {
28 ; SSE-LABEL: test_add_float:
30 ; SSE-NEXT: addss %xmm1, %xmm0
33 ; AVX-LABEL: test_add_float:
35 ; AVX-NEXT: vaddss %xmm1, %xmm0, %xmm0
37 %ret = fadd float %arg1, %arg2
41 define double @test_add_double(double %arg1, double %arg2) {
42 ; SSE-LABEL: test_add_double:
44 ; SSE-NEXT: addsd %xmm1, %xmm0
47 ; AVX-LABEL: test_add_double:
49 ; AVX-NEXT: vaddsd %xmm1, %xmm0, %xmm0
51 %ret = fadd double %arg1, %arg2
55 define float @test_sub_float(float %arg1, float %arg2) {
56 ; SSE-LABEL: test_sub_float:
58 ; SSE-NEXT: subss %xmm1, %xmm0
61 ; AVX-LABEL: test_sub_float:
63 ; AVX-NEXT: vsubss %xmm1, %xmm0, %xmm0
65 %ret = fsub float %arg1, %arg2
69 define double @test_sub_double(double %arg1, double %arg2) {
70 ; SSE-LABEL: test_sub_double:
72 ; SSE-NEXT: subsd %xmm1, %xmm0
75 ; AVX-LABEL: test_sub_double:
77 ; AVX-NEXT: vsubsd %xmm1, %xmm0, %xmm0
79 %ret = fsub double %arg1, %arg2
83 define <4 x i32> @test_add_v4i32(<4 x i32> %arg1, <4 x i32> %arg2) {
84 ; SSE-LABEL: test_add_v4i32:
86 ; SSE-NEXT: paddd %xmm1, %xmm0
89 ; AVX-LABEL: test_add_v4i32:
91 ; AVX-NEXT: vpaddd %xmm1, %xmm0, %xmm0
93 %ret = add <4 x i32> %arg1, %arg2
97 define <4 x i32> @test_sub_v4i32(<4 x i32> %arg1, <4 x i32> %arg2) {
98 ; SSE-LABEL: test_sub_v4i32:
100 ; SSE-NEXT: psubd %xmm1, %xmm0
103 ; AVX-LABEL: test_sub_v4i32:
105 ; AVX-NEXT: vpsubd %xmm1, %xmm0, %xmm0
107 %ret = sub <4 x i32> %arg1, %arg2
111 define <4 x float> @test_add_v4f32(<4 x float> %arg1, <4 x float> %arg2) {
112 ; SSE-LABEL: test_add_v4f32:
114 ; SSE-NEXT: addps %xmm1, %xmm0
117 ; AVX-LABEL: test_add_v4f32:
119 ; AVX-NEXT: vaddps %xmm1, %xmm0, %xmm0
121 %ret = fadd <4 x float> %arg1, %arg2
125 define <4 x float> @test_sub_v4f32(<4 x float> %arg1, <4 x float> %arg2) {
126 ; SSE-LABEL: test_sub_v4f32:
128 ; SSE-NEXT: subps %xmm1, %xmm0
131 ; AVX-LABEL: test_sub_v4f32:
133 ; AVX-NEXT: vsubps %xmm1, %xmm0, %xmm0
135 %ret = fsub <4 x float> %arg1, %arg2
139 define i32 @test_copy_float(float %val) {
140 ; SSE-LABEL: test_copy_float:
142 ; SSE-NEXT: movd %xmm0, %eax
145 ; AVX-LABEL: test_copy_float:
147 ; AVX-NEXT: vmovd %xmm0, %eax
149 %r = bitcast float %val to i32
153 define float @test_copy_i32(i32 %val) {
154 ; SSE-LABEL: test_copy_i32:
156 ; SSE-NEXT: movd %edi, %xmm0
159 ; AVX-LABEL: test_copy_i32:
161 ; AVX-NEXT: vmovd %edi, %xmm0
163 %r = bitcast i32 %val to float