Commit 7e31dc6
committed
feat: restore Lazy FPU stacking without assembly macros
Reintroduce the Lazy FPU stacking optimization while preserving the
reviewer-requested assembly style:
- no tx_port.h include from .S files
- no STORE/LOAD/REGBYTES abstractions
- stack offsets remain hardcoded as in the upstream RISC-V32 GNU port
The optimization records mstatus in the interrupt stack frame and
checks the FS field before saving/restoring floating point state. If
FS is Off, FP register and fcsr save/restore are skipped. If FS is
Initial/Clean/Dirty, the existing FP context path is used.
This touches only tx_thread_context_save.S and
tx_thread_context_restore.S, and credits Wei-Chen Lai in the AUTHOR
blocks for those Lazy FPU changes.1 parent 08d2bea commit 7e31dc6
2 files changed
Lines changed: 46 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| 140 | + | |
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
| |||
222 | 230 | | |
223 | 231 | | |
224 | 232 | | |
225 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
| |||
270 | 284 | | |
271 | 285 | | |
272 | 286 | | |
| 287 | + | |
273 | 288 | | |
274 | 289 | | |
275 | 290 | | |
| |||
331 | 346 | | |
332 | 347 | | |
333 | 348 | | |
334 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
335 | 356 | | |
336 | 357 | | |
337 | 358 | | |
| |||
359 | 380 | | |
360 | 381 | | |
361 | 382 | | |
| 383 | + | |
362 | 384 | | |
363 | 385 | | |
364 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
| |||
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
| 157 | + | |
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
150 | 161 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| |||
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
193 | 209 | | |
194 | 210 | | |
195 | 211 | | |
| |||
238 | 254 | | |
239 | 255 | | |
240 | 256 | | |
| 257 | + | |
241 | 258 | | |
242 | 259 | | |
243 | 260 | | |
244 | 261 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | 262 | | |
249 | 263 | | |
250 | 264 | | |
| |||
0 commit comments