Re: powerpc: avoiding lfd/stfd for 64 bit integer load/stores

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Segher and Peter

On 21/11/2018 17.52, Peter Bergner wrote:
> On 11/21/18 7:13 AM, Segher Boessenkool wrote:
>> There is no such switch.  Implementing such a switch would be hard; for
>> example, the convert-float-to-integer instructions need to store an integer
>> in a floating point register.

Thanks for the answer. I accept that it would be hard to do such a
switch, though I don't think I understand that example. Why would gcc
ever create an int-to-float or float-to-int unless the source code
actually used float or double?

>> Compiling translation units with different needs, with different flags, is
>> the way to go.  -msoft-float means "do not use the FPRs".
> 
> I agree with Segher here.  I'll note though that -msoft-float and -mhard-float
> are different ABIs.  However, if you don't call a function across the soft-float
> to hard-float barrier that has floating point arguments or floating point
> return value, you should be fine.

We may have to do it that way, then. But I would hope to have some help
from the compiler to detect ABI violations, or generation of soft-float
code. We could build everything with -msoft-float, and all such code
should be forbidden from using float/double/long double in any way -
calling functions taking those, defining variables, casting to/from, ...
either via a new warning, or a hypothetical '-mno-float' [which I see
actually exists for MIPS]. Then we could selectively turn on
-mhard-float for the few TUs that actually need that.

Thanks,
Rasmus




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux