1; RUN: llc < %s -mtriple=aarch64-none-eabi -mcpu=cortex-a57 2>&1 | FileCheck %s 2 3define i64 @read_encoded_register() nounwind { 4entry: 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) 8 ret i64 %reg 9} 10 11define i64 @read_daif() nounwind { 12entry: 13; CHECK-LABEL: read_daif: 14; CHECK: mrs x0, DAIF 15 %reg = call i64 @llvm.read_register.i64(metadata !1) 16 ret i64 %reg 17} 18 19define void @write_encoded_register(i64 %x) nounwind { 20entry: 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) 24 ret void 25} 26 27define void @write_daif(i64 %x) nounwind { 28entry: 29; CHECK-LABEL: write_daif: 30; CHECK: msr DAIF, x0 31 call void @llvm.write_register.i64(metadata !1, i64 %x) 32 ret void 33} 34 35define void @write_daifset() nounwind { 36entry: 37; CHECK-LABEL: write_daifset: 38; CHECK: msr DAIFSet, #2 39 call void @llvm.write_register.i64(metadata !2, i64 2) 40 ret void 41} 42 43declare i64 @llvm.read_register.i64(metadata) nounwind 44declare void @llvm.write_register.i64(metadata, i64) nounwind 45 46!0 = !{!"1:2:3:4:5"} 47!1 = !{!"daif"} 48!2 = !{!"daifset"} 49