Package: liboil Version: 0.3.17-2 Severity: wishlist Tags: patch sid User: [email protected] Usertags: powerpcspe
On powerpcspe it fails to build because it always tries to use AltiVec, even if it is not available. I attached two patches which compile and use AltiVec only if AltiVec is available. I haven't build tested it on powerpc with AltiVec due to lack of hardware atm. It should work :) I also redid autofiles where I changed them. Sebastian
>From 256665165e89411785623e97d04f149991bf11a6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <[email protected]> Date: Tue, 10 Aug 2010 12:04:30 +0200 Subject: [PATCH] don't use AltiVec/Floating point if it is not available on powerpc-linux-gnuspe there is no support for AlitVec at all. In fact AltiVec opcodes share the same opcode range as some Embedded Floating Point (EFP). Floating point is available in hardware however it uses the earlier mentioned EFP instead of the "classic FPU". On this target, gcc can't produce AltiVec code. Classic floating is also unavailable. gcc defines __SPE__ on targets where the EFP extension is used for floating point. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> --- liboil/Makefile.am | 8 ++++++-- liboil/liboilcpu-powerpc.c | 4 ++++ liboil/powerpc/abs.c | 5 +++-- liboil/powerpc/copy.c | 4 ++-- liboil/powerpc/mix.c | 4 ++-- liboil/powerpc/multsum.c | 6 ++---- liboil/powerpc/resample.c | 5 ++--- liboil/powerpc/sad8x8.c | 5 ++--- liboil/powerpc/splat.c | 3 ++- liboil/powerpc/zigzag8x8.c | 5 ++--- liboil/powerpc_asm_blocks/fdct8x8theora_altivec.c | 2 ++ liboil/powerpc_asm_blocks/recon8x8_altivec.c | 2 ++ 12 files changed, 31 insertions(+), 22 deletions(-) diff --git a/liboil/Makefile.am b/liboil/Makefile.am index 84a61ae..046c746 100644 --- a/liboil/Makefile.am +++ b/liboil/Makefile.am @@ -37,8 +37,12 @@ endif if HAVE_POWERPC if HAVE_GCC_ASM -SUBDIRS += powerpc motovec -libs += powerpc/libpowerpc.la motovec/libmotovec.la +SUBDIRS += powerpc +libs += powerpc/libpowerpc.la +if HAVE_ALTIVEC_INTRINSICS +SUBDIRS += motovec +libs += motovec/libmotovec.la +endif # motovec doesn't compile on snow leopard, and isn't useful elsewhere #SUBDIRS += motovec diff --git a/liboil/liboilcpu-powerpc.c b/liboil/liboilcpu-powerpc.c index 8bbc72d..e9f3a28 100644 --- a/liboil/liboilcpu-powerpc.c +++ b/liboil/liboilcpu-powerpc.c @@ -132,6 +132,7 @@ oil_check_altivec_sysctl_darwin (void) #endif #if defined(__linux__) +#ifndef defined(__SPE__) static void oil_check_altivec_proc_auxv (void) { @@ -180,6 +181,7 @@ out: } } #endif +#endif #if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__) static void @@ -204,7 +206,9 @@ oil_cpu_detect_arch(void) #elif defined(__APPLE__) oil_check_altivec_sysctl_darwin(); #elif defined(__linux__) +#ifndef defined(__SPE__) oil_check_altivec_proc_auxv(); +#endif #else oil_check_altivec_fault(); #endif diff --git a/liboil/powerpc/abs.c b/liboil/powerpc/abs.c index 67b2ef8..83b20e6 100644 --- a/liboil/powerpc/abs.c +++ b/liboil/powerpc/abs.c @@ -32,8 +32,9 @@ #include <liboil/liboilfunction.h> #include <liboil/simdpack/simdpack.h> -#define ABS(x) ((x)>0 ? (x) : -(x)) +#ifndef __SPE__ +#define ABS(x) ((x)>0 ? (x) : -(x)) #ifdef ENABLE_BROKEN_IMPLS static void abs_u16_s16_a16_altivec (uint16_t * dest, int dstr, int16_t * src, int sstr, @@ -62,4 +63,4 @@ abs_u16_s16_a16_altivec (uint16_t * dest, int dstr, int16_t * src, int sstr, OIL_DEFINE_IMPL_FULL (abs_u16_s16_a16_altivec, abs_u16_s16, OIL_IMPL_FLAG_ALTIVEC); #endif - +#endif diff --git a/liboil/powerpc/copy.c b/liboil/powerpc/copy.c index ba9d9ce..795ec6b 100644 --- a/liboil/powerpc/copy.c +++ b/liboil/powerpc/copy.c @@ -32,6 +32,7 @@ #include <liboil/liboilfunction.h> #include <liboil/liboilfunction.h> +#ifndef __SPE__ OIL_DECLARE_CLASS(copy_u8); static void @@ -141,5 +142,4 @@ copy_u8_altivec2 (uint8_t *dest, uint8_t *src, int n) } } OIL_DEFINE_IMPL_FULL (copy_u8_altivec2, copy_u8, OIL_IMPL_FLAG_ALTIVEC); - - +#endif diff --git a/liboil/powerpc/mix.c b/liboil/powerpc/mix.c index 4c5b55b..52c4f5c 100644 --- a/liboil/powerpc/mix.c +++ b/liboil/powerpc/mix.c @@ -33,7 +33,7 @@ #include <liboil/simdpack/simdpack.h> #include <math.h> - +#ifndef __SPE__ #ifdef ENABLE_BROKEN_IMPLS static void mix_u8_a16_altivec(uint8_t *dest, uint8_t *src1, uint8_t *src2, uint8_t *scale, int n) { @@ -81,4 +81,4 @@ static void mix_u8_a16_altivec(uint8_t *dest, uint8_t *src1, uint8_t *src2, uint } OIL_DEFINE_IMPL_FULL (mix_u8_a16_altivec, mix_u8, OIL_IMPL_FLAG_ALTIVEC); #endif - +#endif diff --git a/liboil/powerpc/multsum.c b/liboil/powerpc/multsum.c index b649209..1598be6 100644 --- a/liboil/powerpc/multsum.c +++ b/liboil/powerpc/multsum.c @@ -33,7 +33,7 @@ #include <liboil/simdpack/simdpack.h> #include <math.h> - +#ifdef HAVE_GCC_ASM_POWERPC_FPU #ifdef ENABLE_BROKEN_IMPLS /* This could probably be improved by unrolling */ static void multsum_f32_ppcasm(float *dest, float *src1, int sstr1, @@ -56,6 +56,4 @@ static void multsum_f32_ppcasm(float *dest, float *src1, int sstr1, } OIL_DEFINE_IMPL_ASM (multsum_f32_ppcasm, multsum_f32); #endif - - - +#endif diff --git a/liboil/powerpc/resample.c b/liboil/powerpc/resample.c index eef688a..f3caaa6 100644 --- a/liboil/powerpc/resample.c +++ b/liboil/powerpc/resample.c @@ -33,7 +33,7 @@ #include <liboil/liboilfunction.h> #include <liboil/liboiltest.h> - +#ifndef __SPE__ OIL_DECLARE_CLASS (merge_linear_argb); #define ALIGN_UP(ptr,boundary) ((void *)(((unsigned long)ptr + boundary-1) & (~(boundary-1)))) @@ -94,5 +94,4 @@ merge_linear_argb_powerpc (uint32_t *dest, uint32_t *src1, uint32_t *src2, } } OIL_DEFINE_IMPL_FULL (merge_linear_argb_powerpc, merge_linear_argb, OIL_IMPL_FLAG_ALTIVEC); - - +#endif diff --git a/liboil/powerpc/sad8x8.c b/liboil/powerpc/sad8x8.c index 8bde530..60038ec 100644 --- a/liboil/powerpc/sad8x8.c +++ b/liboil/powerpc/sad8x8.c @@ -33,7 +33,7 @@ #include <liboil/simdpack/simdpack.h> #include <math.h> - +#ifndef __SPE__ #if 0 static void sad8x8_s16_a16_altivec (uint32_t *dest, int16_t *src1, int16_t *src2, int s1str, int s2str) @@ -183,5 +183,4 @@ sad8x8_s16_l15_a16_altivec(uint32_t *dest, int16_t *src1, int16_t *src2, int s1s *dest = x[3]; } #endif - - +#endif diff --git a/liboil/powerpc/splat.c b/liboil/powerpc/splat.c index e33b928..0772ec4 100644 --- a/liboil/powerpc/splat.c +++ b/liboil/powerpc/splat.c @@ -32,6 +32,7 @@ #include <liboil/liboilfunction.h> #include <liboil/liboilfunction.h> +#ifndef __SPE__ OIL_DECLARE_CLASS(splat_u8_ns); OIL_DECLARE_CLASS(splat_u32_ns); @@ -141,4 +142,4 @@ splat_u32_ns_altivec (uint32_t *dest, uint32_t *src, int n) } } OIL_DEFINE_IMPL_FULL (splat_u32_ns_altivec, splat_u32_ns, OIL_IMPL_FLAG_ALTIVEC); - +#endif diff --git a/liboil/powerpc/zigzag8x8.c b/liboil/powerpc/zigzag8x8.c index 4b5c058..cf303af 100644 --- a/liboil/powerpc/zigzag8x8.c +++ b/liboil/powerpc/zigzag8x8.c @@ -31,7 +31,7 @@ #include <liboil/liboil.h> - +#ifndef __SPE__ /* Derivation: * zigzag_order in zigzag8z8_c.c is defined in terms of where the * elements are moving from. We rewrite the matrix in terms of @@ -191,5 +191,4 @@ zigzag8x8_s16_a16_altivec(int16_t *dest, int dstr, int16_t *src, int sstr) } OIL_DEFINE_IMPL_FULL (zigzag8x8_s16_altivec, zigzag8x8_s16, OIL_FLAG_ALTIVEC); #endif - - +#endif diff --git a/liboil/powerpc_asm_blocks/fdct8x8theora_altivec.c b/liboil/powerpc_asm_blocks/fdct8x8theora_altivec.c index e02f85f..9d5e07b 100644 --- a/liboil/powerpc_asm_blocks/fdct8x8theora_altivec.c +++ b/liboil/powerpc_asm_blocks/fdct8x8theora_altivec.c @@ -51,6 +51,7 @@ #include <liboil/dct/dct.h> #include <math.h> +#ifndef __SPE__ extern vector signed short idctConst; extern vector unsigned char vPerm1; extern vector unsigned char vPerm2; @@ -520,3 +521,4 @@ fdct8x8theora_altivec(int16_t *src, int16_t *dest) } OIL_DEFINE_IMPL_REF (fdct8x8theora_altivec, fdct8x8theora, OIL_IMPL_FLAG_ALTIVEC); +#endif diff --git a/liboil/powerpc_asm_blocks/recon8x8_altivec.c b/liboil/powerpc_asm_blocks/recon8x8_altivec.c index 1d85b2a..5c501de 100644 --- a/liboil/powerpc_asm_blocks/recon8x8_altivec.c +++ b/liboil/powerpc_asm_blocks/recon8x8_altivec.c @@ -36,6 +36,7 @@ #include <liboil/liboilfunction.h> #include <liboil/simdpack/simdpack.h> +#ifndef __SPE__ OIL_DECLARE_CLASS (recon8x8_intra); OIL_DECLARE_CLASS (recon8x8_inter); OIL_DECLARE_CLASS (recon8x8_inter2); @@ -714,3 +715,4 @@ recon8x8_inter2_altivec (uint8_t *dest, uint8_t *s1, uint8_t *s2, int16_t *chang } OIL_DEFINE_IMPL_FULL (recon8x8_inter2_altivec, recon8x8_inter2, OIL_IMPL_FLAG_ALTIVEC); +#endif -- 1.5.6.5
>From a54cf17e5070c81ea7619104a09453612daa981e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <[email protected]> Date: Tue, 10 Aug 2010 12:13:29 +0200 Subject: [PATCH] autogen makefile Signed-off-by: Sebastian Andrzej Siewior <[email protected]> --- liboil/Makefile.in | 54 ++++++++++++++++++++++++++------------------------- 1 files changed, 28 insertions(+), 26 deletions(-) diff --git a/liboil/Makefile.in b/liboil/Makefile.in index fa44d9f..5fbe888 100644 --- a/liboil/Makefile.in +++ b/liboil/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -45,31 +45,33 @@ host_triplet = @host@ #libs_i386 += 3dnow/lib3dnow.la @HAVE_AMD64_TRUE@@have_gcc_asm_t...@am__append_7 = amd64 i386_amd64 @HAVE_AMD64_TRUE@@have_gcc_asm_t...@am__append_8 = amd64/libamd64.la i386_amd64/libi386_amd64.la -...@have_gcc_asm_true@@have_powerpc_t...@am__append_9 = powerpc motovec -...@have_gcc_asm_true@@have_powerpc_t...@am__append_10 = powerpc/libpowerpc.la motovec/libmotovec.la +...@have_gcc_asm_true@@have_powerpc_t...@am__append_9 = powerpc +...@have_gcc_asm_true@@have_powerpc_t...@am__append_10 = powerpc/libpowerpc.la +...@have_altivec_intrinsics_true@@HAVE_GCC_ASM_TRUE@@have_powerpc_t...@am__append_11 = motovec +...@have_altivec_intrinsics_true@@HAVE_GCC_ASM_TRUE@@have_powerpc_t...@am__append_12 = motovec/libmotovec.la # motovec doesn't compile on snow leopard, and isn't useful elsewhere #SUBDIRS += motovec #libs += motovec/libmotovec.la -...@have_asm_blocks_true@@HAVE_GCC_ASM_TRUE@@have_powerpc_t...@am__append_11 = powerpc_asm_blocks -...@have_asm_blocks_true@@HAVE_GCC_ASM_TRUE@@have_powerpc_t...@am__append_12 = powerpc/libpowerpc_asm_blocks.la -...@have_arm_true@@have_gcc_asm_t...@am__append_13 = arm -...@have_arm_true@@have_gcc_asm_t...@am__append_14 = arm/libarm.la -...@use_new_abi_true@am__append_15 = libo...@[email protected] +...@have_asm_blocks_true@@HAVE_GCC_ASM_TRUE@@have_powerpc_t...@am__append_13 = powerpc_asm_blocks +...@have_asm_blocks_true@@HAVE_GCC_ASM_TRUE@@have_powerpc_t...@am__append_14 = powerpc/libpowerpc_asm_blocks.la +...@have_arm_true@@have_gcc_asm_t...@am__append_15 = arm +...@have_arm_true@@have_gcc_asm_t...@am__append_16 = arm/libarm.la +...@use_new_abi_true@am__append_17 = libo...@[email protected] noinst_PROGRAMS = build_prototypes$(EXEEXT) \ build_prototypes_doc$(EXEEXT) build_marshal$(EXEEXT) \ build_class_decls$(EXEEXT) build_trampolines$(EXEEXT) \ build_prototypes_04$(EXEEXT) -...@use_new_abi_false@am__append_16 = \ +...@use_new_abi_false@am__append_18 = \ @USE_NEW_ABI_FALSE@ conv/libconv.la \ @USE_NEW_ABI_FALSE@ deprecated/libdeprecated.la -...@have_i386_true@am__append_17 = liboilcpu-x86.c -...@have_amd64_true@@have_i386_fa...@am__append_18 = liboilcpu-x86.c -...@have_amd64_false@@HAVE_I386_FALSE@@have_powerpc_t...@am__append_19 = liboilcpu-powerpc.c -...@have_amd64_false@@HAVE_ARM_TRUE@@HAVE_I386_FALSE@@have_powerpc_fa...@am__append_20 = liboilcpu-arm.c -...@have_amd64_false@@HAVE_ARM_FALSE@@HAVE_I386_FALSE@@have_powerpc_fa...@am__append_21 = liboilcpu-misc.c -...@use_new_abi_true@am__append_22 = \ +...@have_i386_true@am__append_19 = liboilcpu-x86.c +...@have_amd64_true@@have_i386_fa...@am__append_20 = liboilcpu-x86.c +...@have_amd64_false@@HAVE_I386_FALSE@@have_powerpc_t...@am__append_21 = liboilcpu-powerpc.c +...@have_amd64_false@@HAVE_ARM_TRUE@@HAVE_I386_FALSE@@have_powerpc_fa...@am__append_22 = liboilcpu-arm.c +...@have_amd64_false@@HAVE_ARM_FALSE@@HAVE_I386_FALSE@@have_powerpc_fa...@am__append_23 = liboilcpu-misc.c +...@use_new_abi_true@am__append_24 = \ @USE_NEW_ABI_TRUE@ liboiltrampolines.c subdir = liboil @@ -173,7 +175,7 @@ liboilfunctions_la_DEPENDENCIES = c/lib_c.la \ colorspace/libcolorspace.la copy/libcopy.la dct/libdct.la \ $(libs) jpeg/libjpeg.la math/libmath.la md5/libmd5.la \ ref/libref.la simdpack/libsimdpack.la utf8/libutf8.la \ - $(am__append_16) + $(am__append_18) am_liboilfunctions_la_OBJECTS = liboilfunctions_la-null.lo liboilfunctions_la_OBJECTS = $(am_liboilfunctions_la_OBJECTS) liboilfunctions_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -431,7 +433,6 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -441,11 +442,12 @@ DIST_SUBDIRS = amd64 3dnow c colorspace conv copy dct fb i386 i386_amd64 jpeg ma SUBDIRS = c colorspace conv copy dct jpeg math md5 ref simdpack utf8 \ deprecated $(am__append_1) $(am__append_3) $(am__append_5) \ $(am__append_7) $(am__append_9) $(am__append_11) \ - $(am__append_13) + $(am__append_13) $(am__append_15) EXTRA_DIST = README libs = $(am__append_2) $(am__append_4) $(am__append_6) $(am__append_8) \ - $(am__append_10) $(am__append_12) $(am__append_14) -lib_LTLIBRARIES = libo...@[email protected] $(am__append_15) + $(am__append_10) $(am__append_12) $(am__append_14) \ + $(am__append_16) +lib_LTLIBRARIES = libo...@[email protected] $(am__append_17) buildnoinstdir = $(libdir) buildnoinst_LTLIBRARIES = liboiltmp1.la noinst_LTLIBRARIES = liboilfunctions.la @@ -466,7 +468,7 @@ liboilfunctions_la_CFLAGS = $(LIBOIL_CFLAGS) liboilfunctions_la_LIBADD = c/lib_c.la colorspace/libcolorspace.la \ copy/libcopy.la dct/libdct.la $(libs) jpeg/libjpeg.la \ math/libmath.la md5/libmd5.la ref/libref.la \ - simdpack/libsimdpack.la utf8/libutf8.la $(am__append_16) + simdpack/libsimdpack.la utf8/libutf8.la $(am__append_18) liboilfunctions_la_LDFLAGS = \ -no-undefined @@ -486,9 +488,9 @@ libo...@liboil_majorminor@_la_SOURCES = liboil.h liboilcolorspace.h \ liboilfault.h liboilfuncs.h liboilfunction.c liboilfunction.h \ liboilmarshal.c liboilprofile.c liboilprofile.h \ liboilprototype.c liboilrandom.c liboiltest.c liboiltest.h \ - liboiltypes.h liboilutils.c liboilutils.h $(am__append_17) \ - $(am__append_18) $(am__append_19) $(am__append_20) \ - $(am__append_21) $(am__append_22) + liboiltypes.h liboilutils.c liboilutils.h $(am__append_19) \ + $(am__append_20) $(am__append_21) $(am__append_22) \ + $(am__append_23) $(am__append_24) nodist_libo...@liboil_majorminor@_la_SOURCES = \ liboilarray.c @@ -976,7 +978,7 @@ uninstall-pkgincludeHEADERS: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -1001,7 +1003,7 @@ $(RECURSIVE_TARGETS): fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ -- 1.5.6.5

