Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: AMD's 3DNow...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 12 Topic 4602 of 4728
Post > Topic >>

Re: AMD's 3DNow! imprecise

by Terje Mathisen <spamtrap@[EMAIL PROTECTED] > Apr 4, 2008 at 07:36 AM

Waldek Hebisch wrote:
> kuratkull@[EMAIL PROTECTED]
 <spamtrap@[EMAIL PROTECTED]
> wrote:
>> Anyway, I am trying to build the very-fast-prime-counter i assembly
>> and I succeeded when using only the regular instructions, but a 6.5
>> secs for a 100k primes is way too slow, so I looked around and
>> profiled my code...and of course, a major bottleneck was the idivl. 
> 
> I am not sure what "prime-counter" mean -- I you want just generate
> primes than sieve of Eratosthenes is the standard method (much faster
> than method using division).

Indeed, that is the way to do it for any kind of range processing, until 
you get into stuff like 500+ bit prime number searching (for RSA keys), 
in which case you should be using statistical procedures, i.e. modular 
arithmetic.

> In case you really want to use division, you may consider storing
> recipracals -- you are using the same divisor many times.

Using the same divisor/reciprocal many times simply means using a sieve, 
and for a properly compressed base table (personally I prefer storing 30 
numbers in each 8-bit entry) you can even do stuff like casting out 
multiple trial divisor multiples at the same time, when the divisors are 
still pretty small.

Do a search on +prime +"sieve of Eratosthenes"!

I'm guessing you have at least a couple of orders of magnitude in speed 
to gain. :-)

Terje

-- 
- <Terje.Mathisen@[EMAIL PROTECTED]
>
"almost all programming can be viewed as an exercise in caching"
 




 12 Posts in Topic:
AMD's 3DNow! imprecise
"kuratkull@[EMAIL PR  2008-04-02 12:50:35 
Re: AMD's 3DNow! imprecise
kuratkull <spamtrap@[  2008-04-03 14:23:43 
Re: AMD's 3DNow! imprecise
kuratkull <spamtrap@[  2008-04-03 14:13:07 
Re: AMD's 3DNow! imprecise
Sebastian Biallas <sp  2008-04-04 00:23:22 
Re: AMD's 3DNow! imprecise
Waldek Hebisch <spamt  2008-04-04 02:23:23 
Re: AMD's 3DNow! imprecise
Terje Mathisen <spamt  2008-04-04 07:36:03 
Re: AMD's 3DNow! imprecise
kuratkull <spamtrap@[  2008-04-03 23:13:00 
Re: AMD's 3DNow! imprecise
Phil Carmody <thefatph  2008-04-04 23:18:38 
Re: AMD's 3DNow! imprecise
kuratkull <spamtrap@[  2008-04-03 22:45:12 
Re: AMD's 3DNow! imprecise
Sebastian Biallas <sp  2008-04-07 13:55:19 
Re: AMD's 3DNow! imprecise
kuratkull <spamtrap@[  2008-04-08 05:19:12 
Re: AMD's 3DNow! imprecise
"James Van Buskirk&q  2008-04-10 13:08:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 0:38:45 CDT 2008.