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:
@@ -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)))
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user