[PATCH] D80723: [PowerPC] Convert vec_splats functions to macros

Qing Shan Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 28 19:47:32 PDT 2020


steven.zhang added inline comments.


================
Comment at: clang/lib/Headers/altivec.h:13670
+  )
+#elif defined(__VSX__)
+#define vec_splats(N)                                     \
----------------
vddvss wrote:
> steven.zhang wrote:
> > I am not sure if this is by intention. It is not semantics the same with this change. Before the change, if VSX is off, and POWER8_VECTOR && __powerpc64__ is on, vector signed/unsigned long long, signed/unsigned __int128 is not a valid candidate of vec_splats. But with this patch, they are.
> No intention to change semantics. But AFICT, we throw an error if POWER8_VECTOR is on and VSX is off: https://github.com/llvm/llvm-project/blob/master/clang/lib/Basic/Targets/PPC.cpp#L222
Hmm, we are making assumption that, POWER8_VECTOR enables the VSX, and it is true. Thank you for pointing out this.


================
Comment at: clang/test/CodeGen/pr44276.c:3
+// REQUIRES: powerpc-registered-target
+// RUN: %clang -S -emit-llvm -target powerpc64-unknown-unknown -mcpu=pwr8 %s -o - | FileCheck %s
+
----------------
The assembly output is not your test point. How about doing it as this:
```
// RUN: %clang_cc1 -S -emit-llvm -triple powerpc64-unknown-unknown -target-cpu pwr8 %s
// expected-no-diagnostics
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80723





More information about the cfe-commits mailing list