[PATCH] D53927: [AArch64] Enable libm vectorized functions via SLEEF

Stefan Teleman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 11 20:24:02 PST 2018


steleman added a comment.

In D53927#1327983 <https://reviews.llvm.org/D53927#1327983>, @shibatch wrote:

> > A header file that wasn't there before is now automagically included, and there's nothing they can do to not include it. Boom! - source code change. Happy re-certification planning.
>
> @steleman Could you explain a little bit about when a re-certification is required?
>  Is it required when a standard header file(e.g. math.h) is changed?


Yes. Distro upgrades must be (and are) certified. Once they're certified, they stay immutable for a very long time.

> gcc/glibc is doing a similar thing. In math-vector.h, which is included from math.h, there is declaration like below.
> 
>   # if defined _OPENMP && _OPENMP >= 201307
>   /* OpenMP case.  */
>   #  define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch")
>   # elif __GNUC_PREREQ (6,0)
>   /* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)).  */
>   #  define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch")))
>   # endif
>   
>   # ifdef __DECL_SIMD_x86_64
>   #  undef __DECL_SIMD_cos
>   #  define __DECL_SIMD_cos __DECL_SIMD_x86_64
>   ...

So the non-openmp case doesn't change code, and doesn't introduce external dependencies that may not have been present in the initial implementation. It just adds a function attribute. Which, in GCC-land, translates to a function call to a (possibly inlined) vectorized function.

I am not, by any means, suggesting that there is something inherently wrong with using OpenMP for SIMD libm vectorization. There is absolutely nothing wrong with that approach.

However, OpenMP cannot be the //only// method of obtaining vectorization of libm functions, for reasons already mentioned. There has to be an alternate method, one that does not involve importing OpenMP pragmas and interfaces, and their implicit trigger of code changes. GCC provides that alternative with __attribute__((__simd__)).


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53927/new/

https://reviews.llvm.org/D53927





More information about the llvm-commits mailing list