[Liboil] liboil issue with float point cross compile?
cyphunk at gmail.com
Mon Dec 5 13:49:24 PST 2005
Stephane Fillod wrote:
> On Sat, Dec 03, 2005 at 06:20:46PM +0200, Nathan Fain wrote:
>> I've searched around both on the mailing list and and internet and couldn't find clues for the following problem. I am compiling liboil using a powerpc cross compiler and get this error:
>> powerpc-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -Wa,-mregnames
>> -D_BSD_SOURCE -D_GNU_SOURCE -I../.. -O2 -g -O2 -MT libpowerpc_la-conv.lo
>> -MD -MP -MF .deps/libpowerpc_la-conv.Tpo -c conv.c -fPIC -DPIC -o
>> conv.c: In function `clipconv_s8_f32_powerpc':
>> conv.c:89: error: can't find a register in class `FLOAT_REGS' while
>> reloading `asm'
>> make: *** [libpowerpc_la-conv.lo] Error 1
>> make: Leaving directory `/build/liboil-0.3.6/liboil/powerpc'
>> configure line was:
>> ./configure --host=powerpc-linux
>> specifically this is for a powerpc 405 with light float point capabilities.
>> Anyone have ideas? Where can I read more about the meaning of FLOAT_REGS?
> 405GP PowerPC has no FPU, not even light. Compilers generally use soft emulation.
> BTW, the problem will be the same for some PowerPC's from Freescale which don't
> have a traditional FPU, e.g. SPE, ..
> To fix this problem, a check along what is done in m4/as-intrinsics.m4
> should be done on powerpc-* systems to check if "lfd"/etc. assembly
> instructions are available. Then with some autoconf magic and a define
> like HAVE_PPC_FPU_INSTRUCTIONS, conditionaly compile conv.c.
> Another solution is to find an option for soft-float gcc to make it
> accept hard FPU instructions. Then, with a new OIL_IMPL_FLAG_PPC_FPU,
> enable or disable implementation using powerprc fpu instructions.
> Any other ideas?
I didn't see anything related to powerpc in the m4/as-intrinsics.m4
other than the Altivec tests:
[__vector a; a = vec_or(a,a)],
Or were you suggesting I manually add a test in as-intrinsics.m4 for
lfd,lfs and skip (fail?) if not?
Wait, I suppose this was a suggestion for David and not me as I see now
that the current CVS repository shows the HAVE_GCC_ASM_POWERPC_FPU
option (... I was wondering why nothing turned up on google ;)).
First, note that the ./configure test for HAVE_GCC_ASM_POWERPC_FPU
evaluates to "yes":
"checking if compiler supports FPU instructions on PowerPC... yes"
Second, I tried to compile the CVS version and I run into a different
problem before getting to the conv.c issue:
powerpc-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -Werror
-Wa,-mregnames -D_BSD_SOURCE -D_GNU_SOURCE -I../.. -O2 -g -O2 -MT
lib_c_la-swab.lo -MD -MP -MF .deps/lib_c_la-swab.Tpo -c swab.c -fPIC
-DPIC -o .libs/lib_c_la-swab.o
swab.c: In function `swab_u32_asm':
swab.c:177: error: unknown register name `eax' in `asm'
make: *** [lib_c_la-swab.lo] Error 1
make: Leaving directory `/build/liboil-cvs/liboil/liboil/c'
Does it think I'm on an x86 platform? The ./configure evaluates "true"
for Altivec and false for the other intrinsic tests.
I do not know if it matters but the powerpc-linux-gcc was compiled with
the --with-float=soft option.
More information about the Liboil