News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

SSE 128bit randomgenerator(s)

Started by daydreamer, June 28, 2019, 02:20:58 AM

Previous topic - Next topic

daydreamer

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

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?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

#2
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?





my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

mineiro


$ 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 ..
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

HSE

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 ...
Equations in Assembly: SmplMath

daydreamer

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

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

HSE

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
Equations in Assembly: SmplMath

daydreamer

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



my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

LiaoMi

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?

daydreamer

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



my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

The app you are looking for is called ENT written by John Walker. Its freeware.

daydreamer

#12
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

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

Seem solution to better randomness is right there,looking at low compression ratio for. Primes.inc
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding