[llvm-commits] [llvm] r50267 - /llvm/trunk/lib/Target/PowerPC/README_ALTIVEC.txt

Chris Lattner sabre at nondot.org
Fri Apr 25 10:25:00 PDT 2008


Author: lattner
Date: Fri Apr 25 12:25:00 2008
New Revision: 50267

URL: http://llvm.org/viewvc/llvm-project?rev=50267&view=rev
Log:
add a note

Modified:
    llvm/trunk/lib/Target/PowerPC/README_ALTIVEC.txt

Modified: llvm/trunk/lib/Target/PowerPC/README_ALTIVEC.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/README_ALTIVEC.txt?rev=50267&r1=50266&r2=50267&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/README_ALTIVEC.txt (original)
+++ llvm/trunk/lib/Target/PowerPC/README_ALTIVEC.txt Fri Apr 25 12:25:00 2008
@@ -186,3 +186,26 @@
 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; 
+}
+





More information about the llvm-commits mailing list