1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple aarch64-none-linux-gnu -enable-unsafe-fp-math -mattr=+fullfp16 < %s | FileCheck %s
4 define half @scvtf_f16_2(i32 %state) {
5 ; CHECK-LABEL: scvtf_f16_2:
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: scvtf h0, w0, #1
10 %conv = sitofp i32 %state to half
11 %div = fmul half %conv, 5.000000e-01
15 define half @scvtf_f16_4(i32 %state) {
16 ; CHECK-LABEL: scvtf_f16_4:
17 ; CHECK: // %bb.0: // %entry
18 ; CHECK-NEXT: scvtf h0, w0, #2
21 %conv = sitofp i32 %state to half
22 %div = fmul half %conv, 2.500000e-01
26 define half @scvtf_f16_8(i32 %state) {
27 ; CHECK-LABEL: scvtf_f16_8:
28 ; CHECK: // %bb.0: // %entry
29 ; CHECK-NEXT: scvtf h0, w0, #3
32 %conv = sitofp i32 %state to half
33 %div = fmul half %conv, 1.250000e-01
37 define half @scvtf_f16_16(i32 %state) {
38 ; CHECK-LABEL: scvtf_f16_16:
39 ; CHECK: // %bb.0: // %entry
40 ; CHECK-NEXT: scvtf h0, w0, #4
43 %conv = sitofp i32 %state to half
44 %div = fmul half %conv, 6.250000e-02
48 define half @scvtf_f16_32(i32 %state) {
49 ; CHECK-LABEL: scvtf_f16_32:
50 ; CHECK: // %bb.0: // %entry
51 ; CHECK-NEXT: scvtf h0, w0, #5
54 %conv = sitofp i32 %state to half
55 %div = fmul half %conv, 3.125000e-02
59 define float @scvtf_f32_2(i32 %state) {
60 ; CHECK-LABEL: scvtf_f32_2:
61 ; CHECK: // %bb.0: // %entry
62 ; CHECK-NEXT: scvtf s0, w0, #1
65 %conv = sitofp i32 %state to float
66 %div = fmul float %conv, 5.000000e-01
70 define float @scvtf_f32_4(i32 %state) {
71 ; CHECK-LABEL: scvtf_f32_4:
72 ; CHECK: // %bb.0: // %entry
73 ; CHECK-NEXT: scvtf s0, w0, #2
76 %conv = sitofp i32 %state to float
77 %div = fmul float %conv, 2.500000e-01
81 define float @scvtf_f32_8(i32 %state) {
82 ; CHECK-LABEL: scvtf_f32_8:
83 ; CHECK: // %bb.0: // %entry
84 ; CHECK-NEXT: scvtf s0, w0, #3
87 %conv = sitofp i32 %state to float
88 %div = fmul float %conv, 1.250000e-01
92 define float @scvtf_f32_16(i32 %state) {
93 ; CHECK-LABEL: scvtf_f32_16:
94 ; CHECK: // %bb.0: // %entry
95 ; CHECK-NEXT: scvtf s0, w0, #4
98 %conv = sitofp i32 %state to float
99 %div = fmul float %conv, 6.250000e-02
103 define float @scvtf_f32_32(i32 %state) {
104 ; CHECK-LABEL: scvtf_f32_32:
105 ; CHECK: // %bb.0: // %entry
106 ; CHECK-NEXT: scvtf s0, w0, #5
109 %conv = sitofp i32 %state to float
110 %div = fmul float %conv, 3.125000e-02
114 define double @scvtf_f64_2(i64 %state) {
115 ; CHECK-LABEL: scvtf_f64_2:
116 ; CHECK: // %bb.0: // %entry
117 ; CHECK-NEXT: scvtf d0, x0, #1
120 %conv = sitofp i64 %state to double
121 %div = fmul double %conv, 5.000000e-01
125 define double @scvtf_f64_4(i64 %state) {
126 ; CHECK-LABEL: scvtf_f64_4:
127 ; CHECK: // %bb.0: // %entry
128 ; CHECK-NEXT: scvtf d0, x0, #2
131 %conv = sitofp i64 %state to double
132 %div = fmul double %conv, 2.500000e-01
136 define double @scvtf_f64_8(i64 %state) {
137 ; CHECK-LABEL: scvtf_f64_8:
138 ; CHECK: // %bb.0: // %entry
139 ; CHECK-NEXT: scvtf d0, x0, #3
142 %conv = sitofp i64 %state to double
143 %div = fmul double %conv, 1.250000e-01
147 define double @scvtf_f64_16(i64 %state) {
148 ; CHECK-LABEL: scvtf_f64_16:
149 ; CHECK: // %bb.0: // %entry
150 ; CHECK-NEXT: scvtf d0, x0, #4
153 %conv = sitofp i64 %state to double
154 %div = fmul double %conv, 6.250000e-02
158 define double @scvtf_f64_32(i64 %state) {
159 ; CHECK-LABEL: scvtf_f64_32:
160 ; CHECK: // %bb.0: // %entry
161 ; CHECK-NEXT: scvtf d0, x0, #5
164 %conv = sitofp i64 %state to double
165 %div = fmul double %conv, 3.125000e-02