[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v1 06/15] s390x/tcg: Refactor SET FPC AND SIGNAL han
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v1 06/15] s390x/tcg: Refactor SET FPC AND SIGNAL handling |
Date: |
Tue, 12 Feb 2019 12:02:59 +0100 |
We can directly work on the uint64_t value, no need for a temporary
uint32_t value.
Also cleanup and shorten the comments.
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/fpu_helper.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c
index 2e690073ea..7c39829352 100644
--- a/target/s390x/fpu_helper.c
+++ b/target/s390x/fpu_helper.c
@@ -820,21 +820,23 @@ void HELPER(sfpc)(CPUS390XState *env, uint64_t fpc)
}
/* set fpc and signal */
-void HELPER(sfas)(CPUS390XState *env, uint64_t val)
+void HELPER(sfas)(CPUS390XState *env, uint64_t fpc)
{
uint32_t signalling = env->fpc;
- uint32_t source = val;
uint32_t s390_exc;
- /* The contents of the source operand are placed in the FPC register;
- then the flags in the FPC register are set to the logical OR of the
- signalling flags and the source flags. */
- env->fpc = source | (signalling & 0x00ff0000);
- set_float_rounding_mode(fpc_to_rnd[source & 3], &env->fpu_status);
+ /*
+ * FPC is set to the FPC operand with a bitwise OR of the signalling
+ * flags.
+ */
+ env->fpc = fpc | (signalling & 0x00ff0000);
+ set_float_rounding_mode(fpc_to_rnd[fpc & 3], &env->fpu_status);
- /* If any signalling flag is 1 and the corresponding source mask
- is also 1, a simulated-iee-exception trap occurs. */
- s390_exc = (signalling >> 16) & (source >> 24);
+ /*
+ * If any signaling flag is enabled in the new FPC mask, a
+ * simulated-iee-exception exception occurs.
+ */
+ s390_exc = (signalling >> 16) & (fpc >> 24);
if (s390_exc) {
tcg_s390_data_exception(env, s390_exc | 3, GETPC());
}
--
2.17.2
- [qemu-s390x] [PATCH v1] s390x: Add floating-point extension facility to "qemu" cpu model, David Hildenbrand, 2019/02/12
- [qemu-s390x] [PATCH v1 00/15] s390x/tcg: Implement floating-point extension facility, David Hildenbrand, 2019/02/12
- [qemu-s390x] [PATCH v1 04/15] s390x/tcg: Fix parts of IEEE exception handling, David Hildenbrand, 2019/02/12
- [qemu-s390x] [PATCH v1 05/15] s390x/tcg: Hide IEEE underflows in some scenarios, David Hildenbrand, 2019/02/12
- [qemu-s390x] [PATCH v1 06/15] s390x/tcg: Refactor SET FPC AND SIGNAL handling,
David Hildenbrand <=
- [qemu-s390x] [PATCH v1 01/15] s390x/tcg: Fix TEST DATA CLASS instructions, David Hildenbrand, 2019/02/12
- [qemu-s390x] [PATCH v1 03/15] s390x/tcg: Factor out conversion of softfloat exceptions, David Hildenbrand, 2019/02/12
- [qemu-s390x] [PATCH v1 07/15] s390x/tcg: Fix simulated-IEEE exceptions, David Hildenbrand, 2019/02/12
- [qemu-s390x] [PATCH v1 09/15] s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE, David Hildenbrand, 2019/02/12