[PATCH] D25950: [PPC] add float and double overloads for vec_orc and vec_nand in altivec.h
Nemanja Ivanovic via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 13:48:00 PDT 2016
nemanjai added inline comments.
================
Comment at: lib/Headers/altivec.h:5273-5278
+static __inline__ vector float __ATTRS_o_ai
+vec_nand(vector float __a, vector float __b) {
+ return (vector float)(~((vector unsigned int)__a &
+ (vector unsigned int)__b));
+}
+
----------------
amehsan wrote:
> amehsan wrote:
> > @kbarton Using C-style cast here, violates strict aliasing. Is that correct? Could it lead to functional problems if someone compiles their code WITHOUT -fno-strict-aliasing while using this built-ins? For example if this built-in is used in a context where __a and __b are deferenced pointers? Note that this will be inlined.
> used in a context where
> ```
> __a and __b
> ```
> Sorry for bad format of the comment.
> @nemanjai what do you think?
I may be wrong, but I don't think it does still. I think the semantics of the cast are always equivalent to a static_cast rather than a reinterpret_cast.
Repository:
rL LLVM
https://reviews.llvm.org/D25950
More information about the llvm-commits
mailing list