summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2018-06-07 11:13:34 -0700
committerDylan Baker <[email protected]>2018-06-13 10:06:54 -0700
commit34bbb24ce7702658cdc4e9d34a650e169716c39e (patch)
tree944fd18980e7aa3a221b0138e477610e1999e80a /meson.build
parente26af221438f77d8b81f956a56bc9e520f28236a (diff)
meson: Add support for ppc assembly/optimizations
v2: - Use -mpower8-vector in compiler test for altivec - rename altivec option to power8 - reword power8 option description to be more clear, originally I had made it a boolean, but replaced it with an auto option. Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build31
1 files changed, 27 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index c78d34098ff..0fab01fe530 100644
--- a/meson.build
+++ b/meson.build
@@ -605,13 +605,34 @@ if with_gallium_st_nine
endif
endif
+if get_option('power8') != 'false'
+ if host_machine.cpu_family() == 'ppc64le'
+ 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', '-mpower8-vector']
+ elif get_option('power8') == 'true'
+ error('POWER8 intrinsic support required but not found.')
+ endif
+ endif
+endif
+
_opencl = get_option('gallium-opencl')
if _opencl != 'disabled'
if not with_gallium
error('OpenCL Clover implementation requires at least one gallium driver.')
endif
- # TODO: alitvec?
dep_clc = dependency('libclc')
with_gallium_opencl = true
with_opencl_icd = _opencl == 'icd'
@@ -839,8 +860,6 @@ if not cc.links('''#include <stdint.h>
pre_args += '-DMISSING_64_BIT_ATOMICS'
endif
-# TODO: endian
-# TODO: powr8
# TODO: shared/static? Is this even worth doing?
# When cross compiling we generally need to turn off the use of assembly,
@@ -870,7 +889,6 @@ endif
with_asm_arch = ''
if with_asm
- # TODO: SPARC and PPC
if host_machine.cpu_family() == 'x86'
if system_has_kms_drm
with_asm_arch = 'x86'
@@ -901,6 +919,11 @@ if with_asm
with_asm_arch = 'sparc'
pre_args += ['-DUSE_SPARC_ASM']
endif
+ elif host_machine.cpu_family() == 'ppc64le'
+ if system_has_kms_drm
+ with_asm_arch = 'ppc64le'
+ pre_args += ['-DUSE_PPC64LE_ASM']
+ endif
endif
endif