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 -float-abi=hard | \
5 ; RUN: FileCheck %s --check-prefix=CHECK-8M-FP-CVE-2021-35465
7 %indirect = type { double, double, double, double, double, double, double, double }
9 define %indirect @func(ptr %fu, float %a, i32 %b, double %c, i32 %d, float %e, i32 %f, float %g, i32 %h, double %i, double %j, double %k, double %l, float %m, float %n) {
10 ; CHECK-8M-FP-CVE-2021-35465-LABEL: func:
11 ; CHECK-8M-FP-CVE-2021-35465: @ %bb.0: @ %entry
12 ; CHECK-8M-FP-CVE-2021-35465-NEXT: push {r7, lr}
13 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov lr, r3
14 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r12, r0
15 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r0, r1
16 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r1, r2
17 ; CHECK-8M-FP-CVE-2021-35465-NEXT: ldr r3, [sp, #8]
18 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mov r2, lr
19 ; CHECK-8M-FP-CVE-2021-35465-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11}
20 ; CHECK-8M-FP-CVE-2021-35465-NEXT: bic r12, r12, #1
21 ; CHECK-8M-FP-CVE-2021-35465-NEXT: sub sp, #136
22 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r4, s5
23 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r11, s0
24 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r9, r10, d1
25 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r8, s1
26 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r7, s4
27 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r5, r6, d3
28 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vlstm sp
29 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov s0, r11
30 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov d1, r9, r10
31 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov s1, r8
32 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov s4, r7
33 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov d3, r5, r6
34 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov s5, r4
35 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vldr d4, [sp, #32]
36 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vldr d5, [sp, #40]
37 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vldr d6, [sp, #48]
38 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vldr s14, [sp, #56]
39 ; CHECK-8M-FP-CVE-2021-35465-NEXT: ldr r4, [sp, #64]
40 ; CHECK-8M-FP-CVE-2021-35465-NEXT: bic r4, r4, #159
41 ; CHECK-8M-FP-CVE-2021-35465-NEXT: bic r4, r4, #4026531840
42 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmsr fpscr, r4
43 ; CHECK-8M-FP-CVE-2021-35465-NEXT: msr apsr_nzcvq, r12
44 ; CHECK-8M-FP-CVE-2021-35465-NEXT: blxns r12
45 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r9, r10, d0
46 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vstr d3, [sp, #24]
47 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r7, r8, d1
48 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vstr d4, [sp, #32]
49 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov r5, r6, d2
50 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vstr d5, [sp, #40]
51 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vstr d6, [sp, #48]
52 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vstr d7, [sp, #56]
53 ; CHECK-8M-FP-CVE-2021-35465-NEXT: mrs r11, control
54 ; CHECK-8M-FP-CVE-2021-35465-NEXT: tst.w r11, #8
55 ; CHECK-8M-FP-CVE-2021-35465-NEXT: it ne
56 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmovne.f32 s0, s0
57 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vlldm sp
58 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov d0, r9, r10
59 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov d1, r7, r8
60 ; CHECK-8M-FP-CVE-2021-35465-NEXT: vmov d2, r5, r6
61 ; CHECK-8M-FP-CVE-2021-35465-NEXT: add sp, #136
62 ; CHECK-8M-FP-CVE-2021-35465-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11}
63 ; CHECK-8M-FP-CVE-2021-35465-NEXT: pop {r7, pc}
65 %res = call %indirect %fu(float %a, i32 %b, double %c, i32 %d, float %e, i32 %f, float %g, i32 %h, double %i, double %j, double %k, double %l, float %m, float %n) #0
69 attributes #0 = { "cmse_nonsecure_call" }