[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/28] target/mips: Use FloatRoundMode enum for FCR31 modes co
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 01/28] target/mips: Use FloatRoundMode enum for FCR31 modes conversion |
Date: |
Mon, 23 Nov 2020 21:44:21 +0100 |
Use the FloatRoundMode enum type introduced in commit 3dede407cc6
("softfloat: Name rounding mode enum") instead of 'unsigned int'.
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/internal.h | 3 ++-
target/mips/fpu_helper.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/target/mips/internal.h b/target/mips/internal.h
index dd8a7809b64..bbd10e9d45f 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -225,7 +225,8 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int
size,
uint32_t float_class_s(uint32_t arg, float_status *fst);
uint64_t float_class_d(uint64_t arg, float_status *fst);
-extern unsigned int ieee_rm[];
+extern const FloatRoundMode ieee_rm[4];
+
void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagemask);
static inline void restore_rounding_mode(CPUMIPSState *env)
diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c
index 020b768e87b..501bd401a16 100644
--- a/target/mips/fpu_helper.c
+++ b/target/mips/fpu_helper.c
@@ -42,7 +42,7 @@
#define FP_TO_INT64_OVERFLOW 0x7fffffffffffffffULL
/* convert MIPS rounding mode in FCR31 to IEEE library */
-unsigned int ieee_rm[] = {
+const FloatRoundMode ieee_rm[4] = {
float_round_nearest_even,
float_round_to_zero,
float_round_up,
--
2.26.2
- [PATCH v2 00/28] target/mips: Explode 60% of the 32K-lines translate.c, Philippe Mathieu-Daudé, 2020/11/23
- [PATCH v2 01/28] target/mips: Use FloatRoundMode enum for FCR31 modes conversion,
Philippe Mathieu-Daudé <=
- [PATCH v2 02/28] target/mips: Extract FPU helpers to 'fpu_helper.h', Philippe Mathieu-Daudé, 2020/11/23
- [PATCH v2 03/28] target/mips: Rename msa_helper.c as mod-msa_helper.c, Philippe Mathieu-Daudé, 2020/11/23
- [PATCH v2 04/28] target/mips: Extract MSA helpers from op_helper.c, Philippe Mathieu-Daudé, 2020/11/23
- [PATCH v2 05/28] target/mips: Extract MSA helper definitions, Philippe Mathieu-Daudé, 2020/11/23
- [PATCH v2 06/28] target/mips: Extract MSA translation routines, Philippe Mathieu-Daudé, 2020/11/23
- [PATCH v2 07/28] target/mips: Rename dsp_helper.c as mod-dsp_helper.c, Philippe Mathieu-Daudé, 2020/11/23
- [PATCH v2 08/28] target/mips: Extract DSP helper definitions, Philippe Mathieu-Daudé, 2020/11/23