Hello,
I've been considering the potential benefits of creating a CPU instruction for PRNG, specifically the xoshiro pseudorandom number generators. These instructions are quite simple and could see extensive use, particularly in gaming and software that simulates worlds or environments etc.
For more information on xoshiro PRNG, you can visit: https://prng.di.unimi.it/
Example Instructions for xoshiro256++
Instruction 1: A 256-bit instruction that modifies the following number:
uint64_t s[4];
uint64_t t = s[1] << 17;
s[2] ^= s[0];
s[3] ^= s[1];
s[1] ^= s[2];
s[0] ^= s[3];
s[2] ^= t;
s[3] = rotl(s[3], 45);
Instruction 2: A 256-bit instruction that fills a 64-bit register with a PRN number:
uint64_t result = rotl(s[0] + s[3], 23) + s[0];
There could also be 128-bit and 512-bit variants of these instructions, returning 32-bit and 128-bit PRNs, respectively.