[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/44] target/mips: Demacro helpers for M<ADD|SUB>F.<D|S>
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 06/44] target/mips: Demacro helpers for M<ADD|SUB>F.<D|S> |
Date: |
Sat, 17 Oct 2020 16:02:05 +0200 |
From: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Remove function definitions via macros to achieve better code clarity.
Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <1602103041-32017-3-git-send-email-aleksandar.qemu.devel@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/fpu_helper.c | 63 +++++++++++++++++++++++++++++-----------
1 file changed, 46 insertions(+), 17 deletions(-)
diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c
index f851723f22d..b3c715494a9 100644
--- a/target/mips/fpu_helper.c
+++ b/target/mips/fpu_helper.c
@@ -1666,25 +1666,54 @@ uint64_t helper_float_nmsub_ps(CPUMIPSState *env,
uint64_t fdt0,
}
-#define FLOAT_FMADDSUB(name, bits, muladd_arg) \
-uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \
- uint ## bits ## _t fs, \
- uint ## bits ## _t ft, \
- uint ## bits ## _t fd) \
-{ \
- uint ## bits ## _t fdret; \
- \
- fdret = float ## bits ## _muladd(fs, ft, fd, muladd_arg, \
- &env->active_fpu.fp_status); \
- update_fcr31(env, GETPC()); \
- return fdret; \
+uint32_t helper_float_maddf_s(CPUMIPSState *env, uint32_t fs,
+ uint32_t ft, uint32_t fd)
+{
+ uint32_t fdret;
+
+ fdret = float32_muladd(fs, ft, fd, 0,
+ &env->active_fpu.fp_status);
+
+ update_fcr31(env, GETPC());
+ return fdret;
+}
+
+uint64_t helper_float_maddf_d(CPUMIPSState *env, uint64_t fs,
+ uint64_t ft, uint64_t fd)
+{
+ uint64_t fdret;
+
+ fdret = float64_muladd(fs, ft, fd, 0,
+ &env->active_fpu.fp_status);
+
+ update_fcr31(env, GETPC());
+ return fdret;
+}
+
+uint32_t helper_float_msubf_s(CPUMIPSState *env, uint32_t fs,
+ uint32_t ft, uint32_t fd)
+{
+ uint32_t fdret;
+
+ fdret = float32_muladd(fs, ft, fd, float_muladd_negate_product,
+ &env->active_fpu.fp_status);
+
+ update_fcr31(env, GETPC());
+ return fdret;
+}
+
+uint64_t helper_float_msubf_d(CPUMIPSState *env, uint64_t fs,
+ uint64_t ft, uint64_t fd)
+{
+ uint64_t fdret;
+
+ fdret = float64_muladd(fs, ft, fd, float_muladd_negate_product,
+ &env->active_fpu.fp_status);
+
+ update_fcr31(env, GETPC());
+ return fdret;
}
-FLOAT_FMADDSUB(maddf_s, 32, 0)
-FLOAT_FMADDSUB(maddf_d, 64, 0)
-FLOAT_FMADDSUB(msubf_s, 32, float_muladd_negate_product)
-FLOAT_FMADDSUB(msubf_d, 64, float_muladd_negate_product)
-#undef FLOAT_FMADDSUB
/* compare operations */
#define FOP_COND_D(op, cond) \
--
2.26.2
- [PULL 00/44] mips-next patches for 2020-10-17, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 01/44] util/cutils: Introduce freq_to_str() to display Hertz units, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 02/44] hw/qdev-clock: Display error hint when clock is missing from device, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 03/44] hw/core/clock: Add the clock_new helper function, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 04/44] target/mips: Fix some comment spelling errors, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 05/44] target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS>, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 06/44] target/mips: Demacro helpers for M<ADD|SUB>F.<D|S>,
Philippe Mathieu-Daudé <=
- [PULL 07/44] target/mips: Demacro helpers for <MAX|MAXA|MIN|MINA>.<D|S>, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 09/44] target/mips: Add loongson-ext lswc2 group of instructions (Part 2), Philippe Mathieu-Daudé, 2020/10/17
- [PULL 11/44] target/mips/op_helper: Convert multiple if() to switch case, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 12/44] target/mips/op_helper: Document Invalidate/Writeback opcodes as no-op, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 08/44] target/mips: Add loongson-ext lswc2 group of instructions (Part 1), Philippe Mathieu-Daudé, 2020/10/17
- [PULL 10/44] target/mips: Add loongson-ext lsdc2 group of instructions, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 13/44] target/mips/op_helper: Log unimplemented cache opcode, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 14/44] target/mips: Move cpu_mips_get_random() with CP0 helpers, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 15/44] target/mips/cp0_timer: Explicit unit in variable name, Philippe Mathieu-Daudé, 2020/10/17
- [PULL 16/44] target/mips/cp0_timer: Document TIMER_PERIOD origin, Philippe Mathieu-Daudé, 2020/10/17