On Mon, Sep 06, 2021 at 02:08:58PM -0700, Linus Torvalds wrote: > On Mon, Sep 6, 2021 at 1:14 PM Jakub Jelinek <jakub@xxxxxxxxxx> wrote: > > > > the only guaranteed APIs are > > those provided by the headers (x86intrin.h/*mmintrin.h etc. on x86, > > arm_{neon,sve}.h etc. on arm*, ...) > > You guys realize we don't use those, do you? Linux does use the Arm and Power vector intrinsics (arm_neon.h and altivec.h). > And you don't seem to realize that you are actively arguing *AGAINST* > what you think you argue for. I have no idea what you think we are arguing for, only what we are. > That "immintrin.h" file, for example, is simply not usable for the > kernel. I just checked. Yes. It cannot be used in freestanding environments; it includes a header file we don't ship (<mm_malloc.h>, via <xmmintrin.h>). Or perhaps we do ship it, but only on native systems? Same issue, anyway. The top comment in the latter says /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.0. */ so the shortcoming exists there already probably? > 27 | #include <stdlib.h> > | ^~~~~~~~~~ > > Oops. Yup, that is not a (freestanding) standard C header. > Very similar things happens if you try to use that <stdint.h> file > that somebody mentioned earlier. Not at all. <stdint.h> *is* a standard C header, and we ship it, it always works. If you find problems with it, please report them! > You also don't seem to realize how hard it is to separate out the > user-land crap that we really cannot use, and must not use. We have worked very hard for many years to make this better. For the freestanding headers only <limits.h> is still problematic, and you do not need that one anyway, it is legacy more than anything else. Segher