meson: Simplify the power8 optimization logic

If it compiles, it works. And there's not a particularly good reason to
disable it, so don't let people disable it.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34239>
This commit is contained in:
Adam Jackson
2025-03-27 09:28:21 -04:00
committed by Marge Bot
parent 3122df666e
commit c4b305079d
2 changed files with 14 additions and 22 deletions

View File

@@ -721,27 +721,18 @@ if with_gallium_st_d3d10umd
error('The d3d10umd state tracker requires gallium softpipe/llvmpipe.')
endif
endif
_power8 = get_option('power8')
if _power8.allowed()
if host_machine.cpu_family() == 'ppc64' and host_machine.endian() == 'little'
if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.8')
error('Altivec is not supported with gcc version < 4.8.')
endif
if cc.compiles('''
#include <altivec.h>
int main() {
vector unsigned char r;
vector unsigned int v = vec_splat_u32 (1);
r = __builtin_vec_vgbbd ((vector unsigned char) v);
return 0;
}''',
args : '-mpower8-vector',
name : 'POWER8 intrinsics')
pre_args += ['-D_ARCH_PWR8']
c_cpp_args += '-mpower8-vector'
elif _power8.enabled()
error('POWER8 intrinsic support required but not found.')
endif
if host_machine.cpu_family() == 'ppc64' and host_machine.endian() == 'little'
if cc.compiles('''
#include <altivec.h>
int main() {
vector unsigned char r;
vector unsigned int v = vec_splat_u32 (1);
r = __builtin_vec_vgbbd ((vector unsigned char) v);
return 0;
}''',
name : 'POWER8 intrinsics')
pre_args += ['-D_ARCH_PWR8']
endif
endif

View File

@@ -547,7 +547,8 @@ option(
'power8',
type : 'feature',
deprecated: {'true': 'enabled', 'false': 'disabled'},
description : 'Enable power8 optimizations.',
description : 'Does nothing, left here for a while to avoid build breakages.',
deprecated: true,
)
option(