llvmpipe: LLVM v2f32 trunc/floor/ceil/nearbyint generates optimal x86 code since at least version 8

Based on the tests committed here:
https://github.com/llvm/llvm-project/commit/f9afee479fb6a626445a58c32c8998963dc4968b

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32964>
This commit is contained in:
Aleksi Sapon
2025-01-09 16:23:56 -05:00
committed by Marge Bot
parent 0b2664635f
commit f4eb6fde8f
2 changed files with 7 additions and 5 deletions
+4 -3
View File
@@ -1861,9 +1861,10 @@ static bool
arch_rounding_available(const struct lp_type type)
{
if ((util_get_cpu_caps()->has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) ||
(util_get_cpu_caps()->has_avx && type.width*type.length == 256) ||
(util_get_cpu_caps()->has_avx512f && type.width*type.length == 512))
(type.length == 1 || (LLVM_VERSION_MAJOR >= 8 && type.length == 2) ||
type.width * type.length == 128)) ||
(util_get_cpu_caps()->has_avx && type.width * type.length == 256) ||
(util_get_cpu_caps()->has_avx512f && type.width * type.length == 512))
return true;
else if ((util_get_cpu_caps()->has_altivec &&
(type.width == 32 && type.length == 4)))
+3 -2
View File
@@ -477,9 +477,10 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
continue;
}
if (!util_get_cpu_caps()->has_neon &&
if (test->ref == &nearbyintf && length == 2 &&
!util_get_cpu_caps()->has_neon &&
util_get_cpu_caps()->family != CPU_S390X &&
test->ref == &nearbyintf && length == 2 &&
!(util_get_cpu_caps()->has_sse4_1 && LLVM_VERSION_MAJOR >= 8) &&
ref != roundf(testval)) {
/* FIXME: The generic (non SSE) path in lp_build_iround, which is
* always taken for length==2 regardless of native round support,