mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-31 02:40:25 +01:00
gallivm: Use llvm.roundeven in lp_build_round()
`lp_build_round` intends to implement round with ties-to-even behavior, as can be seen by its test's use of `nearbyint` to generate reference values and by it use in implementing `nir_op_fround_even`. Fixes:0d3b285360("gallivm: use llvm intrinsics for 16-bit round/trunc/roundeven") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34937> (cherry picked from commiteea3ed6a37)
This commit is contained in:
parent
dda7d88800
commit
4bd75f552c
3 changed files with 3 additions and 9 deletions
|
|
@ -284,7 +284,7 @@
|
|||
"description": "gallivm: Use `llvm.roundeven` in lp_build_round()",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "0d3b2853600cf6934a3a09deaf435944d18d833a",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -2120,7 +2120,7 @@ lp_build_round(struct lp_build_context *bld,
|
|||
|
||||
if (type.width == 16) {
|
||||
char intrinsic[64];
|
||||
lp_format_intrinsic(intrinsic, 64, "llvm.round", bld->vec_type);
|
||||
lp_format_intrinsic(intrinsic, 64, "llvm.roundeven", bld->vec_type);
|
||||
return lp_build_intrinsic_unary(builder, intrinsic, bld->vec_type, a);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3343,13 +3343,7 @@ do_alu_action(struct lp_build_nir_soa_context *bld,
|
|||
result = lp_build_rcp(float_bld, src[0]);
|
||||
break;
|
||||
case nir_op_fround_even:
|
||||
if (src_bit_size[0] == 16) {
|
||||
char intrinsic[64];
|
||||
lp_format_intrinsic(intrinsic, 64, "llvm.roundeven", float_bld->vec_type);
|
||||
result = lp_build_intrinsic_unary(builder, intrinsic, float_bld->vec_type, src[0]);
|
||||
} else {
|
||||
result = lp_build_round(float_bld, src[0]);
|
||||
}
|
||||
result = lp_build_round(float_bld, src[0]);
|
||||
break;
|
||||
case nir_op_frsq:
|
||||
result = lp_build_rsqrt(float_bld, src[0]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue