Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Enabling soft-fp on x86 (Not cross compiler)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Aed
n00b
n00b


Joined: 09 Apr 2008
Posts: 2

PostPosted: Wed Apr 09, 2008 7:28 pm    Post subject: Enabling soft-fp on x86 (Not cross compiler) Reply with quote

Hi,

I'm trying to use the gcc flag "-msoft-float" in order to instrument and profile use of FP code in my project. The compiler generates the appropriate stubs, however glibc doesn't compile the "soft-fp" module by default on x86. How can I force this?

Thanks,
Aed
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54390
Location: 56N 3W

PostPosted: Wed Apr 09, 2008 8:14 pm    Post subject: Reply with quote

Aed,

Welcome to gentoo

gcc never provides the software floating point emulation when you use "-msoft-float". On arm at least, you have to make your own arrangements.

On x86, the floating point emulation is provided in the kernel. It traps x86 FPU instructions and emulates them. However, building the kernel with software floating point enable is not enough as the kernel will use the real FPU if its fitted. You need to provide the kernel option that tells the kernel your FPU is faulty and not to use it.

Doing software floating point this way means that binaries compiled to expect a real FPU just work, only much slower.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Aed
n00b
n00b


Joined: 09 Apr 2008
Posts: 2

PostPosted: Wed Apr 09, 2008 8:35 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Aed,

Welcome to gentoo

gcc never provides the software floating point emulation when you use "-msoft-float". On arm at least, you have to make your own arrangements.

On x86, the floating point emulation is provided in the kernel. It traps x86 FPU instructions and emulates them. However, building the kernel with software floating point enable is not enough as the kernel will use the real FPU if its fitted. You need to provide the kernel option that tells the kernel your FPU is faulty and not to use it.

Doing software floating point this way means that binaries compiled to expect a real FPU just work, only much slower.


Hi,

On ARM, the module soft-fp would be compiled in glibc and provide the stubbed out functions implied with gcc's "-msoft-float". I want to enable this build path on x86.

Making alterations to the kernel is not an option for me, unfortunately.

Thanks for the reply.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum