summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-13 04:19:50 +0000
committerChris Lattner <sabre@nondot.org>2006-09-13 04:19:50 +0000
commite413fea6acc64913db7e3940e94723ffd9f843b8 (patch)
treecbb630b060c1e2e84c02478c6f41e6b31683e50d /llvm/lib/Target
parent3496710f25b930251739acc6e2031c17c11d5a8b (diff)
downloadbcm5719-llvm-e413fea6acc64913db7e3940e94723ffd9f843b8.tar.gz
bcm5719-llvm-e413fea6acc64913db7e3940e94723ffd9f843b8.zip
new note
llvm-svn: 30286
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/README.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/README.txt b/llvm/lib/Target/X86/README.txt
index 5e2ab199ad2..14ea97d6710 100644
--- a/llvm/lib/Target/X86/README.txt
+++ b/llvm/lib/Target/X86/README.txt
@@ -643,3 +643,35 @@ This saves a movzbl, and saves a truncate if it doesn't get coallesced right.
This is a simple DAGCombine to propagate the zext through the and.
//===---------------------------------------------------------------------===//
+
+GCC's ix86_expand_int_movcc function (in i386.c) has a ton of interesting
+simplifications for integer "x cmp y ? a : b". For example, instead of:
+
+int G;
+void f(int X, int Y) {
+ G = X < 0 ? 14 : 13;
+}
+
+compiling to:
+
+_f:
+ movl $14, %eax
+ movl $13, %ecx
+ movl 4(%esp), %edx
+ testl %edx, %edx
+ cmovl %eax, %ecx
+ movl %ecx, _G
+ ret
+
+it could be:
+_f:
+ movl 4(%esp), %eax
+ sarl $31, %eax
+ notl %eax
+ addl $14, %eax
+ movl %eax, _G
+ ret
+
+etc.
+
+//===---------------------------------------------------------------------===//
OpenPOWER on IntegriCloud