aboutsummaryrefslogtreecommitdiff
path: root/risu_arm.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-04-12 12:54:24 +0100
committerPeter Maydell <peter.maydell@linaro.org>2011-04-12 12:54:24 +0100
commitdc995461f2ca3d2fb6a04ba1e8d281e8f7b5d958 (patch)
treef3fd7a4f3bc77fdf7abae8e4bedf6060127857e0 /risu_arm.c
parent25ef012e1986a6deafcb7803c156d851a46a13da (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.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/risu_arm.c b/risu_arm.c
index 0d07e81..350a270 100644
--- a/risu_arm.c
+++ b/risu_arm.c
@@ -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: