[PATCH] D64024: [PowerPC][Altivec] Emit correct builtin for single precision vec_all_ne
Nemanja Ivanovic via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 1 10:49:05 PDT 2019
nemanjai created this revision.
nemanjai added reviewers: hfinkel, jsji, rzurob.
Herald added subscribers: kristina, kbarton.
Herald added a project: clang.
We currently emit a double precision comparison instruction for this, whereas we need to emit the single precision version.
Repository:
rC Clang
https://reviews.llvm.org/D64024
Files:
lib/Headers/altivec.h
test/CodeGen/builtins-ppc-p8vector.c
Index: test/CodeGen/builtins-ppc-p8vector.c
===================================================================
--- test/CodeGen/builtins-ppc-p8vector.c
+++ test/CodeGen/builtins-ppc-p8vector.c
@@ -515,6 +515,13 @@
dummy();
// CHECK: @dummy
+ res_i = vec_all_ne(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpeqsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpeqsp.p
+
+ dummy();
+// CHECK: @dummy
+
res_i = vec_all_nge(vda, vda);
// CHECK: @llvm.ppc.vsx.xvcmpgedp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgedp.p
Index: lib/Headers/altivec.h
===================================================================
--- lib/Headers/altivec.h
+++ lib/Headers/altivec.h
@@ -14781,7 +14781,7 @@
static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
vector float __b) {
#ifdef __VSX__
- return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
+ return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __b);
#else
return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64024.207374.patch
Type: text/x-patch
Size: 1012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190701/05e6f17a/attachment.bin>
More information about the cfe-commits
mailing list