[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/13] target/arm: Move constant expanders to translate.h
From: |
Peter Maydell |
Subject: |
[PATCH v2 01/13] target/arm: Move constant expanders to translate.h |
Date: |
Fri, 30 Apr 2021 14:27:28 +0100 |
Some of the constant expanders defined in translate.c are generically
useful and will be used by the separate C files for VFP and Neon once
they are created; move the expander definitions to translate.h.
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>
---
target/arm/translate.h | 24 ++++++++++++++++++++++++
target/arm/translate.c | 24 ------------------------
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/target/arm/translate.h b/target/arm/translate.h
index ccf60c96d84..b5b21619597 100644
--- a/target/arm/translate.h
+++ b/target/arm/translate.h
@@ -118,6 +118,30 @@ extern TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF;
extern TCGv_i64 cpu_exclusive_addr;
extern TCGv_i64 cpu_exclusive_val;
+/*
+ * Constant expanders for the decoders.
+ */
+
+static inline int negate(DisasContext *s, int x)
+{
+ return -x;
+}
+
+static inline int plus_2(DisasContext *s, int x)
+{
+ return x + 2;
+}
+
+static inline int times_2(DisasContext *s, int x)
+{
+ return x * 2;
+}
+
+static inline int times_4(DisasContext *s, int x)
+{
+ return x * 4;
+}
+
static inline int arm_dc_feature(DisasContext *dc, int feature)
{
return (dc->features & (1ULL << feature)) != 0;
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 43ff0d4b8ac..bb9e228d1ae 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -109,30 +109,6 @@ static void arm_gen_condlabel(DisasContext *s)
}
}
-/*
- * Constant expanders for the decoders.
- */
-
-static int negate(DisasContext *s, int x)
-{
- return -x;
-}
-
-static int plus_2(DisasContext *s, int x)
-{
- return x + 2;
-}
-
-static int times_2(DisasContext *s, int x)
-{
- return x * 2;
-}
-
-static int times_4(DisasContext *s, int x)
-{
- return x * 4;
-}
-
/* Flags for the disas_set_da_iss info argument:
* lower bits hold the Rt register number, higher bits are flags.
*/
--
2.20.1
- [PATCH v2 00/13] target/arm: Split translate-*.c.inc into separate compilation units, Peter Maydell, 2021/04/30
- [PATCH v2 04/13] target/arm: Split m-nocp trans functions into their own file, Peter Maydell, 2021/04/30
- [PATCH v2 06/13] target/arm: Move vfp_{load, store}_reg{32, 64} to translate-vfp.c.inc, Peter Maydell, 2021/04/30
- [PATCH v2 05/13] target/arm: Move gen_aa32 functions to translate-a32.h, Peter Maydell, 2021/04/30
- [PATCH v2 01/13] target/arm: Move constant expanders to translate.h,
Peter Maydell <=
- [PATCH v2 02/13] target/arm: Share unallocated_encoding() and gen_exception_insn(), Peter Maydell, 2021/04/30
- [PATCH v2 07/13] target/arm: Make functions used by translate-vfp global, Peter Maydell, 2021/04/30
- [PATCH v2 12/13] target/arm: Make functions used by translate-neon global, Peter Maydell, 2021/04/30
- [PATCH v2 03/13] target/arm: Make functions used by m-nocp global, Peter Maydell, 2021/04/30
- [PATCH v2 10/13] target/arm: Delete unused typedef, Peter Maydell, 2021/04/30
- [PATCH v2 11/13] target/arm: Move NeonGenThreeOpEnvFn typedef to translate.h, Peter Maydell, 2021/04/30
- [PATCH v2 09/13] target/arm: Move vfp_reg_ptr() to translate-neon.c.inc, Peter Maydell, 2021/04/30
- [PATCH v2 08/13] target/arm: Make translate-vfp.c.inc its own compilation unit, Peter Maydell, 2021/04/30