1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs < %s | FileCheck %s
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs -stop-after=finalize-isel < %s | FileCheck %s --check-prefix=CHECK-CSRMASK
4 ; Test that the PCS attribute is accepted and uses the correct register mask.
7 define void @test_sme_calling_convention_x0() nounwind {
8 ; CHECK-LABEL: test_sme_calling_convention_x0:
10 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
11 ; CHECK-NEXT: bl __arm_tpidr2_save
12 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
15 ; CHECK-CSRMASK-LABEL: name: test_sme_calling_convention_x0
16 ; CHECK-CSRMASK: BL @__arm_tpidr2_save, csr_aarch64_sme_abi_support_routines_preservemost_from_x0
17 call aarch64_sme_preservemost_from_x0 void @__arm_tpidr2_save()
21 define i64 @test_sme_calling_convention_x2() nounwind {
22 ; CHECK-LABEL: test_sme_calling_convention_x2:
24 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
25 ; CHECK-NEXT: bl __arm_sme_state
26 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
29 ; CHECK-CSRMASK-LABEL: name: test_sme_calling_convention_x2
30 ; CHECK-CSRMASK: BL @__arm_sme_state, csr_aarch64_sme_abi_support_routines_preservemost_from_x2
31 %pstate = call aarch64_sme_preservemost_from_x2 {i64, i64} @__arm_sme_state()
32 %pstate.sm = extractvalue {i64, i64} %pstate, 0
36 declare void @__arm_tpidr2_save()
37 declare {i64, i64} @__arm_sme_state()