mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-08 16:07:39 -06:00
target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS>
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-2-git-send-email-aleksandar.qemu.devel@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
8cdf88690d
commit
8a6c9e0fdd
1 changed files with 39 additions and 20 deletions
|
@ -983,27 +983,46 @@ uint32_t helper_float_floor_2008_w_s(CPUMIPSState *env, uint32_t fst0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unary operations, not modifying fp status */
|
/* unary operations, not modifying fp status */
|
||||||
#define FLOAT_UNOP(name) \
|
|
||||||
uint64_t helper_float_ ## name ## _d(uint64_t fdt0) \
|
uint64_t helper_float_abs_d(uint64_t fdt0)
|
||||||
{ \
|
{
|
||||||
return float64_ ## name(fdt0); \
|
return float64_abs(fdt0);
|
||||||
} \
|
}
|
||||||
uint32_t helper_float_ ## name ## _s(uint32_t fst0) \
|
|
||||||
{ \
|
uint32_t helper_float_abs_s(uint32_t fst0)
|
||||||
return float32_ ## name(fst0); \
|
{
|
||||||
} \
|
return float32_abs(fst0);
|
||||||
uint64_t helper_float_ ## name ## _ps(uint64_t fdt0) \
|
}
|
||||||
{ \
|
|
||||||
uint32_t wt0; \
|
uint64_t helper_float_abs_ps(uint64_t fdt0)
|
||||||
uint32_t wth0; \
|
{
|
||||||
\
|
uint32_t wt0;
|
||||||
wt0 = float32_ ## name(fdt0 & 0XFFFFFFFF); \
|
uint32_t wth0;
|
||||||
wth0 = float32_ ## name(fdt0 >> 32); \
|
|
||||||
return ((uint64_t)wth0 << 32) | wt0; \
|
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;
|
||||||
}
|
}
|
||||||
FLOAT_UNOP(abs)
|
|
||||||
FLOAT_UNOP(chs)
|
|
||||||
#undef FLOAT_UNOP
|
|
||||||
|
|
||||||
/* MIPS specific unary operations */
|
/* MIPS specific unary operations */
|
||||||
uint64_t helper_float_recip_d(CPUMIPSState *env, uint64_t fdt0)
|
uint64_t helper_float_recip_d(CPUMIPSState *env, uint64_t fdt0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue