target/mips: Use FloatRoundMode enum for FCR31 modes conversion
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 22 Nov 2020 17:05:25 +0000 (18:05 +0100)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 13 Dec 2020 19:27:11 +0000 (20:27 +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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201123204448.3260804-2-f4bug@amsat.org>

target/mips/fpu_helper.c
target/mips/internal.h

index 956e3417d0f10c18cb63213162c59d2a0b43e6f0..bdb65065ee7b3b96f70f89f4b66615f8fda1fc2e 100644 (file)
@@ -38,7 +38,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,
index 0515966469b9d8187e2fa4e9b565cdec6a5c3733..e4d2d9f44f9ffce697befc9ef4835eca22b8e09d 100644 (file)
@@ -223,7 +223,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)