flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4 |
Author |
|
revolution 05 Sep 2011, 21:02
Madis731 wrote:
|
|||
![]() |
|
revolution 06 Sep 2011, 03:39
Here is an old topic about isqrt stuff
http://board.flatassembler.net/topic.php?p=28971#28971 Perhaps there is some faster code in there? Last edited by revolution on 06 Sep 2011, 03:41; edited 3 times in total |
|||
![]() |
|
bitRAKE 06 Sep 2011, 03:40
Code: iSqrt: ; u32 bsr edx, [esp+4] xor ecx, ecx xor eax, eax and edx, -2 ; make even bts ecx, edx .0: add eax, ecx sub [esp+4], eax jnc .1 add [esp+4], eax sub eax, ecx jmp .2 .1: add eax, ecx .2: shr eax, 1 shr ecx, 2 jne .0 ; EAX is square root of u32 passed on stack ; if [esp+4] is zero then u32 is a perfect square retn 4 (It's really slow compared to others posted.) (Happy Birthday to me. ![]() |
|||
![]() |
|
Madis731 06 Sep 2011, 05:25
Sorry revolution, I didn't test all. Here's the full set:
Code: ;Core 2 Mobile (T9300), COUNTER = 7FFFFFFh 3635ms SSE v1 2730ms SSE v2 doing nonFPU IMUL 3167ms FPU v1 3151ms FPU v2 2153ms FPU v3 doing nonFPU IMUL 2152ms Wikipedia + FPU v3 if needed 1701ms isqrt Revolution 1778ms isqrt Revolution PII 1966ms isqrt Rev_SSE 2699ms isqrt Rev_SSE2 2nd gen Core: Code: ;Core i5 650 (Desktop), COUNTER = 7FFFFFFh 1810ms SSE v1 1466ms SSE v2 doing nonFPU IMUL 1342ms FPU v1 1341ms FPU v2 1295ms FPU v3 doing nonFPU IMUL 515ms Wikipedia + FPU v3 if needed 655ms isqrt Revolution 780ms isqrt Revolution PII 889ms isqrt Rev_SSE 1436ms isqrt Rev_SSE2 |
|||
![]() |
|
r22 06 Sep 2011, 12:33
Seems like the "Wikipedia + isqrt Rev" would produce the fastest overall results.
This would seem to coincide with the StackOverflow answer (the link was posted earlier in the thread). |
|||
![]() |
|
MHajduk 06 Sep 2011, 13:20
bitRAKE wrote: (Happy Birthday to me. ![]() BTW, seems that you share the same birthday date as shoorick, interesting, isn't it? ![]() |
|||
![]() |
|
bitRAKE 06 Sep 2011, 19:53
MHajduk wrote: BTW, seems that you share the same birthday date as shoorick, interesting, isn't it? ![]() |
|||
![]() |
|
Goto page Previous 1, 2, 3, 4 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.