2 * Copyright © 2015 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26 #include "nir_builder.h"
32 * Lowers some unsupported double operations, using only:
34 * - pack/unpackDouble2x32
35 * - conversion to/from single-precision
36 * - double add, mul, and fma
37 * - conditional select
38 * - 32-bit integer and floating point arithmetic
41 /* Creates a double with the exponent bits set to a given integer value */
43 set_exponent(nir_builder
*b
, nir_ssa_def
*src
, nir_ssa_def
*exp
)
45 /* Split into bits 0-31 and 32-63 */
46 nir_ssa_def
*lo
= nir_unpack_64_2x32_split_x(b
, src
);
47 nir_ssa_def
*hi
= nir_unpack_64_2x32_split_y(b
, src
);
49 /* The exponent is bits 52-62, or 20-30 of the high word, so set the exponent
52 nir_ssa_def
*new_hi
= nir_bfi(b
, nir_imm_int(b
, 0x7ff00000), exp
, hi
);
54 return nir_pack_64_2x32_split(b
, lo
, new_hi
);
58 get_exponent(nir_builder
*b
, nir_ssa_def
*src
)
61 nir_ssa_def
*hi
= nir_unpack_64_2x32_split_y(b
, src
);
63 /* extract bits 20-30 of the high word */
64 return nir_ubitfield_extract(b
, hi
, nir_imm_int(b
, 20), nir_imm_int(b
, 11));
67 /* Return infinity with the sign of the given source which is +/-0 */
70 get_signed_inf(nir_builder
*b
, nir_ssa_def
*zero
)
72 nir_ssa_def
*zero_hi
= nir_unpack_64_2x32_split_y(b
, zero
);
74 /* The bit pattern for infinity is 0x7ff0000000000000, where the sign bit
75 * is the highest bit. Only the sign bit can be non-zero in the passed in
76 * source. So we essentially need to OR the infinity and the zero, except
77 * the low 32 bits are always 0 so we can construct the correct high 32
78 * bits and then pack it together with zero low 32 bits.
80 nir_ssa_def
*inf_hi
= nir_ior(b
, nir_imm_int(b
, 0x7ff00000), zero_hi
);
81 return nir_pack_64_2x32_split(b
, nir_imm_int(b
, 0), inf_hi
);
85 * Generates the correctly-signed infinity if the source was zero, and flushes
86 * the result to 0 if the source was infinity or the calculated exponent was
87 * too small to be representable.
91 fix_inv_result(nir_builder
*b
, nir_ssa_def
*res
, nir_ssa_def
*src
,
94 /* If the exponent is too small or the original input was infinity/NaN,
95 * force the result to 0 (flush denorms) to avoid the work of handling
96 * denorms properly. Note that this doesn't preserve positive/negative
97 * zeros, but GLSL doesn't require it.
99 res
= nir_bcsel(b
, nir_ior(b
, nir_ige(b
, nir_imm_int(b
, 0), exp
),
100 nir_feq(b
, nir_fabs(b
, src
),
101 nir_imm_double(b
, INFINITY
))),
102 nir_imm_double(b
, 0.0f
), res
);
104 /* If the original input was 0, generate the correctly-signed infinity */
105 res
= nir_bcsel(b
, nir_fne(b
, src
, nir_imm_double(b
, 0.0f
)),
106 res
, get_signed_inf(b
, src
));
113 lower_rcp(nir_builder
*b
, nir_ssa_def
*src
)
115 /* normalize the input to avoid range issues */
116 nir_ssa_def
*src_norm
= set_exponent(b
, src
, nir_imm_int(b
, 1023));
118 /* cast to float, do an rcp, and then cast back to get an approximate
121 nir_ssa_def
*ra
= nir_f2f64(b
, nir_frcp(b
, nir_f2f32(b
, src_norm
)));
123 /* Fixup the exponent of the result - note that we check if this is too
126 nir_ssa_def
*new_exp
= nir_isub(b
, get_exponent(b
, ra
),
127 nir_isub(b
, get_exponent(b
, src
),
128 nir_imm_int(b
, 1023)));
130 ra
= set_exponent(b
, ra
, new_exp
);
132 /* Do a few Newton-Raphson steps to improve precision.
134 * Each step doubles the precision, and we started off with around 24 bits,
135 * so we only need to do 2 steps to get to full precision. The step is:
137 * x_new = x * (2 - x*src)
139 * But we can re-arrange this to improve precision by using another fused
142 * x_new = x + x * (1 - x*src)
144 * See https://en.wikipedia.org/wiki/Division_algorithm for more details.
147 ra
= nir_ffma(b
, nir_fneg(b
, ra
), nir_ffma(b
, ra
, src
, nir_imm_double(b
, -1)), ra
);
148 ra
= nir_ffma(b
, nir_fneg(b
, ra
), nir_ffma(b
, ra
, src
, nir_imm_double(b
, -1)), ra
);
150 return fix_inv_result(b
, ra
, src
, new_exp
);
154 lower_sqrt_rsq(nir_builder
*b
, nir_ssa_def
*src
, bool sqrt
)
156 /* We want to compute:
160 * When the exponent is even, this is equivalent to:
162 * 1/sqrt(m) * 2^(-e/2)
164 * and then the exponent is odd, this is equal to:
166 * 1/sqrt(m * 2) * 2^(-(e - 1)/2)
168 * where the m * 2 is absorbed into the exponent. So we want the exponent
169 * inside the square root to be 1 if e is odd and 0 if e is even, and we
170 * want to subtract off e/2 from the final exponent, rounded to negative
171 * infinity. We can do the former by first computing the unbiased exponent,
172 * and then AND'ing it with 1 to get 0 or 1, and we can do the latter by
173 * shifting right by 1.
176 nir_ssa_def
*unbiased_exp
= nir_isub(b
, get_exponent(b
, src
),
177 nir_imm_int(b
, 1023));
178 nir_ssa_def
*even
= nir_iand(b
, unbiased_exp
, nir_imm_int(b
, 1));
179 nir_ssa_def
*half
= nir_ishr(b
, unbiased_exp
, nir_imm_int(b
, 1));
181 nir_ssa_def
*src_norm
= set_exponent(b
, src
,
182 nir_iadd(b
, nir_imm_int(b
, 1023),
185 nir_ssa_def
*ra
= nir_f2f64(b
, nir_frsq(b
, nir_f2f32(b
, src_norm
)));
186 nir_ssa_def
*new_exp
= nir_isub(b
, get_exponent(b
, ra
), half
);
187 ra
= set_exponent(b
, ra
, new_exp
);
190 * The following implements an iterative algorithm that's very similar
191 * between sqrt and rsqrt. We start with an iteration of Goldschmit's
192 * algorithm, which looks like:
195 * y_0 = initial (single-precision) rsqrt estimate
199 * r_0 = .5 - h_0 * g_0
200 * g_1 = g_0 * r_0 + g_0
201 * h_1 = h_0 * r_0 + h_0
203 * Now g_1 ~= sqrt(a), and h_1 ~= 1/(2 * sqrt(a)). We could continue
204 * applying another round of Goldschmit, but since we would never refer
205 * back to a (the original source), we would add too much rounding error.
206 * So instead, we do one last round of Newton-Raphson, which has better
207 * rounding characteristics, to get the final rounding correct. This is
208 * split into two cases:
212 * Normally, doing a round of Newton-Raphson for sqrt involves taking a
213 * reciprocal of the original estimate, which is slow since it isn't
214 * supported in HW. But we can take advantage of the fact that we already
215 * computed a good estimate of 1/(2 * g_1) by rearranging it like so:
217 * g_2 = .5 * (g_1 + a / g_1)
218 * = g_1 + .5 * (a / g_1 - g_1)
219 * = g_1 + (.5 / g_1) * (a - g_1^2)
220 * = g_1 + h_1 * (a - g_1^2)
222 * The second term represents the error, and by splitting it out we can get
223 * better precision by computing it as part of a fused multiply-add. Since
224 * both Newton-Raphson and Goldschmit approximately double the precision of
225 * the result, these two steps should be enough.
229 * First off, note that the first round of the Goldschmit algorithm is
230 * really just a Newton-Raphson step in disguise:
232 * h_1 = h_0 * (.5 - h_0 * g_0) + h_0
233 * = h_0 * (1.5 - h_0 * g_0)
234 * = h_0 * (1.5 - .5 * a * y_0^2)
235 * = (.5 * y_0) * (1.5 - .5 * a * y_0^2)
237 * which is the standard formula multiplied by .5. Unlike in the sqrt case,
238 * we don't need the inverse to do a Newton-Raphson step; we just need h_1,
239 * so we can skip the calculation of g_1. Instead, we simply do another
240 * Newton-Raphson step:
243 * r_1 = .5 - h_1 * y_1 * a
244 * y_2 = y_1 * r_1 + y_1
246 * Where the difference from Goldschmit is that we calculate y_1 * a
247 * instead of using g_1. Doing it this way should be as fast as computing
248 * y_1 up front instead of h_1, and it lets us share the code for the
249 * initial Goldschmit step with the sqrt case.
251 * Putting it together, the computations are:
255 * r_0 = .5 - h_0 * g_0
256 * h_1 = h_0 * r_0 + h_0
258 * g_1 = g_0 * r_0 + g_0
259 * r_1 = a - g_1 * g_1
260 * g_2 = h_1 * r_1 + g_1
263 * r_1 = .5 - y_1 * (h_1 * a)
264 * y_2 = y_1 * r_1 + y_1
266 * For more on the ideas behind this, see "Software Division and Square
267 * Root Using Goldschmit's Algorithms" by Markstein and the Wikipedia page
269 * (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots).
272 nir_ssa_def
*one_half
= nir_imm_double(b
, 0.5);
273 nir_ssa_def
*h_0
= nir_fmul(b
, one_half
, ra
);
274 nir_ssa_def
*g_0
= nir_fmul(b
, src
, ra
);
275 nir_ssa_def
*r_0
= nir_ffma(b
, nir_fneg(b
, h_0
), g_0
, one_half
);
276 nir_ssa_def
*h_1
= nir_ffma(b
, h_0
, r_0
, h_0
);
279 nir_ssa_def
*g_1
= nir_ffma(b
, g_0
, r_0
, g_0
);
280 nir_ssa_def
*r_1
= nir_ffma(b
, nir_fneg(b
, g_1
), g_1
, src
);
281 res
= nir_ffma(b
, h_1
, r_1
, g_1
);
283 nir_ssa_def
*y_1
= nir_fmul(b
, nir_imm_double(b
, 2.0), h_1
);
284 nir_ssa_def
*r_1
= nir_ffma(b
, nir_fneg(b
, y_1
), nir_fmul(b
, h_1
, src
),
286 res
= nir_ffma(b
, y_1
, r_1
, y_1
);
290 /* Here, the special cases we need to handle are
294 const bool preserve_denorms
=
295 b
->shader
->info
.float_controls_execution_mode
&
296 FLOAT_CONTROLS_DENORM_PRESERVE_FP64
;
297 nir_ssa_def
*src_flushed
= src
;
298 if (!preserve_denorms
) {
299 src_flushed
= nir_bcsel(b
,
300 nir_flt(b
, nir_fabs(b
, src
),
301 nir_imm_double(b
, DBL_MIN
)),
302 nir_imm_double(b
, 0.0),
305 res
= nir_bcsel(b
, nir_ior(b
, nir_feq(b
, src_flushed
, nir_imm_double(b
, 0.0)),
306 nir_feq(b
, src
, nir_imm_double(b
, INFINITY
))),
309 res
= fix_inv_result(b
, res
, src
, new_exp
);
316 lower_trunc(nir_builder
*b
, nir_ssa_def
*src
)
318 nir_ssa_def
*unbiased_exp
= nir_isub(b
, get_exponent(b
, src
),
319 nir_imm_int(b
, 1023));
321 nir_ssa_def
*frac_bits
= nir_isub(b
, nir_imm_int(b
, 52), unbiased_exp
);
324 * Decide the operation to apply depending on the unbiased exponent:
326 * if (unbiased_exp < 0)
328 * else if (unbiased_exp > 52)
331 * return src & (~0 << frac_bits)
333 * Notice that the else branch is a 64-bit integer operation that we need
334 * to implement in terms of 32-bit integer arithmetics (at least until we
335 * support 64-bit integer arithmetics).
338 /* Compute "~0 << frac_bits" in terms of hi/lo 32-bit integer math */
339 nir_ssa_def
*mask_lo
=
341 nir_ige(b
, frac_bits
, nir_imm_int(b
, 32)),
343 nir_ishl(b
, nir_imm_int(b
, ~0), frac_bits
));
345 nir_ssa_def
*mask_hi
=
347 nir_ilt(b
, frac_bits
, nir_imm_int(b
, 33)),
351 nir_isub(b
, frac_bits
, nir_imm_int(b
, 32))));
353 nir_ssa_def
*src_lo
= nir_unpack_64_2x32_split_x(b
, src
);
354 nir_ssa_def
*src_hi
= nir_unpack_64_2x32_split_y(b
, src
);
358 nir_ilt(b
, unbiased_exp
, nir_imm_int(b
, 0)),
359 nir_imm_double(b
, 0.0),
360 nir_bcsel(b
, nir_ige(b
, unbiased_exp
, nir_imm_int(b
, 53)),
362 nir_pack_64_2x32_split(b
,
363 nir_iand(b
, mask_lo
, src_lo
),
364 nir_iand(b
, mask_hi
, src_hi
))));
368 lower_floor(nir_builder
*b
, nir_ssa_def
*src
)
371 * For x >= 0, floor(x) = trunc(x)
373 * - if x is integer, floor(x) = x
374 * - otherwise, floor(x) = trunc(x) - 1
376 nir_ssa_def
*tr
= nir_ftrunc(b
, src
);
377 nir_ssa_def
*positive
= nir_fge(b
, src
, nir_imm_double(b
, 0.0));
379 nir_ior(b
, positive
, nir_feq(b
, src
, tr
)),
381 nir_fsub(b
, tr
, nir_imm_double(b
, 1.0)));
385 lower_ceil(nir_builder
*b
, nir_ssa_def
*src
)
387 /* if x < 0, ceil(x) = trunc(x)
388 * else if (x - trunc(x) == 0), ceil(x) = x
389 * else, ceil(x) = trunc(x) + 1
391 nir_ssa_def
*tr
= nir_ftrunc(b
, src
);
392 nir_ssa_def
*negative
= nir_flt(b
, src
, nir_imm_double(b
, 0.0));
394 nir_ior(b
, negative
, nir_feq(b
, src
, tr
)),
396 nir_fadd(b
, tr
, nir_imm_double(b
, 1.0)));
400 lower_fract(nir_builder
*b
, nir_ssa_def
*src
)
402 return nir_fsub(b
, src
, nir_ffloor(b
, src
));
406 lower_round_even(nir_builder
*b
, nir_ssa_def
*src
)
408 /* Add and subtract 2**52 to round off any fractional bits. */
409 nir_ssa_def
*two52
= nir_imm_double(b
, (double)(1ull << 52));
410 nir_ssa_def
*sign
= nir_iand(b
, nir_unpack_64_2x32_split_y(b
, src
),
411 nir_imm_int(b
, 1ull << 31));
414 nir_ssa_def
*res
= nir_fsub(b
, nir_fadd(b
, nir_fabs(b
, src
), two52
), two52
);
417 return nir_bcsel(b
, nir_flt(b
, nir_fabs(b
, src
), two52
),
418 nir_pack_64_2x32_split(b
, nir_unpack_64_2x32_split_x(b
, res
),
419 nir_ior(b
, nir_unpack_64_2x32_split_y(b
, res
), sign
)), src
);
423 lower_mod(nir_builder
*b
, nir_ssa_def
*src0
, nir_ssa_def
*src1
)
425 /* mod(x,y) = x - y * floor(x/y)
427 * If the division is lowered, it could add some rounding errors that make
428 * floor() to return the quotient minus one when x = N * y. If this is the
429 * case, we return zero because mod(x, y) output value is [0, y).
431 nir_ssa_def
*floor
= nir_ffloor(b
, nir_fdiv(b
, src0
, src1
));
432 nir_ssa_def
*mod
= nir_fsub(b
, src0
, nir_fmul(b
, src1
, floor
));
435 nir_fne(b
, mod
, src1
),
437 nir_imm_double(b
, 0.0));
441 lower_doubles_instr_to_soft(nir_builder
*b
, nir_alu_instr
*instr
,
442 const nir_shader
*softfp64
,
443 nir_lower_doubles_options options
)
445 if (!(options
& nir_lower_fp64_full_software
))
448 assert(instr
->dest
.dest
.is_ssa
);
451 const struct glsl_type
*return_type
= glsl_uint64_t_type();
455 if (instr
->src
[0].src
.ssa
->bit_size
== 64)
456 name
= "__fp64_to_int64";
458 name
= "__fp32_to_int64";
459 return_type
= glsl_int64_t_type();
462 if (instr
->src
[0].src
.ssa
->bit_size
== 64)
463 name
= "__fp64_to_uint64";
465 name
= "__fp32_to_uint64";
468 name
= "__fp32_to_fp64";
471 name
= "__fp64_to_fp32";
472 return_type
= glsl_float_type();
475 name
= "__fp64_to_int";
476 return_type
= glsl_int_type();
479 name
= "__fp64_to_uint";
480 return_type
= glsl_uint_type();
484 name
= "__fp64_to_bool";
485 return_type
= glsl_bool_type();
488 name
= "__bool_to_fp64";
491 if (instr
->src
[0].src
.ssa
->bit_size
!= 64)
493 name
= "__int64_to_fp32";
494 return_type
= glsl_float_type();
497 if (instr
->src
[0].src
.ssa
->bit_size
!= 64)
499 name
= "__uint64_to_fp32";
500 return_type
= glsl_float_type();
503 if (instr
->src
[0].src
.ssa
->bit_size
== 64)
504 name
= "__int64_to_fp64";
506 name
= "__int_to_fp64";
509 if (instr
->src
[0].src
.ssa
->bit_size
== 64)
510 name
= "__uint64_to_fp64";
512 name
= "__uint_to_fp64";
520 case nir_op_fround_even
:
537 return_type
= glsl_bool_type();
541 return_type
= glsl_bool_type();
545 return_type
= glsl_bool_type();
549 return_type
= glsl_bool_type();
573 nir_function
*func
= NULL
;
574 nir_foreach_function(function
, softfp64
) {
575 if (strcmp(function
->name
, name
) == 0) {
580 if (!func
|| !func
->impl
) {
581 fprintf(stderr
, "Cannot find function \"%s\"\n", name
);
585 nir_ssa_def
*params
[4] = { NULL
, };
587 nir_variable
*ret_tmp
=
588 nir_local_variable_create(b
->impl
, return_type
, "return_tmp");
589 nir_deref_instr
*ret_deref
= nir_build_deref_var(b
, ret_tmp
);
590 params
[0] = &ret_deref
->dest
.ssa
;
592 assert(nir_op_infos
[instr
->op
].num_inputs
+ 1 == func
->num_params
);
593 for (unsigned i
= 0; i
< nir_op_infos
[instr
->op
].num_inputs
; i
++) {
594 assert(i
+ 1 < ARRAY_SIZE(params
));
595 params
[i
+ 1] = nir_mov_alu(b
, instr
->src
[i
], 1);
598 nir_inline_function_impl(b
, func
->impl
, params
);
600 return nir_load_deref(b
, ret_deref
);
603 nir_lower_doubles_options
604 nir_lower_doubles_op_to_options_mask(nir_op opcode
)
607 case nir_op_frcp
: return nir_lower_drcp
;
608 case nir_op_fsqrt
: return nir_lower_dsqrt
;
609 case nir_op_frsq
: return nir_lower_drsq
;
610 case nir_op_ftrunc
: return nir_lower_dtrunc
;
611 case nir_op_ffloor
: return nir_lower_dfloor
;
612 case nir_op_fceil
: return nir_lower_dceil
;
613 case nir_op_ffract
: return nir_lower_dfract
;
614 case nir_op_fround_even
: return nir_lower_dround_even
;
615 case nir_op_fmod
: return nir_lower_dmod
;
616 case nir_op_fsub
: return nir_lower_dsub
;
617 case nir_op_fdiv
: return nir_lower_ddiv
;
622 struct lower_doubles_data
{
623 const nir_shader
*softfp64
;
624 nir_lower_doubles_options options
;
628 should_lower_double_instr(const nir_instr
*instr
, const void *_data
)
630 const struct lower_doubles_data
*data
= _data
;
631 const nir_lower_doubles_options options
= data
->options
;
633 if (instr
->type
!= nir_instr_type_alu
)
636 const nir_alu_instr
*alu
= nir_instr_as_alu(instr
);
638 assert(alu
->dest
.dest
.is_ssa
);
639 bool is_64
= alu
->dest
.dest
.ssa
.bit_size
== 64;
641 unsigned num_srcs
= nir_op_infos
[alu
->op
].num_inputs
;
642 for (unsigned i
= 0; i
< num_srcs
; i
++) {
643 is_64
|= (nir_src_bit_size(alu
->src
[i
].src
) == 64);
649 if (options
& nir_lower_fp64_full_software
)
652 return options
& nir_lower_doubles_op_to_options_mask(alu
->op
);
656 lower_doubles_instr(nir_builder
*b
, nir_instr
*instr
, void *_data
)
658 const struct lower_doubles_data
*data
= _data
;
659 const nir_lower_doubles_options options
= data
->options
;
660 nir_alu_instr
*alu
= nir_instr_as_alu(instr
);
662 nir_ssa_def
*soft_def
=
663 lower_doubles_instr_to_soft(b
, alu
, data
->softfp64
, options
);
667 if (!(options
& nir_lower_doubles_op_to_options_mask(alu
->op
)))
670 nir_ssa_def
*src
= nir_mov_alu(b
, alu
->src
[0],
671 alu
->dest
.dest
.ssa
.num_components
);
675 return lower_rcp(b
, src
);
677 return lower_sqrt_rsq(b
, src
, true);
679 return lower_sqrt_rsq(b
, src
, false);
681 return lower_trunc(b
, src
);
683 return lower_floor(b
, src
);
685 return lower_ceil(b
, src
);
687 return lower_fract(b
, src
);
688 case nir_op_fround_even
:
689 return lower_round_even(b
, src
);
694 nir_ssa_def
*src1
= nir_mov_alu(b
, alu
->src
[1],
695 alu
->dest
.dest
.ssa
.num_components
);
698 return nir_fmul(b
, src
, nir_frcp(b
, src1
));
700 return nir_fadd(b
, src
, nir_fneg(b
, src1
));
702 return lower_mod(b
, src
, src1
);
704 unreachable("unhandled opcode");
708 unreachable("unhandled opcode");
713 nir_lower_doubles_impl(nir_function_impl
*impl
,
714 const nir_shader
*softfp64
,
715 nir_lower_doubles_options options
)
717 struct lower_doubles_data data
= {
718 .softfp64
= softfp64
,
723 nir_function_impl_lower_instructions(impl
,
724 should_lower_double_instr
,
728 if (progress
&& (options
& nir_lower_fp64_full_software
)) {
729 /* SSA and register indices are completely messed up now */
730 nir_index_ssa_defs(impl
);
731 nir_index_local_regs(impl
);
733 nir_metadata_preserve(impl
, nir_metadata_none
);
735 /* And we have deref casts we need to clean up thanks to function
738 nir_opt_deref_impl(impl
);
745 nir_lower_doubles(nir_shader
*shader
,
746 const nir_shader
*softfp64
,
747 nir_lower_doubles_options options
)
749 bool progress
= false;
751 nir_foreach_function(function
, shader
) {
752 if (function
->impl
) {
753 progress
|= nir_lower_doubles_impl(function
->impl
, softfp64
, options
);