qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 10/26] target/arm: Make functions used by translate-vfp global
Date: Mon, 10 May 2021 13:25:32 +0100	[thread overview]
Message-ID: <20210510122548.28638-11-peter.maydell@linaro.org> (raw)
In-Reply-To: <20210510122548.28638-1-peter.maydell@linaro.org>

Make the remaining functions which are needed by translate-vfp.c.inc
global.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210430132740.10391-8-peter.maydell@linaro.org
---
 target/arm/translate-a32.h | 18 ++++++++++++++++++
 target/arm/translate.c     | 25 ++++++++-----------------
 2 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/target/arm/translate-a32.h b/target/arm/translate-a32.h
index 522aa83636a..326cbafe996 100644
--- a/target/arm/translate-a32.h
+++ b/target/arm/translate-a32.h
@@ -30,6 +30,13 @@ void read_neon_element32(TCGv_i32 dest, int reg, int ele, MemOp memop);
 void read_neon_element64(TCGv_i64 dest, int reg, int ele, MemOp memop);
 void write_neon_element32(TCGv_i32 src, int reg, int ele, MemOp memop);
 void write_neon_element64(TCGv_i64 src, int reg, int ele, MemOp memop);
+TCGv_i32 add_reg_for_lit(DisasContext *s, int reg, int ofs);
+void gen_set_cpsr(TCGv_i32 var, uint32_t mask);
+void gen_set_condexec(DisasContext *s);
+void gen_set_pc_im(DisasContext *s, target_ulong val);
+void gen_lookup_tb(DisasContext *s);
+long vfp_reg_offset(bool dp, unsigned reg);
+long neon_full_reg_offset(unsigned reg);
 
 static inline TCGv_i32 load_cpu_offset(int offset)
 {
@@ -57,6 +64,8 @@ static inline TCGv_i32 load_reg(DisasContext *s, int reg)
     return tmp;
 }
 
+void store_reg(DisasContext *s, int reg, TCGv_i32 var);
+
 void gen_aa32_ld_internal_i32(DisasContext *s, TCGv_i32 val,
                               TCGv_i32 a32, int index, MemOp opc);
 void gen_aa32_st_internal_i32(DisasContext *s, TCGv_i32 val,
@@ -110,4 +119,13 @@ DO_GEN_ST(32, MO_UL)
 #undef DO_GEN_LD
 #undef DO_GEN_ST
 
+#if defined(CONFIG_USER_ONLY)
+#define IS_USER(s) 1
+#else
+#define IS_USER(s) (s->user)
+#endif
+
+/* Set NZCV flags from the high 4 bits of var.  */
+#define gen_set_nzcv(var) gen_set_cpsr(var, CPSR_NZCV)
+
 #endif
diff --git a/target/arm/translate.c b/target/arm/translate.c
index c8b9cedfcfd..c83f2205b67 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -52,12 +52,6 @@
 #include "translate.h"
 #include "translate-a32.h"
 
-#if defined(CONFIG_USER_ONLY)
-#define IS_USER(s) 1
-#else
-#define IS_USER(s) (s->user)
-#endif
-
 /* These are TCG temporaries used only by the legacy iwMMXt decoder */
 static TCGv_i64 cpu_V0, cpu_V1, cpu_M0;
 /* These are TCG globals which alias CPUARMState fields */
@@ -209,7 +203,7 @@ void load_reg_var(DisasContext *s, TCGv_i32 var, int reg)
  * This is used for load/store for which use of PC implies (literal),
  * or ADD that implies ADR.
  */
-static TCGv_i32 add_reg_for_lit(DisasContext *s, int reg, int ofs)
+TCGv_i32 add_reg_for_lit(DisasContext *s, int reg, int ofs)
 {
     TCGv_i32 tmp = tcg_temp_new_i32();
 
@@ -223,7 +217,7 @@ static TCGv_i32 add_reg_for_lit(DisasContext *s, int reg, int ofs)
 
 /* Set a CPU register.  The source must be a temporary and will be
    marked as dead.  */
-static void store_reg(DisasContext *s, int reg, TCGv_i32 var)
+void store_reg(DisasContext *s, int reg, TCGv_i32 var)
 {
     if (reg == 15) {
         /* In Thumb mode, we must ignore bit 0.
@@ -264,15 +258,12 @@ static void store_sp_checked(DisasContext *s, TCGv_i32 var)
 #define gen_sxtb16(var) gen_helper_sxtb16(var, var)
 #define gen_uxtb16(var) gen_helper_uxtb16(var, var)
 
-
-static inline void gen_set_cpsr(TCGv_i32 var, uint32_t mask)
+void gen_set_cpsr(TCGv_i32 var, uint32_t mask)
 {
     TCGv_i32 tmp_mask = tcg_const_i32(mask);
     gen_helper_cpsr_write(cpu_env, var, tmp_mask);
     tcg_temp_free_i32(tmp_mask);
 }
-/* Set NZCV flags from the high 4 bits of var.  */
-#define gen_set_nzcv(var) gen_set_cpsr(var, CPSR_NZCV)
 
 static void gen_exception_internal(int excp)
 {
@@ -697,7 +688,7 @@ void arm_gen_test_cc(int cc, TCGLabel *label)
     arm_free_cc(&cmp);
 }
 
-static inline void gen_set_condexec(DisasContext *s)
+void gen_set_condexec(DisasContext *s)
 {
     if (s->condexec_mask) {
         uint32_t val = (s->condexec_cond << 4) | (s->condexec_mask >> 1);
@@ -707,7 +698,7 @@ static inline void gen_set_condexec(DisasContext *s)
     }
 }
 
-static inline void gen_set_pc_im(DisasContext *s, target_ulong val)
+void gen_set_pc_im(DisasContext *s, target_ulong val)
 {
     tcg_gen_movi_i32(cpu_R[15], val);
 }
@@ -1074,7 +1065,7 @@ static void gen_exception_el(DisasContext *s, int excp, uint32_t syn,
 }
 
 /* Force a TB lookup after an instruction that changes the CPU state.  */
-static inline void gen_lookup_tb(DisasContext *s)
+void gen_lookup_tb(DisasContext *s)
 {
     tcg_gen_movi_i32(cpu_R[15], s->base.pc_next);
     s->base.is_jmp = DISAS_EXIT;
@@ -1109,7 +1100,7 @@ static inline void gen_hlt(DisasContext *s, int imm)
 /*
  * Return the offset of a "full" NEON Dreg.
  */
-static long neon_full_reg_offset(unsigned reg)
+long neon_full_reg_offset(unsigned reg)
 {
     return offsetof(CPUARMState, vfp.zregs[reg >> 1].d[reg & 1]);
 }
@@ -1135,7 +1126,7 @@ static long neon_element_offset(int reg, int element, MemOp memop)
 }
 
 /* Return the offset of a VFP Dreg (dp = true) or VFP Sreg (dp = false). */
-static long vfp_reg_offset(bool dp, unsigned reg)
+long vfp_reg_offset(bool dp, unsigned reg)
 {
     if (dp) {
         return neon_element_offset(reg, 0, MO_64);
-- 
2.20.1



  parent reply	other threads:[~2021-05-10 12:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 12:25 [PULL 00/26] target-arm queue Peter Maydell
2021-05-10 12:25 ` [PULL 01/26] docs: fix link in sbsa description Peter Maydell
2021-05-10 12:25 ` [PULL 02/26] linux-user/aarch64: Enable hwcap for RND, BTI, and MTE Peter Maydell
2021-05-10 12:25 ` [PULL 03/26] target/arm: Fix tlbbits calculation in tlbi_aa64_vae2is_write() Peter Maydell
2021-05-10 12:25 ` [PULL 04/26] target/arm: Move constant expanders to translate.h Peter Maydell
2021-05-10 12:25 ` [PULL 05/26] target/arm: Share unallocated_encoding() and gen_exception_insn() Peter Maydell
2021-05-10 12:25 ` [PULL 06/26] target/arm: Make functions used by m-nocp global Peter Maydell
2021-05-10 12:25 ` [PULL 07/26] target/arm: Split m-nocp trans functions into their own file Peter Maydell
2021-05-10 12:25 ` [PULL 08/26] target/arm: Move gen_aa32 functions to translate-a32.h Peter Maydell
2021-05-10 12:25 ` [PULL 09/26] target/arm: Move vfp_{load, store}_reg{32, 64} to translate-vfp.c.inc Peter Maydell
2021-05-10 12:25 ` Peter Maydell [this message]
2021-05-10 12:25 ` [PULL 11/26] target/arm: Make translate-vfp.c.inc its own compilation unit Peter Maydell
2021-05-10 12:25 ` [PULL 12/26] target/arm: Move vfp_reg_ptr() to translate-neon.c.inc Peter Maydell
2021-05-10 12:25 ` [PULL 13/26] target/arm: Delete unused typedef Peter Maydell
2021-05-10 12:25 ` [PULL 14/26] target/arm: Move NeonGenThreeOpEnvFn typedef to translate.h Peter Maydell
2021-05-10 12:25 ` [PULL 15/26] target/arm: Make functions used by translate-neon global Peter Maydell
2021-05-10 12:25 ` [PULL 16/26] target/arm: Make translate-neon.c.inc its own compilation unit Peter Maydell
2021-05-10 12:25 ` [PULL 17/26] target/arm: Make WFI a NOP for userspace emulators Peter Maydell
2021-05-10 12:25 ` [PULL 18/26] hw/sd/omap_mmc: Use device_cold_reset() instead of device_legacy_reset() Peter Maydell
2021-05-10 12:25 ` [PULL 19/26] osdep: Make os-win32.h and os-posix.h handle 'extern "C"' themselves Peter Maydell
2021-05-10 12:25 ` [PULL 20/26] include/qemu/bswap.h: Handle being included outside extern "C" block Peter Maydell
2021-05-10 12:25 ` [PULL 21/26] include/disas/dis-asm.h: Handle being included outside 'extern "C"' Peter Maydell
2021-05-10 12:25 ` [PULL 22/26] hw/arm/imx25_pdk: Fix error message for invalid RAM size Peter Maydell
2021-05-10 12:25 ` [PULL 23/26] hw/misc/mps2-scc: Add "QEMU interface" comment Peter Maydell
2021-05-10 12:25 ` [PULL 24/26] hw/misc/mps2-scc: Support using CFG0 bit 0 for remapping Peter Maydell
2021-05-10 12:25 ` [PULL 25/26] hw/arm/mps2-tz: Implement AN524 memory remapping via machine property Peter Maydell
2021-05-10 12:25 ` [PULL 26/26] hw/arm/xlnx: Fix PHY address for xilinx-zynq-a9 Peter Maydell

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=20210510122548.28638-11-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).