diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2011-04-12 12:54:24 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2011-04-12 12:54:24 +0100 |
commit | dc995461f2ca3d2fb6a04ba1e8d281e8f7b5d958 (patch) | |
tree | f3fd7a4f3bc77fdf7abae8e4bedf6060127857e0 /risu_arm.c | |
parent | 25ef012e1986a6deafcb7803c156d851a46a13da (diff) |
risu: add --test-fp-exc to test FP exception status flags
Add a command line option --test-fp-exc which enables testing
of the cumulative FP exception status flags. This is disabled
by default because qemu gets them wrong a lot and they really
aren't actually that important.
Diffstat (limited to 'risu_arm.c')
-rw-r--r-- | risu_arm.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -127,11 +127,22 @@ static void fill_reginfo_vfp(struct reginfo *ri, ucontext_t *uc) ri->fpregs[i] = *rs++; ri->fpregs[i] |= (uint64_t)(*rs++) << 32; } - /* Ignore the UNK/SBZP bits. Also ignore the cumulative exception - * flags for the moment, because nobody actually cares about them - * and qemu certainly gets them wrong... + /* Ignore the UNK/SBZP bits. We also ignore the cumulative + * exception bits unless we were specifically asked to test + * them on the risu command line -- too much of qemu gets + * them wrong and they aren't actually very important. */ - ri->fpscr = (*rs) & 0xffff9f00; + ri->fpscr = (*rs) & 0xffff9f9f; + if (!test_fp_exc) { + ri->fpscr &= ~0x9f; + } + /* Clear the cumulative exception flags. This is a bit + * unclean, but makes sense because otherwise we'd have to + * insert explicit bit-clearing code in the generated code + * to avoid the test becoming useless once all the bits + * get set. + */ + (*rs) &= ~0x9f; return; } default: |