Hi,

> I think adding intrinsic libraries is a mixed bag, for the following
> reasons:
> 
> 1) The intrinsic libraries are completely internal to the compilers.
> Breaking down that toolchain/code barrier is not a good idea if we want the
> project to compile using a good variety of compilers. The API is unstable
> (as it's internal to the compiler + version) and sometimes undocumented;
> while in reality the ABI doesn't really change (at least in the LLVM/GCC
> world, not sure about the other compilers), it's something to consider.

Yes.  But apparently there is no way around them.  We have them for arm.
We have them for openssl.  IntelUndiPkg in edk2-staging has some too
(see IntelUndiPkg/LibC).  And I wouldn't be surprised if there are more
cases ...

Having a policy to outlaw Intrinsics, but then hand out exceptions left
and right doesn't look like a good idea to me.  I think we should revisit
that and accept that there simply is no way around Intrinsics in some
cases.

I think it makes sense to consolidate all the Intrinsics we have, i.e.
move them over to MdePkg, make everybody use that, so we have only a
single version to maintain.

I think it also makes sense to restrict Intrinsics to the cases where we
have no other option, to keep them as small as possible and also make it
as easy as possible to maintain them.

> 2) Linking the compiler's builtin libraries would fix our issues, except
> that it doesn't work in cases where object files are tagged with ABI (such
> as hard FP vs soft FP).

Also:

 * On my system the gcc intrinsics are only available as shared library,
   so the "just unpack the lib and use the object files" idea is not
   going to work.

 * I have my doubts that compiler's builtin libraries are optimized for
   size, so I'd suspect we would see a noticeable size grow from that.

 * I'd very much prefer to continue with the current approach to have
   source code for the Intrinsics we need.  In case we run into trouble
   things tend to be much easier to fix when you have the source code at
   hand.  That's actually part of the open source success story.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86079): https://edk2.groups.io/g/devel/message/86079
Mute This Topic: https://groups.io/mt/87479913/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to