Jeff Law <l...@redhat.com> writes: > On 05/08/2015 10:50 AM, Joseph Myers wrote: > > > > Note that however the dynamic linker does properly need to save and > > restore call-clobbered registers used for argument passing (because of > > IFUNCs, user-provided malloc, audit hooks etc. that might affect them > > even if the dynamic linker itself doesn't); see > > <https://sourceware.org/ml/libc-alpha/2014-01/msg00673.html>. So any > > floating-point-agnostic dynamic linker would, if fixing the bugs > > around not saving / restoring such registers, need to have > > runtime-conditional code to save and restore them rather than simple > > compile-time conditionals. > Right. So there has to be some reasonable cost way to find out if you > have FPU registers at runtime, then select between the code paths at > runtime.
Indeed and I think there are many ways to achieve that without hardware support as the cost of loading a global variable in the dynamic linker wouldn't be significant. I think MIPS ABIs are the only ones with enough information available at runtime to achieve this currently but the principles should apply to any arch. The work we are investigating as part of PR65862 will help all this as the intention is to avoid FPR usage unless floating point is actually used. There is then some thinking involved in figuring out what no-float should really mean: i.e. no floating point types used, no FPU insns used and/or no floating point in any of the calls/global functions. I haven't spent enough time thinking about which ones are the most important from above yet. Matthew