diff options
author | Damien George <damien.p.george@gmail.com> | 2019-06-17 23:19:34 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-06-19 14:53:17 +1000 |
commit | 34c04d2319cdfae01ed7bf7f9e341d69b86d751a (patch) | |
tree | 6d892dafc9c9cca8fc04c96141625107867518a9 /py/nlr.h | |
parent | 3ee3995be1c6c461110d7908498777241e08a76a (diff) |
py/nlrthumb: Save and restore VFP registers s16-s21 when CPU has them.
These s16-s21 registers are used by gcc so need to be saved. Future
versions of gcc (beyond v9.1.0), or other compilers, may eventually need
additional registers saved/restored.
See issue #4844.
Diffstat (limited to 'py/nlr.h')
-rw-r--r-- | py/nlr.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -54,7 +54,14 @@ #endif #elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__) #define MICROPY_NLR_THUMB (1) - #define MICROPY_NLR_NUM_REGS (10) + #if defined(__SOFTFP__) + #define MICROPY_NLR_NUM_REGS (10) + #else + // With hardware FP registers s16-s31 are callee save so in principle + // should be saved and restored by the NLR code. gcc only uses s16-s21 + // so only save/restore those as an optimisation. + #define MICROPY_NLR_NUM_REGS (10 + 6) + #endif #elif defined(__xtensa__) #define MICROPY_NLR_XTENSA (1) #define MICROPY_NLR_NUM_REGS (10) |