aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-02 19:27:34 +0000
committerChris Lattner <sabre@nondot.org>2008-03-02 19:27:34 +0000
commit150943c17867ad87cd372efc7a030d0c099d326e (patch)
tree4588ae1983d7d4a98a613a56a4d0029ae2e44e20 /lib/Target
parent767486b1d5660948643959348f8cb0b1ac7c54bc (diff)
downloadexternal_llvm-150943c17867ad87cd372efc7a030d0c099d326e.zip
external_llvm-150943c17867ad87cd372efc7a030d0c099d326e.tar.gz
external_llvm-150943c17867ad87cd372efc7a030d0c099d326e.tar.bz2
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/PowerPC/README.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt
index 7bc50e5..55baf8d 100644
--- a/lib/Target/PowerPC/README.txt
+++ b/lib/Target/PowerPC/README.txt
@@ -714,3 +714,42 @@ GCC compiles this into:
which is more efficient and can use mfocr. See PR642 for some more context.
//===---------------------------------------------------------------------===//
+
+void foo(float *data, float d) {
+ long i;
+ for (i = 0; i < 8000; i++)
+ data[i] = d;
+}
+void foo2(float *data, float d) {
+ long i;
+ data--;
+ for (i = 0; i < 8000; i++) {
+ data[1] = d;
+ data++;
+ }
+}
+
+These compile to:
+
+_foo:
+ li r2, 0
+LBB1_1: ; bb
+ addi r4, r2, 4
+ stfsx f1, r3, r2
+ cmplwi cr0, r4, 32000
+ mr r2, r4
+ bne cr0, LBB1_1 ; bb
+ blr
+_foo2:
+ li r2, 0
+LBB2_1: ; bb
+ addi r4, r2, 4
+ stfsx f1, r3, r2
+ cmplwi cr0, r4, 32000
+ mr r2, r4
+ bne cr0, LBB2_1 ; bb
+ blr
+
+The 'mr' could be eliminated to folding the add into the cmp better.
+
+//===---------------------------------------------------------------------===//