[llvm-commits] [llvm] r126100 - /llvm/trunk/lib/Target/X86/README.txt
Cameron Zwarich
zwarich at apple.com
Sun Feb 20 17:29:32 PST 2011
Author: zwarich
Date: Sun Feb 20 19:29:32 2011
New Revision: 126100
URL: http://llvm.org/viewvc/llvm-project?rev=126100&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/X86/README.txt
Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=126100&r1=126099&r2=126100&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Sun Feb 20 19:29:32 2011
@@ -1878,38 +1878,3 @@
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.
-
-//===---------------------------------------------------------------------===//
-
-
-
More information about the llvm-commits
mailing list