1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -mtriple=arm64-eabi -mattr=fullfp16,sve | FileCheck %s
4 define float @divf32_2(float %a) nounwind {
5 ; CHECK-LABEL: divf32_2:
7 ; CHECK-NEXT: fmov s1, #0.50000000
8 ; CHECK-NEXT: fmul s0, s0, s1
10 %r = fdiv float %a, 2.0
14 define float @divf32_2_arcp(float %a) nounwind {
15 ; CHECK-LABEL: divf32_2_arcp:
17 ; CHECK-NEXT: fmov s1, #0.50000000
18 ; CHECK-NEXT: fmul s0, s0, s1
20 %r = fdiv arcp float %a, 2.0
24 define float @divf32_p75(float %a) nounwind {
25 ; CHECK-LABEL: divf32_p75:
27 ; CHECK-NEXT: fmov s1, #0.75000000
28 ; CHECK-NEXT: fdiv s0, s0, s1
30 %r = fdiv float %a, 0.75
34 define float @divf32_p75_arcp(float %a) nounwind {
35 ; CHECK-LABEL: divf32_p75_arcp:
37 ; CHECK-NEXT: mov w8, #43691 // =0xaaab
38 ; CHECK-NEXT: movk w8, #16298, lsl #16
39 ; CHECK-NEXT: fmov s1, w8
40 ; CHECK-NEXT: fmul s0, s0, s1
42 %r = fdiv arcp float %a, 0.75
46 define half @divf16_2(half %a) nounwind {
47 ; CHECK-LABEL: divf16_2:
49 ; CHECK-NEXT: fmov h1, #0.50000000
50 ; CHECK-NEXT: fmul h0, h0, h1
52 %r = fdiv half %a, 2.0
56 define half @divf16_32768(half %a) nounwind {
57 ; CHECK-LABEL: divf16_32768:
59 ; CHECK-NEXT: mov w8, #30720 // =0x7800
60 ; CHECK-NEXT: fmov h1, w8
61 ; CHECK-NEXT: fdiv h0, h0, h1
63 %r = fdiv half %a, 32768.0
67 define half @divf16_32768_arcp(half %a) nounwind {
68 ; CHECK-LABEL: divf16_32768_arcp:
70 ; CHECK-NEXT: mov w8, #30720 // =0x7800
71 ; CHECK-NEXT: fmov h1, w8
72 ; CHECK-NEXT: fdiv h0, h0, h1
74 %r = fdiv arcp half %a, 32768.0
78 define double @divf64_2(double %a) nounwind {
79 ; CHECK-LABEL: divf64_2:
81 ; CHECK-NEXT: fmov d1, #0.50000000
82 ; CHECK-NEXT: fmul d0, d0, d1
84 %r = fdiv double %a, 2.0
88 define <4 x float> @divv4f32_2(<4 x float> %a) nounwind {
89 ; CHECK-LABEL: divv4f32_2:
91 ; CHECK-NEXT: movi v1.4s, #63, lsl #24
92 ; CHECK-NEXT: fmul v0.4s, v0.4s, v1.4s
94 %r = fdiv <4 x float> %a, <float 2.0, float 2.0, float 2.0, float 2.0>
98 define <4 x float> @divv4f32_2_arcp(<4 x float> %a) nounwind {
99 ; CHECK-LABEL: divv4f32_2_arcp:
101 ; CHECK-NEXT: movi v1.4s, #63, lsl #24
102 ; CHECK-NEXT: fmul v0.4s, v0.4s, v1.4s
104 %r = fdiv arcp <4 x float> %a, <float 2.0, float 2.0, float 2.0, float 2.0>
108 define <4 x float> @divv4f32_3(<4 x float> %a) nounwind {
109 ; CHECK-LABEL: divv4f32_3:
111 ; CHECK-NEXT: fmov v1.4s, #3.00000000
112 ; CHECK-NEXT: fdiv v0.4s, v0.4s, v1.4s
114 %r = fdiv <4 x float> %a, <float 3.0, float 3.0, float 3.0, float 3.0>
118 define <4 x float> @divv4f32_3_arcp(<4 x float> %a) nounwind {
119 ; CHECK-LABEL: divv4f32_3_arcp:
121 ; CHECK-NEXT: mov w8, #43691 // =0xaaab
122 ; CHECK-NEXT: movk w8, #16042, lsl #16
123 ; CHECK-NEXT: dup v1.4s, w8
124 ; CHECK-NEXT: fmul v0.4s, v0.4s, v1.4s
126 %r = fdiv arcp <4 x float> %a, <float 3.0, float 3.0, float 3.0, float 3.0>
130 define <4 x float> @divv4f32_24816(<4 x float> %a) nounwind {
131 ; CHECK-LABEL: divv4f32_24816:
133 ; CHECK-NEXT: adrp x8, .LCPI12_0
134 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI12_0]
135 ; CHECK-NEXT: fdiv v0.4s, v0.4s, v1.4s
137 %r = fdiv <4 x float> %a, <float 2.0, float 4.0, float 8.0, float 16.0>
141 define <vscale x 4 x float> @divnxv4f32_2(<vscale x 4 x float> %a) nounwind {
142 ; CHECK-LABEL: divnxv4f32_2:
144 ; CHECK-NEXT: ptrue p0.s
145 ; CHECK-NEXT: fmul z0.s, p0/m, z0.s, #0.5
147 %r = fdiv <vscale x 4 x float> %a, splat (float 2.0)
148 ret <vscale x 4 x float> %r