HomePhabricator

[AArch64] Implement __rndr, __rndrrs intrinsics

Authored by stelios-arm on Mar 9 2021, 6:56 AM.

Description

[AArch64] Implement rndr, rndrrs intrinsics

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

Differential Revision: https://reviews.llvm.org/D98264

Change-Id: I8f92e7bf5b450e5da3e59943b53482edf0df6efc

Details

Committed
stelios-armMar 15 2021, 10:51 AM
Differential Revision
D98264: [AArch64] Implement __rndr, __rndrrs intrinsics
Parents
rGb868a3edad9d: [mlir] fix SPIR-V CPU and Vulkan runners after…
Branches
Unknown
Tags
Unknown