public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* soft-float support
@ 2002-10-08 14:42 Graeme Peterson
  2002-10-08 15:37 ` Andrew Haley
  0 siblings, 1 reply; 5+ messages in thread
From: Graeme Peterson @ 2002-10-08 14:42 UTC (permalink / raw)
  To: gcc

Hi, all.

I have done some searching, and it seems that gcc (in this case 
2.95.3 targetting ppc-QNX6) does not have support for statically
linked software emulated floating point instructions.

Consider the following C source:

	double a, b, c;
	int main(int argc, char **argv) {
	        c = a + b;
	        return 0;
	}

Compiling it normally, I get an fadd instruction.  Using -msoft-float
I get a call to __adddf3 in libgcc.a in place of the fadd.  This
looks good, but objdump -d of gcc/nof/libgcc.a shows me:

	00000000 <__adddf3>:
	   0:   fc 21 10 2a     fadd    f1,f1,f2
	   4:   4e 80 00 20     blr

So I am still getting the fadd, and I have to call out to get it.

Can someone clarify for me what is required to get this going?  Do 
I need to implement the floating point emulation and tell gcc to 
use it in place of the fadd in the __adddf3 call?  If so, how do I
do that?

I found some news postings on this, and they all talk about patches 
to glibc to support this.  We don't use glibc, but have our own libc.

Any and all clarification on this issue appreciated.

Cheers, and TIA.
GP

^ permalink raw reply	[flat|nested] 5+ messages in thread

* soft-float support
  2002-10-08 14:42 soft-float support Graeme Peterson
@ 2002-10-08 15:37 ` Andrew Haley
  2002-10-08 15:52   ` Graeme Peterson
  2002-10-08 16:21   ` Graeme Peterson
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Haley @ 2002-10-08 15:37 UTC (permalink / raw)
  To: Graeme Peterson; +Cc: gcc

Graeme Peterson writes:
 > Hi, all.
 > 
 > I have done some searching, and it seems that gcc (in this case 
 > 2.95.3 targetting ppc-QNX6) does not have support for statically
 > linked software emulated floating point instructions.
 > 
 > Can someone clarify for me what is required to get this going?  Do 
 > I need to implement the floating point emulation and tell gcc to 
 > use it in place of the fadd in the __adddf3 call?  If so, how do I
 > do that?

You need to specify the multilibs in your target file for qnx.

For example, in the current gcc source, gcc/config/rs6000/t-rs6000
contains

MULTILIB_OPTIONS = msoft-float
MULTILIB_DIRNAMES = soft-float

Andrew.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: soft-float support
  2002-10-08 15:37 ` Andrew Haley
@ 2002-10-08 15:52   ` Graeme Peterson
  2002-10-08 16:21   ` Graeme Peterson
  1 sibling, 0 replies; 5+ messages in thread
From: Graeme Peterson @ 2002-10-08 15:52 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc

> 
> Graeme Peterson writes:
>  > Hi, all.
>  > 
>  > I have done some searching, and it seems that gcc (in this case 
>  > 2.95.3 targetting ppc-QNX6) does not have support for statically
>  > linked software emulated floating point instructions.
>  > 
>  > Can someone clarify for me what is required to get this going?  Do 
>  > I need to implement the floating point emulation and tell gcc to 
>  > use it in place of the fadd in the __adddf3 call?  If so, how do I
>  > do that?
> 
> You need to specify the multilibs in your target file for qnx.
> 
> For example, in the current gcc source, gcc/config/rs6000/t-rs6000
> contains
> 
> MULTILIB_OPTIONS = msoft-float
> MULTILIB_DIRNAMES = soft-float
> 
> Andrew.
> 

Here is our gcc/config/rs6000/t-nto file.  I _think_ we had it set up
ok.

Thanks.
GP


  CRTSTUFF_T_CFLAGS = -msdata=none -fPIC -fno-omit-frame-pointer
  TARGET_LIBGCC2_CFLAGS = -fPIC -fno-honor-std
  FIXPROTO_DEFINES = -D__QNX__ -D__QNXNTO__ -D__PPC__ -D__GNUC__
  
  MULTILIB_OPTIONS        = msoft-float fPIC fexceptions
  MULTILIB_DIRNAMES       = nof pic exceptions
  MULTILIB_EXCEPTIONS     =
  MULTILIB_MATCHES        = ${MULTILIB_MATCHES_FLOAT} \
                            fPIC=mrelocatable-lib \
                            fPIC=mrelocatable \
                            fPIC=shared \
                            fPIC=fpic
  
  USER_H = $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
  LIBGCC=stmp-multilib
  INSTALL_LIBGCC=install-multilib
  CROSS_LIBGCC1 = libgcc1.a
  EXTRA_PARTS = crtbeginC++.o crtendC++.o
  LIB2FUNCS_EXTRA = tramp.S
  
  tramp.S: $(srcdir)/config/rs6000/tramp.asm
          cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
  
  $(T)crtbeginC++.o: crtbegin.o
          cp crtbegin.o crtbeginC++.o
  
  $(T)crtendC++.o: crtend.o
          cp crtend.o crtendC++.o

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: soft-float support
  2002-10-08 15:37 ` Andrew Haley
  2002-10-08 15:52   ` Graeme Peterson
@ 2002-10-08 16:21   ` Graeme Peterson
  1 sibling, 0 replies; 5+ messages in thread
From: Graeme Peterson @ 2002-10-08 16:21 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc

I dug a little and found this, which I copied from t-rs6000:

   LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c tramp.S
  
   dp-bit.c: $(srcdir)/config/fp-bit.c
         cat $(srcdir)/config/fp-bit.c > dp-bit.c
  
   fp-bit.c: $(srcdir)/config/fp-bit.c
         echo '#define FLOAT' > fp-bit.c
         cat $(srcdir)/config/fp-bit.c >> fp-bit.c

I'm building it now, but the comment at the top of fp-bit.c
seems promising: 

"/* This is a software floating point library which can be used instead of
   the floating point routines in libgcc1.c for targets without hardware
   floating point. */ "

Think that might be it?  :-)

GP

> 
> Graeme Peterson writes:
>  > Hi, all.
>  > 
>  > I have done some searching, and it seems that gcc (in this case 
>  > 2.95.3 targetting ppc-QNX6) does not have support for statically
>  > linked software emulated floating point instructions.
>  > 
>  > Can someone clarify for me what is required to get this going?  Do 
>  > I need to implement the floating point emulation and tell gcc to 
>  > use it in place of the fadd in the __adddf3 call?  If so, how do I
>  > do that?
> 
> You need to specify the multilibs in your target file for qnx.
> 
> For example, in the current gcc source, gcc/config/rs6000/t-rs6000
> contains
> 
> MULTILIB_OPTIONS = msoft-float
> MULTILIB_DIRNAMES = soft-float
> 
> Andrew.
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: soft-float support
       [not found] <no.id>
@ 2002-10-08 16:26 ` Graeme Peterson
  0 siblings, 0 replies; 5+ messages in thread
From: Graeme Peterson @ 2002-10-08 16:26 UTC (permalink / raw)
  To: Graeme Peterson; +Cc: Andrew Haley, gcc

This got it working.  I also had to add:

  # Do not build libgcc1.
  LIBGCC1 =
  CROSS_LIBGCC1 =

Thanks, all.
GP

> 
> I dug a little and found this, which I copied from t-rs6000:
> 
>    LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c tramp.S
>   
>    dp-bit.c: $(srcdir)/config/fp-bit.c
>          cat $(srcdir)/config/fp-bit.c > dp-bit.c
>   
>    fp-bit.c: $(srcdir)/config/fp-bit.c
>          echo '#define FLOAT' > fp-bit.c
>          cat $(srcdir)/config/fp-bit.c >> fp-bit.c
> 
> I'm building it now, but the comment at the top of fp-bit.c
> seems promising: 
> 
> "/* This is a software floating point library which can be used instead of
>    the floating point routines in libgcc1.c for targets without hardware
>    floating point. */ "
> 
> Think that might be it?  :-)
> 
> GP
> 
> > 
> > Graeme Peterson writes:
> >  > Hi, all.
> >  > 
> >  > I have done some searching, and it seems that gcc (in this case 
> >  > 2.95.3 targetting ppc-QNX6) does not have support for statically
> >  > linked software emulated floating point instructions.
> >  > 
> >  > Can someone clarify for me what is required to get this going?  Do 
> >  > I need to implement the floating point emulation and tell gcc to 
> >  > use it in place of the fadd in the __adddf3 call?  If so, how do I
> >  > do that?
> > 
> > You need to specify the multilibs in your target file for qnx.
> > 
> > For example, in the current gcc source, gcc/config/rs6000/t-rs6000
> > contains
> > 
> > MULTILIB_OPTIONS = msoft-float
> > MULTILIB_DIRNAMES = soft-float
> > 
> > Andrew.
> > 
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-08 21:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-08 14:42 soft-float support Graeme Peterson
2002-10-08 15:37 ` Andrew Haley
2002-10-08 15:52   ` Graeme Peterson
2002-10-08 16:21   ` Graeme Peterson
     [not found] <no.id>
2002-10-08 16:26 ` Graeme Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).