This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] glibc-2.4/2.5 update for MIPS and ARM glibc with NPTL and ports.


Hello Martin,
Here is part of __longjmp functions:
  ...
  register int val asm ("a1");

#ifdef __mips_hard_float
  /* Pull back the floating point callee-saved registers.  */
  asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0]));
  asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1]));

 ....
#endif
  ...

So only way that this float instruction is emitted is if mips_hard_float is
defined. Here is crosstool's log for this file:

mips-linux-gnu-gcc  -mabi=32 ../ports/sysdeps/mips/__longjmp.c -c -std=gnu99 -O2
-Wall -Winline -Wwrite-strings -finline-limit=10000 -fmerge-all-constants
-Wstrict-prototypes      -I../include
-I/home/davidovic/glibc/crosstool-0.43/build/mips-linux-gnu/gcc-4.2-20070307-gli
bc-2.5/build-glibc/setjmp
-I/home/davidovic/glibc/crosstool-0.43/build/mips-linux-gnu/gcc-4.2-20070307-gli
bc-2.5/build-glibc -I../ports/sysdeps/mips/elf
-I../ports/sysdeps/unix/sysv/linux/mips/mips32
-I../ports/sysdeps/unix/sysv/linux/mips/nptl
-I../ports/sysdeps/unix/sysv/linux/mips -I../nptl/sysdeps/unix/sysv/linux
-I../nptl/sysdeps/pthread -I../sysdeps/pthread
-I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu
-I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet
-I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv
-I../ports/sysdeps/unix/mips/mips32 -I../ports/sysdeps/unix/mips
-I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix
-I../sysdeps/posix -I../ports/sysdeps/mips/mips32 -I../ports/sysdeps/mips
-I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/wordsize-32
-I../ports/sysdeps/mips/nptl -I../sysdeps/ieee754 -I../sysdeps/generic/elf
-I../sysdeps/generic -I../nptl -I../ports  -I.. -I../libio -I. -nostdinc
-isystem /usr/llocal/mips-glibc/lib/gcc/mips-linux-gnu/4.2.0/include -isystem
/usr/llocal/mips-glibc/mips-linux-gnu/include -D_LIBC_REENTRANT -include
../include/libc-symbols.h  -DPIC     -o
/home/davidovic/glibc/crosstool-0.43/build/mips-linux-gnu/gcc-4.2-20070307-glibc
-2.5/build-glibc/setjmp/__longjmp.o -MD -MP -MF
/home/davidovic/glibc/crosstool-0.43/build/mips-linux-gnu/gcc-4.2-20070307-glibc
-2.5/build-glibc/setjmp/__longjmp.o.dt -MT
/home/davidovic/glibc/crosstool-0.43/build/mips-linux-gnu/gcc-4.2-20070307-glibc
-2.5/build-glibc/setjmp/__longjmp.o

It seems that __mips_hard_float is defined even if we configure gcc with
--with-float=soft. Is it expected behavioure?

I take look in glibc 2.3.5 and 2.3.6 function does not have any defines for
this. As You already mention on mailing list exists patch for this (by Mr. Matej
Kupljen) and he used next construction (it seems that somehow ignore
--with-float=soft?): 
...
+#ifndef __mips_soft_float
   /* Pull back the floating point callee-saved registers.  */
   asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0]));
   asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1]));
...

So if I understood correctly, we could have 3 aproach:
- build glibc with -msoft-float (I look in .S files and there is no float
instructions inide), unfortunately I do not know how to pass this flag
- change to define __mips_soft_float if we build gcc with --with-float=soft
- change __longjmp.c and setjmp_aux.c to use #ifndef __mips_soft_float 

For 2 I am not sure is this feasible or is it good approach. But 1 or 3 options
look quite ok. What is your feeling about all this?


I know that floating point emulator in Linux kernel work, but I want to have
soft float toolchain.

Thanks is advice 
Mile



> -----Original Message-----
> From: crossgcc-owner@sourceware.org [mailto:crossgcc-owner@sourceware.org]
> On Behalf Of Martin Guy
> Sent: Wednesday, May 23, 2007 3:20 PM
> To: Mile Davidovic
> Cc: Steven J. Hill; crossgcc@sourceware.org
> Subject: Re: [PATCH] glibc-2.4/2.5 update for MIPS and ARM glibc with NPTL
> and ports.
> 
> 2007/5/21, Mile Davidovic <Mile.Davidovic@micronasnit.com>:
> > I tried to build mips based toolchain with Your patch and I tried and it
> works
> > fine except that I always got next message:
> > Algorithmics/MIPS FPU Emulator v1.5 which is caused by (I believe)
> executing
> > float instructions on float-less cpu.
> 
> I think this treats the same issue:
> http://sourceware.org/ml/crossgcc/2005-09/msg00064.html
> It seems there are explciit assembly instructions in that file.
> 
>    M
> 
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]