diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-03-17 01:22:09 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-03-17 01:22:09 +0000 |
commit | 3d831381a973f5c87cc0698bf50cbe4d94391eab (patch) | |
tree | ad6eeec9f2c76a994ac434a46558cc8c973d5ed1 | |
parent | f21b1058a194f411000bdd8000a8b675a7874056 (diff) | |
download | external_llvm-3d831381a973f5c87cc0698bf50cbe4d94391eab.zip external_llvm-3d831381a973f5c87cc0698bf50cbe4d94391eab.tar.gz external_llvm-3d831381a973f5c87cc0698bf50cbe4d94391eab.tar.bz2 |
A couple new README entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127786 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/README.txt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index abd1515..77a513d 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -1947,3 +1947,39 @@ which is "perfect". //===---------------------------------------------------------------------===// +For the branch in the following code: +int a(); +int b(int x, int y) { + if (x & (1<<(y&7))) + return a(); + return y; +} + +We currently generate: + movb %sil, %al + andb $7, %al + movzbl %al, %eax + btl %eax, %edi + jae .LBB0_2 + +movl+andl would be shorter than the movb+andb+movzbl sequence. + +//===---------------------------------------------------------------------===// + +For the following: +struct u1 { + float x, y; +}; +float foo(struct u1 u) { + return u.x + u.y; +} + +We currently generate: + movdqa %xmm0, %xmm1 + pshufd $1, %xmm0, %xmm0 # xmm0 = xmm0[1,0,0,0] + addss %xmm1, %xmm0 + ret + +We could save an instruction here by commuting the addss. + +//===---------------------------------------------------------------------===// |