diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-13 04:19:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-13 04:19:50 +0000 |
commit | d1468d3332a906ec81c2d2fd0d3b4908e07a06a1 (patch) | |
tree | 44d4964ad113b53140eb9affc3cb5756288d824c | |
parent | 95af34e33f9918dc8a399f8414ce6a9673bd5ffb (diff) |
new note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30286 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/README.txt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index 5e2ab199ad..14ea97d671 100644 --- a/lib/Target/X86/README.txt +++ b/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. + +//===---------------------------------------------------------------------===// |