This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Calling convention for "Routines for floating point emulation"


Ref https://llvm.org/bugs/show_bug.cgi?id=30543#c10

> > That should not be the case, for libgcc functions that are not in RTABI.
> > They should use the ABI of the multilib they are compiled for, which may
> > be base ABI or VFP ABI depending on the options used for compiling that
> > multilib.
>
> Interesting, I wonder how multiple people came to the same conclusion (that they use the base ABI) given the behavior of libgcc.

(See link above) I've confirmed that the first version of gcc that
supports vfp abi (4.5.0) and also the 4.6.3 shipped with debian 7 both
use the vfp ABI for these functions.

> > Functions such as __powidf2 and __mulsc3 are not part of the software
> > floating-point library.  They use the same ABI as any other C functions
> > with their type.
>
> The fact that they are listed under "4.2.4 Other floating-point functions" of the "Routines for floating point emulation" makes this rather confusing.
>
> Is there some other resource other than libgcc.texi that can be used to determine the calling convention requirements?

So I assume the convention is that

> Except where an external ABI defines things like that, the normal
> expectation for libgcc functions is that they have the same ABI as for an
> ordinary C function with the same prototype.  That is, since libgcc.texi
> gives a prototype for __powidf2 without saying anything special about its
> ABI, and since it is not a function defined in RTABI, it can be taken to
> use the VFP ABI when compiling for that ABI.

? This seems to be at least self consistent. However, since it is
apparently confusing for people who knows that some functions should
use the base ABI, maybe it'll be helpful for future readers to
explicitly state this in the doc?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]