summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit33bd24bd92307a797a88072d628810e242cd8ceb (patch)
treec7367319b37f86770dce7a41d169c245a2deae96 /llvm/lib/Target/PowerPC/README_ALTIVEC.txt
parent715eaa031c12a769899809602f38236b6d4be38c (diff)
downloadbcm5719-llvm-33bd24bd92307a797a88072d628810e242cd8ceb.tar.gz
bcm5719-llvm-33bd24bd92307a797a88072d628810e242cd8ceb.zip
add a note
llvm-svn: 50267
Diffstat (limited to 'llvm/lib/Target/PowerPC/README_ALTIVEC.txt')
-rw-r--r--llvm/lib/Target/PowerPC/README_ALTIVEC.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/README_ALTIVEC.txt b/llvm/lib/Target/PowerPC/README_ALTIVEC.txt
index 461b4123c79..1e4c6fb9844 100644
--- a/llvm/lib/Target/PowerPC/README_ALTIVEC.txt
+++ b/llvm/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;
+}
+
OpenPOWER on IntegriCloud