summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-17 01:16:14 +0000
committerChris Lattner <sabre@nondot.org>2009-02-17 01:16:14 +0000
commitcba4b6f83de910223450cc0bbd92f64a9b50556e (patch)
tree43d263e1b297e030d326d46350aeb993a434876a /llvm/lib/Target
parent31180bbfb4da2e3e7bf1d7dc4d72b9decf9dcd78 (diff)
downloadbcm5719-llvm-cba4b6f83de910223450cc0bbd92f64a9b50556e.tar.gz
bcm5719-llvm-cba4b6f83de910223450cc0bbd92f64a9b50556e.zip
add a horrible note
llvm-svn: 64719
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/README.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/README.txt b/llvm/lib/Target/X86/README.txt
index 9a380acc6b7..e8c2561d417 100644
--- a/llvm/lib/Target/X86/README.txt
+++ b/llvm/lib/Target/X86/README.txt
@@ -1777,3 +1777,44 @@ LBB1_2: ## overflow
it would be nice to produce "into" someday.
//===---------------------------------------------------------------------===//
+
+This code:
+
+void vec_mpys1(int y[], const int x[], int scaler) {
+int i;
+for (i = 0; i < 150; i++)
+ y[i] += (((long long)scaler * (long long)x[i]) >> 31);
+}
+
+Compiles to this loop with GCC 3.x:
+
+.L5:
+ movl %ebx, %eax
+ imull (%edi,%ecx,4)
+ shrdl $31, %edx, %eax
+ addl %eax, (%esi,%ecx,4)
+ incl %ecx
+ cmpl $149, %ecx
+ jle .L5
+
+llvm-gcc compiles it to the much uglier:
+
+LBB1_1: ## bb1
+ movl 24(%esp), %eax
+ movl (%eax,%edi,4), %ebx
+ movl %ebx, %ebp
+ imull %esi, %ebp
+ movl %ebx, %eax
+ mull %ecx
+ addl %ebp, %edx
+ sarl $31, %ebx
+ imull %ecx, %ebx
+ addl %edx, %ebx
+ shldl $1, %eax, %ebx
+ movl 20(%esp), %eax
+ addl %ebx, (%eax,%edi,4)
+ incl %edi
+ cmpl $150, %edi
+ jne LBB1_1 ## bb1
+
+//===---------------------------------------------------------------------===//
OpenPOWER on IntegriCloud