aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-01-05 02:13:20 +0000
committerBill Wendling <isanbard@gmail.com>2012-01-05 02:13:20 +0000
commit397ae210ce55545eaff21c5813d060fa567843a5 (patch)
tree770fb82a1369d475243dfcb43be83af4be859777 /lib/Support/CommandLine.cpp
parent1130d220a33a6171e408d9ec4594242907541e1b (diff)
Replace the uint64_t -> double convertion algorithm with one that's more efficient.
This small bit of ASM code is sufficient to do what the old algorithm did: movq %rax, %xmm0 punpckldq (c0), %xmm0 // c0: (uint4){ 0x43300000U, 0x45300000U, 0U, 0U } subpd (c1), %xmm0 // c1: (double2){ 0x1.0p52, 0x1.0p52 * 0x1.0p32 } #ifdef __SSE3__ haddpd %xmm0, %xmm0 #else pshufd $0x4e, %xmm0, %xmm1 addpd %xmm1, %xmm0 #endif It's arguably faster. One caveat, the 'haddpd' instruction isn't very fast on all processors. <rdar://problem/7719814> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions