[PATCH] D97949: [AArch64] Add missing intrinsics for vrnd

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 09:35:40 PST 2021


jaykang10 added inline comments.


================
Comment at: clang/lib/Basic/Targets/AArch64.cpp:185
                                                 MacroBuilder &Builder) const {
+  Builder.defineMacro("__ARM_FEATURE_FRINT", "1");
   // Also include the Armv8.4 defines
----------------
SjoerdMeijer wrote:
> SjoerdMeijer wrote:
> > I think we need to add a test new macro in:
> > 
> >   Preprocessor/aarch64-target-features.c
> > 
> Sorry, wanted to say that we need to add a test for this new macro.
The macro is used in "arm_neon.h" which is generated at building time of clang as below so I thought we do not need to add the test for it.
```
#if __ARM_ARCH >= 8 && defined(__aarch64__) && defined(__ARM_FEATURE_FRINT)
...
#ifdef __LITTLE_ENDIAN__
__ai float32x2_t vrnd32x_f32(float32x2_t __p0) {
  float32x2_t __ret;
  __ret = (float32x2_t) __builtin_neon_vrnd32x_v((int8x8_t)__p0, 9);
  return __ret;
}
#else
__ai float32x2_t vrnd32x_f32(float32x2_t __p0) {
  float32x2_t __rev0;  __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
  float32x2_t __ret;
  __ret = (float32x2_t) __builtin_neon_vrnd32x_v((int8x8_t)__rev0, 9);
  __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
  return __ret;
}
#endif
...
```
If it is not enough, I will add a test for it.


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

https://reviews.llvm.org/D97949



More information about the llvm-commits mailing list