Skip to contentSkip to conversation

SoftFloat implementation for MIPS in GCC

DISCUSSION Rajesh Palani 4 participants 5 messages Jan 28, 2004 MIPS

lore
Share & tools
lore
#0 lore raw

Hi,

We are using a gcc 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1) GCC cross-compiler with -msoftfloat to use software floating point routines.

When we profied an application using the Linux Trace Toolkit, we observed that there were a lot of CpU (Co-processor unusable) exceptions. Some of the floating point routines ( eg. __floatdidf) expect values to be passed in floating point registers and take FP exceptions even though the application has been built with -msoftfloat. Is this a general MIPS/GCC issue? What is the status of softfloat for MIPS in GCC?

Thanks in advance.

Rajesh

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

#1 lore raw
Quoted 5 lines · Rajesh Palani

Hi,

We are using a gcc 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1) GCC cross-compiler with -msoftfloat to use software floating point routines.

When we profied an application using the Linux Trace Toolkit, we observed that there were a lot of CpU (Co-processor unusable) exceptions. Some of the floating point routines ( eg. __floatdidf) expect values to be passed in floating point registers and take FP exceptions even though the application has been built with -msoftfloat. Is this a general MIPS/GCC issue? What is the status of softfloat for MIPS in GCC?

Try a more recent compiler, that one is ancient. If you configure correctly, you should get no references to the floating point registers at all.

Signature · 2 lines
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer
#2 lore raw
Quoted 11 lines · Daniel Jacobowitz
Quoted 5 lines · Rajesh Palani

Hi,

We are using a gcc 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1) GCC cross-compiler with -msoftfloat to use software floating point routines.

When we profied an application using the Linux Trace Toolkit, we observed that there were a lot of CpU (Co-processor unusable) exceptions. Some of the floating point routines ( eg. __floatdidf) expect values to be passed in floating point registers and take FP exceptions even though the application has been built with -msoftfloat. Is this a general MIPS/GCC issue? What is the status of softfloat for MIPS in GCC?

Try a more recent compiler, that one is ancient. If you configure correctly, you should get no references to the floating point registers at all.

If glibc is not compiled with -msoftfloat, I think you will get a few FPU exceptions from glibc no matter how apps are compiled.

Actually, will it be a problem if glibc and apps are compiled differently (such as in longjump, sig handling area)?

Jun

#3 lore raw
Quoted 20 lines · Jun Sun
Quoted 5 lines · Daniel Jacobowitz
Quoted 2 lines · Rajesh Palani

Hi,

Quoted 11 lines
Quoted 5 lines

We are using a gcc 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1) GCC cross-compiler with -msoftfloat to use software floating point routines.

When we profied an application using the Linux Trace Toolkit, we observed that there were a lot of CpU (Co-processor unusable) exceptions. Some of the floating point routines ( eg. __floatdidf) expect values to be passed in floating point registers and take FP exceptions even though the application has been built with -msoftfloat. Is this a general MIPS/GCC issue? What is the status of softfloat for MIPS in GCC?

Try a more recent compiler, that one is ancient. If you configure correctly, you should get no references to the floating point registers at all.

Quoted 7 lines

If glibc is not compiled with -msoftfloat, I think you will get a few FPU exceptions from glibc no matter how apps are compiled.

Actually, will it be a problem if glibc and apps are compiled differently (such as in longjump, sig handling area)?

I have found that some versions of glibc (2.2.5 for example) have hard coded floating point code (in longjump handling IIRC) so no matter what you do you get the exceptions.

David Daney.

#4 lore raw
In reply to Jun Sun
Quoted 13 lines · Jun Sun
Quoted 11 lines · Daniel Jacobowitz
Quoted 5 lines · Rajesh Palani

Hi,

We are using a gcc 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1) GCC cross-compiler with -msoftfloat to use software floating point routines.

When we profied an application using the Linux Trace Toolkit, we observed that there were a lot of CpU (Co-processor unusable) exceptions. Some of the floating point routines ( eg. __floatdidf) expect values to be passed in floating point registers and take FP exceptions even though the application has been built with -msoftfloat. Is this a general MIPS/GCC issue? What is the status of softfloat for MIPS in GCC?

Try a more recent compiler, that one is ancient. If you configure correctly, you should get no references to the floating point registers at all.

Quoted 5 lines

If glibc is not compiled with -msoftfloat, I think you will get a few FPU exceptions from glibc no matter how apps are compiled.

Actually, will it be a problem if glibc and apps are compiled differently (such as in longjump, sig handling area)?

Yes, that will be a problem. Nothing that takes or returns a floating point value will work either.

Signature · 2 lines
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer