From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Aleksandar Rikalo" <arikalo@wavecomp.com>,
"Riku Voipio" <riku.voipio@iki.fi>,
armbru@redhat.com, "Laurent Vivier" <laurent@vivier.eu>,
"Aleksandar Markovic" <amarkovic@wavecomp.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH v2 5/7] target/mips: rationalise softfloat includes
Date: Fri, 9 Aug 2019 10:19:38 +0100 [thread overview]
Message-ID: <20190809091940.1223-6-alex.bennee@linaro.org> (raw)
In-Reply-To: <20190809091940.1223-1-alex.bennee@linaro.org>
We should avoid including the whole of softfloat headers in cpu.h and
explicitly include it only where we will be calling softfloat
functions. We can use the -types.h in cpu.h for the few bits that are
global. We also move the restore_snan_bit_mode into internal.h and
include -helpers.h there.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
v2
- move restore_snan_bit_mode to internal.h
---
linux-user/mips/cpu_loop.c | 1 +
target/mips/cpu.h | 8 +-------
target/mips/internal.h | 7 +++++++
target/mips/msa_helper.c | 1 +
target/mips/op_helper.c | 1 +
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
index 0ba894fa7aa..39915b3fde2 100644
--- a/linux-user/mips/cpu_loop.c
+++ b/linux-user/mips/cpu_loop.c
@@ -22,6 +22,7 @@
#include "qemu.h"
#include "cpu_loop-common.h"
#include "elf.h"
+#include "internal.h"
# ifdef TARGET_ABI_MIPSO32
# define MIPS_SYS(name, args) args,
diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index 21c0615e020..d235117dab3 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -5,7 +5,7 @@
#include "cpu-qom.h"
#include "exec/cpu-defs.h"
-#include "fpu/softfloat.h"
+#include "fpu/softfloat-types.h"
#include "mips-defs.h"
#define TCG_GUEST_DEFAULT_MO (0)
@@ -1195,12 +1195,6 @@ void itc_reconfigure(struct MIPSITUState *tag);
/* helper.c */
target_ulong exception_resume_pc(CPUMIPSState *env);
-static inline void restore_snan_bit_mode(CPUMIPSState *env)
-{
- set_snan_bit_is_one((env->active_fpu.fcr31 & (1 << FCR31_NAN2008)) == 0,
- &env->active_fpu.fp_status);
-}
-
static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
target_ulong *cs_base, uint32_t *flags)
{
diff --git a/target/mips/internal.h b/target/mips/internal.h
index b2b41a51ab4..49a7a7d8f56 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -7,6 +7,7 @@
#ifndef MIPS_INTERNAL_H
#define MIPS_INTERNAL_H
+#include "fpu/softfloat-helpers.h"
/* MMU types, the first four entries have the same layout as the
CP0C0_MT field. */
@@ -226,6 +227,12 @@ static inline void restore_flush_mode(CPUMIPSState *env)
&env->active_fpu.fp_status);
}
+static inline void restore_snan_bit_mode(CPUMIPSState *env)
+{
+ set_snan_bit_is_one((env->active_fpu.fcr31 & (1 << FCR31_NAN2008)) == 0,
+ &env->active_fpu.fp_status);
+}
+
static inline void restore_fp_status(CPUMIPSState *env)
{
restore_rounding_mode(env);
diff --git a/target/mips/msa_helper.c b/target/mips/msa_helper.c
index a5a86572b4a..f24061e2af7 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -22,6 +22,7 @@
#include "internal.h"
#include "exec/exec-all.h"
#include "exec/helper-proto.h"
+#include "fpu/softfloat.h"
/* Data format min and max values */
#define DF_BITS(df) (1 << ((df) + 3))
diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index 9e2e02f8586..f88a3ab9043 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -25,6 +25,7 @@
#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
#include "sysemu/kvm.h"
+#include "fpu/softfloat.h"
/*****************************************************************************/
/* Exceptions processing helpers */
--
2.20.1
next prev parent reply other threads:[~2019-08-09 9:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 9:19 [Qemu-devel] [PATCH v2 0/7] softfloat includes cleanup Alex Bennée
2019-08-09 9:19 ` [Qemu-devel] [PATCH v2 1/7] fpu: move LIT64 helper to softfloat-types Alex Bennée
2019-08-09 9:19 ` [Qemu-devel] [PATCH v2 2/7] fpu: move inline helpers into a separate header Alex Bennée
2019-08-09 9:19 ` [Qemu-devel] [PATCH v2 3/7] fpu: make softfloat-macros "self-contained" Alex Bennée
2019-08-09 9:19 ` [Qemu-devel] [PATCH v2 4/7] fpu: rename softfloat-specialize.h -> .inc.c Alex Bennée
2019-08-09 9:19 ` Alex Bennée [this message]
2019-08-09 10:20 ` [Qemu-devel] [PATCH v2 5/7] target/mips: rationalise softfloat includes Aleksandar Markovic
2019-08-09 9:19 ` [Qemu-devel] [PATCH v2 6/7] target/riscv: " Alex Bennée
2019-08-10 1:55 ` Alistair Francis
2019-08-13 23:30 ` Palmer Dabbelt
2019-08-14 9:19 ` Alex Bennée
2019-08-09 9:19 ` [Qemu-devel] [PATCH v2 7/7] targets (various): use softfloat-helpers.h where we can Alex Bennée
2019-08-09 9:34 ` [Qemu-devel] [PATCH v2 0/7] softfloat includes cleanup Philippe Mathieu-Daudé
2019-08-09 9:36 ` no-reply
2019-08-09 9:47 ` no-reply
2019-08-09 10:00 ` no-reply
2019-08-09 10:13 ` no-reply
2019-08-09 10:34 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190809091940.1223-6-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=amarkovic@wavecomp.com \
--cc=arikalo@wavecomp.com \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).