aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/README_ALTIVEC.txt
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-25 17:25:00 +0000
committerChris Lattner <sabre@nondot.org>2008-04-25 17:25:00 +0000
commit751e32f486be5a1a024d90f84398ea9f01d9b9a6 (patch)
treeebc6dd7f01a90e89ff56a6e5bd18c3a97f8e96a9 /lib/Target/PowerPC/README_ALTIVEC.txt
parent5aca676cb6008b67e203e920b04995316e3821bd (diff)
downloadexternal_llvm-751e32f486be5a1a024d90f84398ea9f01d9b9a6.zip
external_llvm-751e32f486be5a1a024d90f84398ea9f01d9b9a6.tar.gz
external_llvm-751e32f486be5a1a024d90f84398ea9f01d9b9a6.tar.bz2
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/README_ALTIVEC.txt')
-rw-r--r--lib/Target/PowerPC/README_ALTIVEC.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/README_ALTIVEC.txt b/lib/Target/PowerPC/README_ALTIVEC.txt
index 461b412..1e4c6fb 100644
--- a/lib/Target/PowerPC/README_ALTIVEC.txt
+++ b/lib/Target/PowerPC/README_ALTIVEC.txt
@@ -186,3 +186,26 @@ lowering would be:
3. lvsl 0; splat index; vcmpeq to generate a select mask
4. lvsl slot + x; vperm to rotate result into correct slot
5. vsel result together.
+
+//===----------------------------------------------------------------------===//
+
+Should codegen branches on vec_any/vec_all to avoid mfcr. Two examples:
+
+#include <altivec.h>
+ int f(vector float a, vector float b)
+ {
+ int aa = 0;
+ if (vec_all_ge(a, b))
+ aa |= 0x1;
+ if (vec_any_ge(a,b))
+ aa |= 0x2;
+ return aa;
+}
+
+vector float f(vector float a, vector float b) {
+ if (vec_any_eq(a, b))
+ return a;
+ else
+ return b;
+}
+