diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2021-04-28 15:34:13 -0700 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-05-04 00:13:34 +0000 |
commit | 61624934f6916e1c2381a998097e0dd03fcdbe78 (patch) | |
tree | f1527a611f6ac8a43b7d3fe6c2ad4fc23c3c065f /src/gallium | |
parent | aaeff52bbe75f49f5a94eea8b777659f3ec4d555 (diff) |
gallivm: Use GALLIVM_NAN_RETURN_OTHER_SECOND_NONNAN for norm clamping
Since the second source is always a constant that is known to be a
number, this should have the same performance as
GALLIVM_NAN_BEHAVIOR_UNDEFINED.
A lofty goal is to eventually remove GALLIVM_NAN_BEHAVIOR_UNDEFINED.
There's still a lot of (mostly implicit) users, and I don't feel like
tackling that right now. :)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10532>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_arit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index cdbe52c8603..a3152c242a4 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -524,7 +524,7 @@ lp_build_add(struct lp_build_context *bld, /* clamp to ceiling of 1.0 */ if(bld->type.norm && (bld->type.floating || bld->type.fixed)) - res = lp_build_min_simple(bld, res, bld->one, GALLIVM_NAN_BEHAVIOR_UNDEFINED); + res = lp_build_min_simple(bld, res, bld->one, GALLIVM_NAN_RETURN_OTHER_SECOND_NONNAN); if (type.norm && !type.floating && !type.fixed) { if (!type.sign) { @@ -859,7 +859,7 @@ lp_build_sub(struct lp_build_context *bld, res = LLVMBuildSub(builder, a, b, ""); if(bld->type.norm && (bld->type.floating || bld->type.fixed)) - res = lp_build_max_simple(bld, res, bld->zero, GALLIVM_NAN_BEHAVIOR_UNDEFINED); + res = lp_build_max_simple(bld, res, bld->zero, GALLIVM_NAN_RETURN_OTHER_SECOND_NONNAN); return res; } |