1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64 -mattr=+v8.5a,+rand %s -o - | FileCheck %s
4 define i32 @rndr(ptr %__addr) {
7 ; CHECK-NEXT: mrs x10, RNDR
8 ; CHECK-NEXT: mov x9, x0
9 ; CHECK-NEXT: cset w8, eq
10 ; CHECK-NEXT: str x10, [x9]
11 ; CHECK-NEXT: and w8, w8, #0x1
12 ; CHECK-NEXT: mov w0, w8
14 %1 = tail call { i64, i1 } @llvm.aarch64.rndr()
15 %2 = extractvalue { i64, i1 } %1, 0
16 %3 = extractvalue { i64, i1 } %1, 1
17 store i64 %2, ptr %__addr, align 8
18 %4 = zext i1 %3 to i32
23 define i32 @rndrrs(ptr %__addr) {
24 ; CHECK-LABEL: rndrrs:
26 ; CHECK-NEXT: mrs x10, RNDRRS
27 ; CHECK-NEXT: mov x9, x0
28 ; CHECK-NEXT: cset w8, eq
29 ; CHECK-NEXT: str x10, [x9]
30 ; CHECK-NEXT: and w8, w8, #0x1
31 ; CHECK-NEXT: mov w0, w8
33 %1 = tail call { i64, i1 } @llvm.aarch64.rndrrs()
34 %2 = extractvalue { i64, i1 } %1, 0
35 %3 = extractvalue { i64, i1 } %1, 1
36 store i64 %2, ptr %__addr, align 8
37 %4 = zext i1 %3 to i32
41 declare { i64, i1 } @llvm.aarch64.rndr()
42 declare { i64, i1 } @llvm.aarch64.rndrrs()