diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-25 17:25:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-25 17:25:00 +0000 |
commit | 7c400dcb03074059776e39432c12c2a560c94223 (patch) | |
tree | ebc6dd7f01a90e89ff56a6e5bd18c3a97f8e96a9 | |
parent | 682f81032ffeac6ce9c0337816dfa0e051c9d636 (diff) | |
download | external_llvm-7c400dcb03074059776e39432c12c2a560c94223.zip external_llvm-7c400dcb03074059776e39432c12c2a560c94223.tar.gz external_llvm-7c400dcb03074059776e39432c12c2a560c94223.tar.bz2 |
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50267 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/README_ALTIVEC.txt | 23 |
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; +} + |