diff options
author | Cameron Zwarich <zwarich@apple.com> | 2011-02-21 01:29:32 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2011-02-21 01:29:32 +0000 |
commit | ad48a4fc321adc58cd2843da64b2e206441c7e96 (patch) | |
tree | 45fbf89eae6f0cf390c3ba682d68ed78ec4cf39e /lib/Target/X86/README.txt | |
parent | 7d0805dcb82e9ba1d90ce8d702169683b9caded7 (diff) | |
download | external_llvm-ad48a4fc321adc58cd2843da64b2e206441c7e96.zip external_llvm-ad48a4fc321adc58cd2843da64b2e206441c7e96.tar.gz external_llvm-ad48a4fc321adc58cd2843da64b2e206441c7e96.tar.bz2 |
A lo/hi mul has higher latency than an imul r,ri, e.g. 5 cycles compared to 3
on Core 2 and Nehalem, so the code we generate is better than GCC's here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/README.txt')
-rw-r--r-- | lib/Target/X86/README.txt | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index ed3bff1..1e1660d 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -1878,38 +1878,3 @@ _add32carry: ret //===---------------------------------------------------------------------===// - -This: -char t(char c) { - return c/3; -} - -Compiles to: $clang t.c -S -o - -O3 -mkernel -fomit-frame-pointer - -_t: ## @t - movslq %edi, %rax - imulq $1431655766, %rax, %rax ## imm = 0x55555556 - movq %rax, %rcx - shrq $63, %rcx - shrq $32, %rax - addl %ecx, %eax - movsbl %al, %eax - ret - -GCC gets: - -_t: - movl $86, %eax - imulb %dil - shrw $8, %ax - sarb $7, %dil - subb %dil, %al - movsbl %al,%eax - ret - -which is nicer. This also happens for int, not just char. - -//===---------------------------------------------------------------------===// - - - |