1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
3 ; RUN: llc %s -o - -mtriple=thumbv8m.main -verify-machineinstrs \
4 ; RUN: -mattr=+fp-armv8d16sp,+fix-cmse-cve-2021-35465 | \
5 ; RUN: FileCheck %s --check-prefix=CHECK-8M-FP-CVE-2021-35465
7 ; RUN: llc %s -o - -mtriple=thumbv8m.main -mcpu=cortex-m33 -verify-machineinstrs | \
8 ; RUN: FileCheck %s --check-prefix=CHECK-8M-FP-CVE-2021-35465
10 ; RUN: llc %s -o - -mtriple=thumbv8m.main -mcpu=cortex-m35p -verify-machineinstrs | \
11 ; RUN: FileCheck %s --check-prefix=CHECK-8M-FP-CVE-2021-35465
13 ; RUN: llc %s -o - -mtriple=thumbv8m.main -verify-machineinstrs \
14 ; RUN: -mattr=-fpregs,+fix-cmse-cve-2021-35465 | \
15 ; RUN: FileCheck %s --check-prefix=CHECK-8M-NOFP-CVE-2021-35465
17 ; RUN: llc %s -o - -mtriple=thumbv8m.main -mcpu=cortex-m33 -mattr=-fpregs -verify-machineinstrs | \
18 ; RUN: FileCheck %s --check-prefix=CHECK-8M-NOFP-CVE-2021-35465
20 ; RUN: llc %s -o - -mtriple=thumbv8m.main -mcpu=cortex-m35p -mattr=-fpregs -verify-machineinstrs | \
21 ; RUN: FileCheck %s --check-prefix=CHECK-8M-NOFP-CVE-2021-35465
23 ; RUN: llc %s -o - -mtriple=thumbv8.1m.main -verify-machineinstrs \
24 ; RUN: -mattr=+fp-armv8d16sp,+fix-cmse-cve-2021-35465 | \
25 ; RUN: FileCheck %s --check-prefix=CHECK-81M-CVE-2021-35465
27 ; RUN: llc %s -o - -mtriple=thumbv8.1m.main -mcpu=cortex-m55 -verify-machineinstrs | \
28 ; RUN: FileCheck %s --check-prefix=CHECK-81M-CVE-2021-35465
30 ; RUN: llc %s -o - -mtriple=thumbv8.1m.main -verify-machineinstrs \
31 ; RUN: -mattr=-fpregs,+fix-cmse-cve-2021-35465 | \
32 ; RUN: FileCheck %s --check-prefix=CHECK-81M-CVE-2021-35465
34 ; RUN: llc %s -o - -mtriple=thumbv8.1m.main -mcpu=cortex-m55 -mattr=-fpregs -verify-machineinstrs | \
35 ; RUN: FileCheck %s --check-prefix=CHECK-81M-CVE-2021-35465
38 define void @non_secure_call(ptr %fptr) {
39 ; CHECK-8M-FP-CVE-2021-35465-LABEL: non_secure_call:
40 ; CHECK-8M-FP-CVE-2021-35465: @ %bb.0:
41 ; CHECK-8M-FP-CVE-2021-35465-NEXT: push {r7, lr}
42 ; CHECK-8M-FP-CVE-2021-35465-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11}
43 ; CHECK-8M-FP-CVE-2021-35465-NEXT: bic r0, r0, #1
44 ; CHECK-8M-FP-CVE-2021-35465-NEXT: sub sp, #136
45 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vlstm sp
46 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r1, r0
47 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r2, r0
48 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r3, r0
49 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r4, r0
50 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r5, r0
51 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r6, r0
52 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r7, r0
53 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r8, r0
54 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r9, r0
55 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r10, r0
56 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r11, r0
57 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r12, r0
58 ; CHECK-8M-FP-CVE-2021-35465-NEXT: msr apsr_nzcvq{{g?}}, r0
59 ; CHECK-8M-FP-CVE-2021-35465-NEXT: blxns r0
60 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mrs r12, control
61 ; CHECK-8M-FP-CVE-2021-35465-NEXT: tst.w r12, #8
62 ; CHECK-8M-FP-CVE-2021-35465-NEXT: it ne
63 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmovne.f32 s0, s0
64 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vlldm sp
65 ; CHECK-8M-FP-CVE-2021-35465-NEXT: add sp, #136
66 ; CHECK-8M-FP-CVE-2021-35465-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11}
67 ; CHECK-8M-FP-CVE-2021-35465-NEXT: pop {r7, pc}
69 ; CHECK-8M-NOFP-CVE-2021-35465-LABEL: non_secure_call:
70 ; CHECK-8M-NOFP-CVE-2021-35465: @ %bb.0:
71 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: push {r7, lr}
72 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11}
73 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: bic r0, r0, #1
74 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: sub sp, #136
75 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: vlstm sp
76 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r1, r0
77 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r2, r0
78 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r3, r0
79 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r4, r0
80 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r5, r0
81 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r6, r0
82 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r7, r0
83 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r8, r0
84 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r9, r0
85 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r10, r0
86 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r11, r0
87 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mov r12, r0
88 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: msr apsr_nzcvq{{g?}}, r0
89 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: blxns r0
90 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: mrs r12, control
91 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: tst.w r12, #8
92 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: it ne
93 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: @APP
94 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: .inst.w 0xeeb00a40
95 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: @NO_APP
96 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: vlldm sp
97 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: add sp, #136
98 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11}
99 ; CHECK-8M-NOFP-CVE-2021-35465-NEXT: pop {r7, pc}
101 ; CHECK-81M-CVE-2021-35465-LABEL: non_secure_call:
102 ; CHECK-81M-CVE-2021-35465: @ %bb.0:
103 ; CHECK-81M-CVE-2021-35465-NEXT: push {r7, lr}
104 ; CHECK-81M-CVE-2021-35465-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11}
105 ; CHECK-81M-CVE-2021-35465-NEXT: bic r0, r0, #1
106 ; CHECK-81M-CVE-2021-35465-NEXT: sub sp, #136
107 ; CHECK-81M-CVE-2021-35465-NEXT: vlstm sp
108 ; CHECK-81M-CVE-2021-35465-NEXT: clrm {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, apsr}
109 ; CHECK-81M-CVE-2021-35465-NEXT: blxns r0
110 ; CHECK-81M-CVE-2021-35465-NEXT: vscclrm {vpr}
111 ; CHECK-81M-CVE-2021-35465-NEXT: vlldm sp
112 ; CHECK-81M-CVE-2021-35465-NEXT: add sp, #136
113 ; CHECK-81M-CVE-2021-35465-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11}
114 ; CHECK-81M-CVE-2021-35465-NEXT: pop {r7, pc}
119 attributes #0 = { "cmse_nonsecure_call" }