1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s --check-prefix=CHECK
4 declare half @llvm.vector.reduce.fadd.f16.v1f16(half, <1 x half>)
5 declare float @llvm.vector.reduce.fadd.f32.v1f32(float, <1 x float>)
6 declare double @llvm.vector.reduce.fadd.f64.v1f64(double, <1 x double>)
7 declare fp128 @llvm.vector.reduce.fadd.f128.v1f128(fp128, <1 x fp128>)
9 declare float @llvm.vector.reduce.fadd.f32.v3f32(float, <3 x float>)
10 declare float @llvm.vector.reduce.fadd.f32.v5f32(float, <5 x float>)
11 declare fp128 @llvm.vector.reduce.fadd.f128.v2f128(fp128, <2 x fp128>)
12 declare float @llvm.vector.reduce.fadd.f32.v16f32(float, <16 x float>)
14 define half @test_v1f16(<1 x half> %a) nounwind {
15 ; CHECK-LABEL: test_v1f16:
18 %b = call reassoc half @llvm.vector.reduce.fadd.f16.v1f16(half -0.0, <1 x half> %a)
22 define float @test_v1f32(<1 x float> %a) nounwind {
23 ; CHECK-LABEL: test_v1f32:
25 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
26 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
28 %b = call reassoc float @llvm.vector.reduce.fadd.f32.v1f32(float -0.0, <1 x float> %a)
32 define double @test_v1f64(<1 x double> %a) nounwind {
33 ; CHECK-LABEL: test_v1f64:
36 %b = call reassoc double @llvm.vector.reduce.fadd.f64.v1f64(double -0.0, <1 x double> %a)
40 define fp128 @test_v1f128(<1 x fp128> %a) nounwind {
41 ; CHECK-LABEL: test_v1f128:
44 %b = call reassoc fp128 @llvm.vector.reduce.fadd.f128.v1f128(fp128 0xL00000000000000008000000000000000, <1 x fp128> %a)
48 define float @test_v3f32(<3 x float> %a) nounwind {
49 ; CHECK-LABEL: test_v3f32:
51 ; CHECK-NEXT: movi v1.2s, #128, lsl #24
52 ; CHECK-NEXT: mov v0.s[3], v1.s[0]
53 ; CHECK-NEXT: faddp v0.4s, v0.4s, v0.4s
54 ; CHECK-NEXT: faddp s0, v0.2s
56 %b = call reassoc float @llvm.vector.reduce.fadd.f32.v3f32(float -0.0, <3 x float> %a)
60 define float @test_v5f32(<5 x float> %a) nounwind {
61 ; CHECK-LABEL: test_v5f32:
63 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
64 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
65 ; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
66 ; CHECK-NEXT: movi v5.4s, #128, lsl #24
67 ; CHECK-NEXT: // kill: def $s4 killed $s4 def $q4
68 ; CHECK-NEXT: // kill: def $s3 killed $s3 def $q3
69 ; CHECK-NEXT: mov v0.s[1], v1.s[0]
70 ; CHECK-NEXT: mov v5.s[0], v4.s[0]
71 ; CHECK-NEXT: mov v0.s[2], v2.s[0]
72 ; CHECK-NEXT: mov v0.s[3], v3.s[0]
73 ; CHECK-NEXT: fadd v0.4s, v0.4s, v5.4s
74 ; CHECK-NEXT: faddp v0.4s, v0.4s, v0.4s
75 ; CHECK-NEXT: faddp s0, v0.2s
77 %b = call reassoc float @llvm.vector.reduce.fadd.f32.v5f32(float -0.0, <5 x float> %a)
81 define fp128 @test_v2f128(<2 x fp128> %a) nounwind {
82 ; CHECK-LABEL: test_v2f128:
84 ; CHECK-NEXT: b __addtf3
85 %b = call reassoc fp128 @llvm.vector.reduce.fadd.f128.v2f128(fp128 0xL00000000000000008000000000000000, <2 x fp128> %a)
89 define float @test_v16f32(<16 x float> %a) nounwind {
90 ; CHECK-LABEL: test_v16f32:
92 ; CHECK-NEXT: fadd v1.4s, v1.4s, v3.4s
93 ; CHECK-NEXT: fadd v0.4s, v0.4s, v2.4s
94 ; CHECK-NEXT: fadd v0.4s, v0.4s, v1.4s
95 ; CHECK-NEXT: faddp v0.4s, v0.4s, v0.4s
96 ; CHECK-NEXT: faddp s0, v0.2s
98 %b = call reassoc float @llvm.vector.reduce.fadd.f32.v16f32(float -0.0, <16 x float> %a)