qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] target/mips: Misc patches
@ 2020-09-08 12:40 Aleksandar Markovic
  2020-09-08 12:40 ` [PATCH 1/4] target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS> Aleksandar Markovic
  0 siblings, 1 reply; 3+ messages in thread
From: Aleksandar Markovic @ 2020-09-08 12:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: aleksandar.rikalo, Aleksandar Markovic, aurelien

A set of several, mostly FP, refactorings and improvements.

Aleksandar Markovic (4):
  target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS>
  target/mips: Demacro helpers for M<ADD|SUB>F.<D|S>
  target/mips: Demacro helpers for <MAX|MAXA|MIN|MINA>.<D|S>
  target/mips: Refactor helpers for fp comparison instructions

 target/mips/fpu_helper.c | 276 +++++++++++++++++++++++++++------------
 1 file changed, 195 insertions(+), 81 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/4] target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS>
  2020-09-08 12:40 [PATCH 0/4] target/mips: Misc patches Aleksandar Markovic
@ 2020-09-08 12:40 ` Aleksandar Markovic
  0 siblings, 0 replies; 3+ messages in thread
From: Aleksandar Markovic @ 2020-09-08 12:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: aleksandar.rikalo, Aleksandar Markovic, aurelien

Remove function definitions via macros to achieve better code clarity.

Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
---
 target/mips/fpu_helper.c | 61 ++++++++++++++++++++++++++--------------
 1 file changed, 40 insertions(+), 21 deletions(-)

diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c
index 7a3a61cab3..f89213947f 100644
--- a/target/mips/fpu_helper.c
+++ b/target/mips/fpu_helper.c
@@ -983,27 +983,46 @@ uint32_t helper_float_floor_2008_w_s(CPUMIPSState *env, uint32_t fst0)
 }
 
 /* unary operations, not modifying fp status  */
-#define FLOAT_UNOP(name)                                       \
-uint64_t helper_float_ ## name ## _d(uint64_t fdt0)                \
-{                                                              \
-    return float64_ ## name(fdt0);                             \
-}                                                              \
-uint32_t helper_float_ ## name ## _s(uint32_t fst0)                \
-{                                                              \
-    return float32_ ## name(fst0);                             \
-}                                                              \
-uint64_t helper_float_ ## name ## _ps(uint64_t fdt0)               \
-{                                                              \
-    uint32_t wt0;                                              \
-    uint32_t wth0;                                             \
-                                                               \
-    wt0 = float32_ ## name(fdt0 & 0XFFFFFFFF);                 \
-    wth0 = float32_ ## name(fdt0 >> 32);                       \
-    return ((uint64_t)wth0 << 32) | wt0;                       \
-}
-FLOAT_UNOP(abs)
-FLOAT_UNOP(chs)
-#undef FLOAT_UNOP
+
+uint64_t helper_float_abs_d(uint64_t fdt0)
+{
+   return float64_abs(fdt0);
+}
+
+uint32_t helper_float_abs_s(uint32_t fst0)
+{
+    return float32_abs(fst0);
+}
+
+uint64_t helper_float_abs_ps(uint64_t fdt0)
+{
+    uint32_t wt0;
+    uint32_t wth0;
+
+    wt0 = float32_abs(fdt0 & 0XFFFFFFFF);
+    wth0 = float32_abs(fdt0 >> 32);
+    return ((uint64_t)wth0 << 32) | wt0;
+}
+
+uint64_t helper_float_chs_d(uint64_t fdt0)
+{
+   return float64_chs(fdt0);
+}
+
+uint32_t helper_float_chs_s(uint32_t fst0)
+{
+    return float32_chs(fst0);
+}
+
+uint64_t helper_float_chs_ps(uint64_t fdt0)
+{
+    uint32_t wt0;
+    uint32_t wth0;
+
+    wt0 = float32_chs(fdt0 & 0XFFFFFFFF);
+    wth0 = float32_chs(fdt0 >> 32);
+    return ((uint64_t)wth0 << 32) | wt0;
+}
 
 /* MIPS specific unary operations */
 uint64_t helper_float_recip_d(CPUMIPSState *env, uint64_t fdt0)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 0/4] target/mips: Misc patches
@ 2020-09-08 12:44 Aleksandar Markovic
  0 siblings, 0 replies; 3+ messages in thread
From: Aleksandar Markovic @ 2020-09-08 12:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: aleksandar.rikalo, Aleksandar Markovic, aurelien

A set of several, mostly FP, refactorings and improvements.

Aleksandar Markovic (4):
  target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS>
  target/mips: Demacro helpers for M<ADD|SUB>F.<D|S>
  target/mips: Demacro helpers for <MAX|MAXA|MIN|MINA>.<D|S>
  target/mips: Refactor helpers for fp comparison instructions

 target/mips/fpu_helper.c | 276 +++++++++++++++++++++++++++------------
 1 file changed, 195 insertions(+), 81 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-08 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 12:40 [PATCH 0/4] target/mips: Misc patches Aleksandar Markovic
2020-09-08 12:40 ` [PATCH 1/4] target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS> Aleksandar Markovic
  -- strict thread matches above, loose matches on Subject: below --
2020-09-08 12:44 [PATCH 0/4] target/mips: Misc patches Aleksandar Markovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).