anchao opened a new pull request, #20833: URL: https://github.com/apache/nuttx/pull/20833
## Summary
Save the ARMv8.1-M MVE VPR register when software synthesizes a user
context through `up_saveusercontext()`.
On ARMv8.1-M, hardware stacks VPR in the reserved word of the
floating-point extended exception frame when the floating-point context is
active. Normal exception entry/return therefore preserves VPR through the
hardware exception frame.
However, `up_saveusercontext()` builds a register context in software
instead of entering through the hardware exception path. Without saving
VPR there, software-created user contexts do not match the hardware
exception frame layout and can lose MVE predicate state.
This change:
- aliases `REG_VPR` to the floating-point extended frame reserved slot
- saves VPR into that slot in `up_saveusercontext()` when MVE is enabled
- leaves normal exception entry/return VPR handling to the hardware
## Impact
- Preserves MVE predicate state for software-created user contexts.
- Keeps the register context layout aligned with the ARMv8.1-M hardware
exception frame.
- Does not add software VPR push/pop to the normal exception path.
- Non-MVE builds are unchanged.
## Testing
Built and ostest successfully with:
- `ek-ra8m1:nsh`
- `mps3-an547:nsh`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
