1 ; RUN: llc < %s -mtriple=aarch64 -mcpu=cortex-a57 2>&1 | FileCheck %s
3 define i64 @read_encoded_register() nounwind {
5 ; CHECK-LABEL: read_encoded_register:
6 ; CHECK: mrs x0, S1_2_C3_C4_5
7 %reg = call i64 @llvm.read_register.i64(metadata !0)
11 define i64 @read_daif() nounwind {
13 ; CHECK-LABEL: read_daif:
15 %reg = call i64 @llvm.read_register.i64(metadata !1)
19 define void @write_encoded_register(i64 %x) nounwind {
21 ; CHECK-LABEL: write_encoded_register:
22 ; CHECK: msr S1_2_C3_C4_5, x0
23 call void @llvm.write_register.i64(metadata !0, i64 %x)
27 define void @write_daif(i64 %x) nounwind {
29 ; CHECK-LABEL: write_daif:
31 call void @llvm.write_register.i64(metadata !1, i64 %x)
35 define void @write_daifset() nounwind {
37 ; CHECK-LABEL: write_daifset:
38 ; CHECK: msr DAIFSet, #2
39 call void @llvm.write_register.i64(metadata !2, i64 2)
43 declare i64 @llvm.read_register.i64(metadata) nounwind
44 declare void @llvm.write_register.i64(metadata, i64) nounwind