The MASM Forum

General => The Laboratory => Topic started by: daydreamer on June 28, 2019, 02:20:58 AM

Title: SSE 128bit randomgenerator(s)
Post by: daydreamer on June 28, 2019, 02:20:58 AM
making 128bit randomgenerator(s)
Title: Re: SSE 128bit randomgenerator(s)
Post by: daydreamer on May 20, 2021, 09:28:37 PM
I decided to try alternative fast gp reg unrolled 4 times
using mul instead of pmuludq,is there any way to use edx result for randomize it more?
Title: Re: SSE 128bit randomgenerator(s) unrollx?times?
Post by: daydreamer on May 29, 2021, 12:36:45 AM
I have 128bit SSE2 simple randomgenerator in macro

unrolled it 8 times in loop few million times
and checks for primes and add together primes
could you check timings please?





Title: Re: SSE 128bit randomgenerator(s)
Post by: mineiro on May 29, 2021, 04:20:57 AM

$ wine cmd.exe
Microsoft Windows 6.1.7601
Z:\home\mineiro\Documentos>1th.exe
1# program
the RND's
sum of random primes :583603954
27
Ms : 315
Ms composites :0
Press any key to continue ...

Z:\home\mineiro\Documentos>1th.exe
1# program
the RND's
sum of random primes :583603954
27
Ms : 318
Ms composites :0
Press any key to continue ..

Z:\home\mineiro\Documentos>1th.exe
1# program
the RND's
sum of random primes :583603954
27
Ms : 338
Ms composites :0
Press any key to continue ..
Title: Re: SSE 128bit randomgenerator(s)
Post by: HSE on May 29, 2021, 06:20:20 AM
Well...not so random:1# program
the RND's
sum of random primes :583603954
27
Ms : 468
Ms composites :0
Press any key to continue ...
Title: Re: SSE 128bit randomgenerator(s)
Post by: daydreamer on May 29, 2021, 09:01:02 PM
1# program
the RND's
sum of random primes :583603954
27
Ms : 391
Ms composites :0
Press any key to continue ...

I can also use random seed,but for timings it will become random add together or not,could randomize timings some without same seeds

with before also generating primes,it took several seconds

Title: Re: SSE 128bit randomgenerator(s)
Post by: daydreamer on June 01, 2021, 02:21:17 AM
probably can go faster

Title: Re: SSE 128bit randomgenerator(s)
Post by: HSE on June 01, 2021, 03:26:33 AM
1# program
the RND's
sum of random primes :583610108
27
Ms : 577
Ms composites :-2029479
Press any key to continue ...

Ms : 592
Ms composites :-2081178

Ms : 562
Ms composites :-2116059

Ms : 561
Ms composites :-2141363

Ms : 577
Ms composites :-2176416
Title: Re: SSE 128bit randomgenerator(s)
Post by: daydreamer on June 01, 2021, 09:36:08 PM
its really fast now :biggrin:
1# program
the RND's
sum of random primes :583610108
27
Ms : 156
Ms composites :-1527477187
Press any key to continue ...

but maybe slower on older cpus
changed align 64 above loops and removed two .IFs
started with over 2000+ms,when it took most time pre-generate primes



Title: Re: SSE 128bit randomgenerator(s)
Post by: LiaoMi on June 01, 2021, 11:45:48 PM
Hi daydreamer,

1# program
the RND's
sum of random primes :583610108
27
Ms : 125
Ms composites :-71800812
Press any key to continue ...

1# program
the RND's
sum of random primes :583610108
27
Ms : 125
Ms composites :-71843093
Press any key to continue ...   

1# program
the RND's
sum of random primes :583610108
27
Ms : 140
Ms composites :-71870625
Press any key to continue ... 

my timing results are always in two variations 140 - 125, is this normal? What algorithm was taken as a basis? Is it possible to check the randomness of the distribution of numbers?
Title: Re: SSE 128bit randomgenerator(s)
Post by: daydreamer on June 02, 2021, 07:32:37 AM
LiaoMi
The First posted earlier was inspired by Hutch 64bit random pad ,somewhere he had some program that you could test random quality
I had both rdtsc and get milliseconds to randomizer it

Its the usual windows milliseconds clock from startup I use
The later Unrolled 128bit generator Is based on fast simple rnd generator for texture generating



Title: Re: SSE 128bit randomgenerator(s)
Post by: hutch-- on June 12, 2021, 05:58:10 PM
The app you are looking for is called ENT written by John Walker. Its freeware.
Title: Re: SSE 128bit randomgenerator(s)
Post by: daydreamer on June 13, 2021, 04:46:27 AM
Quote from: hutch-- on June 12, 2021, 05:58:10 PM
The app you are looking for is called ENT written by John Walker. Its freeware.
Thanks hutch  :thumbsup:
Is there a way to combine several different rnd generators for quality, instead of quantity?

wish to add one test to rnd generators: randomness/speed ratio

Title: Re: SSE 128bit randomgenerator(s)
Post by: daydreamer on June 18, 2021, 06:38:45 PM
Seem solution to better randomness is right there,looking at low compression ratio for. Primes.inc