This patch implements the __rndr and __rndrrs intrinsics to provide access to the random number instructions introduced in Armv8.5-A. They are only defined for the AArch64 execution state and are available when __ARM_FEATURE_RNG is defined.
These intrinsics store the random number in their pointer argument and return a status code if the generation succeeded. The difference between __rndr and __rndrrs, is that the latter intrinsic reseeds the random number generator.
The instructions write the NZCV flags indicating the success of the operation that we can then read with a CSET.
[1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics
[2] https://bugs.llvm.org/show_bug.cgi?id=47838
Where/when is HasRandGen set?