gallium/auxiliary: Reduce conversions in u_vbuf_get_minmax_index_mapped
authorIcecream95 <ixn@keemail.me>
Wed, 11 Dec 2019 01:22:19 +0000 (14:22 +1300)
committerMarge Bot <eric+marge@anholt.net>
Mon, 16 Dec 2019 22:57:35 +0000 (22:57 +0000)
commit80aca96803a37a7436ff96c0cec4a2643f11ed05
tree0ff26758763ee9a590e5adf3ca37088e864a58e5
parent69ea473eeb91b2c4db26402c3bc2ed5799d26605
gallium/auxiliary: Reduce conversions in u_vbuf_get_minmax_index_mapped

With this patch, GCC generates vectorized code that does the comparisons
without converting the indices to 32-bit first.

This optimization makes the aforementioned function almost twice as fast
for ARM NEON, and should speed up vectorised code on other platforms.

Without vectorisation, the function is still a percent or two faster,
but slightly larger.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3050>
src/gallium/auxiliary/util/u_vbuf.c