diff options
author | David Hildenbrand <david@redhat.com> | 2019-02-18 13:27:04 +0100 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2019-03-04 11:49:31 +0100 |
commit | b9c737f58e82bf89efaa4a04ab3f730342c06a3a (patch) | |
tree | f559054f7e61040886ecc11497414c75989e0924 /target/s390x/fpu_helper.c | |
parent | 2aea83c6728f5006e07e4f148c2798441683fe86 (diff) |
s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE
Let's split handling of BFP/DFP rounding mode configuration. Also,
let's not reuse the sfpc handler, use a separate handler so we can
properly check for specification exceptions for SRNMB.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-10-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/fpu_helper.c')
-rw-r--r-- | target/s390x/fpu_helper.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c index 4dc70ec60f..ed9c74c420 100644 --- a/target/s390x/fpu_helper.c +++ b/target/s390x/fpu_helper.c @@ -819,3 +819,14 @@ void HELPER(sfas)(CPUS390XState *env, uint64_t fpc) tcg_s390_data_exception(env, s390_exc | 3, GETPC()); } } + +/* set bfp rounding mode */ +void HELPER(srnm)(CPUS390XState *env, uint64_t rnd) +{ + if (rnd > 0x7 || fpc_to_rnd[rnd & 0x7] == -1) { + s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, GETPC()); + } + + env->fpc = deposit32(env->fpc, 0, 3, rnd); + set_float_rounding_mode(fpc_to_rnd[rnd & 0x7], &env->fpu_status); +} |