1
- ; RUN: llc < %s -mtriple aarch64-none-linux-gnu -mattr=+sme2 -force-streaming - stop-after=finalize-isel | FileCheck %s
1
+ ; RUN: llc < %s -mtriple aarch64-none-linux-gnu -stop-after=finalize-isel | FileCheck %s
2
2
3
- define void @UphPNR (target ("aarch64.svcount" ) %predcnt ) {
3
+ define void @UphPNR (target ("aarch64.svcount" ) %predcnt ) "target-features" = "+sme2" "aarch64_pstate_sm_enabled" {
4
4
entry:
5
5
; CHECK: %0:ppr = COPY $p0
6
6
; CHECK: STR_PXI %0, %stack.0.predcnt.addr, 0 :: (store (<vscale x 1 x s16>) into %ir.predcnt.addr)
14
14
ret void
15
15
}
16
16
17
- define void @UpaPNR (target ("aarch64.svcount" ) %predcnt ) {
17
+ define void @UpaPNR (target ("aarch64.svcount" ) %predcnt ) "target-features" = "+sme2" "aarch64_pstate_sm_enabled" {
18
18
entry:
19
19
; CHECK: %0:ppr = COPY $p0
20
20
; CHECK: STR_PXI %0, %stack.0.predcnt.addr, 0 :: (store (<vscale x 1 x s16>) into %ir.predcnt.addr)
28
28
ret void
29
29
}
30
30
31
- define void @UplPNR (target ("aarch64.svcount" ) %predcnt ) {
31
+ define void @UplPNR (target ("aarch64.svcount" ) %predcnt ) "target-features" = "+sme2" "aarch64_pstate_sm_enabled" {
32
32
entry:
33
33
; CHECK: %0:ppr = COPY $p0
34
34
; CHECK: STR_PXI %0, %stack.0.predcnt.addr, 0 :: (store (<vscale x 1 x s16>) into %ir.predcnt.addr)
@@ -41,3 +41,86 @@ entry:
41
41
call void asm sideeffect "fadd z0.h, $0/m, z0.h, #0.5" , "@3Upl" (target ("aarch64.svcount" ) %0 )
42
42
ret void
43
43
}
44
+
45
+ ; Test that the z-register clobbers result in preserving %0 across the inline asm call.
46
+ define <2 x float > @sme_nosve_nonstreaming (ptr %in ) "target-features" ="+sme,-sve" {
47
+ entry:
48
+ ; CHECK-LABEL: name: sme_nosve_nonstreaming
49
+ ; CHECK: INLINEASM &"smstart sm; smstop sm;"
50
+ ; CHECK-SAME: implicit-def early-clobber $q0
51
+ ; CHECK-SAME: implicit-def early-clobber $q1
52
+ ; CHECK-SAME: implicit-def early-clobber $q2
53
+ ; CHECK-SAME: implicit-def early-clobber $q3
54
+ ; CHECK-SAME: implicit-def early-clobber $q4
55
+ ; CHECK-SAME: implicit-def early-clobber $q5
56
+ ; CHECK-SAME: implicit-def early-clobber $q6
57
+ ; CHECK-SAME: implicit-def early-clobber $q7
58
+ ; CHECK-SAME: implicit-def early-clobber $q8
59
+ ; CHECK-SAME: implicit-def early-clobber $q9
60
+ ; CHECK-SAME: implicit-def early-clobber $q10
61
+ ; CHECK-SAME: implicit-def early-clobber $q11
62
+ ; CHECK-SAME: implicit-def early-clobber $q12
63
+ ; CHECK-SAME: implicit-def early-clobber $q13
64
+ ; CHECK-SAME: implicit-def early-clobber $q14
65
+ ; CHECK-SAME: implicit-def early-clobber $q15
66
+ ; CHECK-SAME: implicit-def early-clobber $q16
67
+ ; CHECK-SAME: implicit-def early-clobber $q17
68
+ ; CHECK-SAME: implicit-def early-clobber $q18
69
+ ; CHECK-SAME: implicit-def early-clobber $q19
70
+ ; CHECK-SAME: implicit-def early-clobber $q20
71
+ ; CHECK-SAME: implicit-def early-clobber $q21
72
+ ; CHECK-SAME: implicit-def early-clobber $q22
73
+ ; CHECK-SAME: implicit-def early-clobber $q23
74
+ ; CHECK-SAME: implicit-def early-clobber $q24
75
+ ; CHECK-SAME: implicit-def early-clobber $q25
76
+ ; CHECK-SAME: implicit-def early-clobber $q26
77
+ ; CHECK-SAME: implicit-def early-clobber $q27
78
+ ; CHECK-SAME: implicit-def early-clobber $q28
79
+ ; CHECK-SAME: implicit-def early-clobber $q29
80
+ ; CHECK-SAME: implicit-def early-clobber $q30
81
+ ; CHECK-SAME: implicit-def early-clobber $q31
82
+ %0 = load <2 x float >, ptr %in , align 8
83
+ call void asm sideeffect "smstart sm; smstop sm;" , "~{z0},~{z1},~{z2},~{z3},~{z4},~{z5},~{z6},~{z7},~{z8},~{z9},~{z10},~{z11},~{z12},~{z13},~{z14},~{z15},~{z16},~{z17},~{z18},~{z19},~{z20},~{z21},~{z22},~{z23},~{z24},~{z25},~{z26},~{z27},~{z28},~{z29},~{z30},~{z31}" ()
84
+ ret <2 x float > %0
85
+ }
86
+
87
+ define <2 x float > @sme_nosve_streaming (ptr %in ) "target-features" ="+sme,-sve" "aarch64_pstate_sm_enabled" {
88
+ entry:
89
+ ; CHECK-LABEL: name: sme_nosve_streaming
90
+ ; CHECK: INLINEASM &"smstart sm; smstop sm;"
91
+ ; CHECK-SAME: implicit-def early-clobber $z0
92
+ ; CHECK-SAME: implicit-def early-clobber $z1
93
+ ; CHECK-SAME: implicit-def early-clobber $z2
94
+ ; CHECK-SAME: implicit-def early-clobber $z3
95
+ ; CHECK-SAME: implicit-def early-clobber $z4
96
+ ; CHECK-SAME: implicit-def early-clobber $z5
97
+ ; CHECK-SAME: implicit-def early-clobber $z6
98
+ ; CHECK-SAME: implicit-def early-clobber $z7
99
+ ; CHECK-SAME: implicit-def early-clobber $z8
100
+ ; CHECK-SAME: implicit-def early-clobber $z9
101
+ ; CHECK-SAME: implicit-def early-clobber $z10
102
+ ; CHECK-SAME: implicit-def early-clobber $z11
103
+ ; CHECK-SAME: implicit-def early-clobber $z12
104
+ ; CHECK-SAME: implicit-def early-clobber $z13
105
+ ; CHECK-SAME: implicit-def early-clobber $z14
106
+ ; CHECK-SAME: implicit-def early-clobber $z15
107
+ ; CHECK-SAME: implicit-def early-clobber $z16
108
+ ; CHECK-SAME: implicit-def early-clobber $z17
109
+ ; CHECK-SAME: implicit-def early-clobber $z18
110
+ ; CHECK-SAME: implicit-def early-clobber $z19
111
+ ; CHECK-SAME: implicit-def early-clobber $z20
112
+ ; CHECK-SAME: implicit-def early-clobber $z21
113
+ ; CHECK-SAME: implicit-def early-clobber $z22
114
+ ; CHECK-SAME: implicit-def early-clobber $z23
115
+ ; CHECK-SAME: implicit-def early-clobber $z24
116
+ ; CHECK-SAME: implicit-def early-clobber $z25
117
+ ; CHECK-SAME: implicit-def early-clobber $z26
118
+ ; CHECK-SAME: implicit-def early-clobber $z27
119
+ ; CHECK-SAME: implicit-def early-clobber $z28
120
+ ; CHECK-SAME: implicit-def early-clobber $z29
121
+ ; CHECK-SAME: implicit-def early-clobber $z30
122
+ ; CHECK-SAME: implicit-def early-clobber $z31
123
+ %0 = load <2 x float >, ptr %in , align 8
124
+ call void asm sideeffect "smstart sm; smstop sm;" , "~{z0},~{z1},~{z2},~{z3},~{z4},~{z5},~{z6},~{z7},~{z8},~{z9},~{z10},~{z11},~{z12},~{z13},~{z14},~{z15},~{z16},~{z17},~{z18},~{z19},~{z20},~{z21},~{z22},~{z23},~{z24},~{z25},~{z26},~{z27},~{z28},~{z29},~{z30},~{z31}" ()
125
+ ret <2 x float > %0
126
+ }
0 commit comments