[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/45] target/arm: Macroify trans functions for VFMA, VFMS, VF
From: |
Peter Maydell |
Subject: |
[PATCH v2 05/45] target/arm: Macroify trans functions for VFMA, VFMS, VFNMA, VFNMS |
Date: |
Fri, 28 Aug 2020 19:33:14 +0100 |
Macroify creation of the trans functions for single and double
precision VFMA, VFMS, VFNMA, VFNMS. The repetition was OK for
two sizes, but we're about to add halfprec and it will get a bit
more than seems reasonable.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-vfp.c.inc | 50 +++++++++-------------------------
1 file changed, 13 insertions(+), 37 deletions(-)
diff --git a/target/arm/translate-vfp.c.inc b/target/arm/translate-vfp.c.inc
index 15bb23688bd..9937fa569e4 100644
--- a/target/arm/translate-vfp.c.inc
+++ b/target/arm/translate-vfp.c.inc
@@ -1978,26 +1978,6 @@ static bool do_vfm_sp(DisasContext *s, arg_VFMA_sp *a,
bool neg_n, bool neg_d)
return true;
}
-static bool trans_VFMA_sp(DisasContext *s, arg_VFMA_sp *a)
-{
- return do_vfm_sp(s, a, false, false);
-}
-
-static bool trans_VFMS_sp(DisasContext *s, arg_VFMS_sp *a)
-{
- return do_vfm_sp(s, a, true, false);
-}
-
-static bool trans_VFNMA_sp(DisasContext *s, arg_VFNMA_sp *a)
-{
- return do_vfm_sp(s, a, false, true);
-}
-
-static bool trans_VFNMS_sp(DisasContext *s, arg_VFNMS_sp *a)
-{
- return do_vfm_sp(s, a, true, true);
-}
-
static bool do_vfm_dp(DisasContext *s, arg_VFMA_dp *a, bool neg_n, bool neg_d)
{
/*
@@ -2069,25 +2049,21 @@ static bool do_vfm_dp(DisasContext *s, arg_VFMA_dp *a,
bool neg_n, bool neg_d)
return true;
}
-static bool trans_VFMA_dp(DisasContext *s, arg_VFMA_dp *a)
-{
- return do_vfm_dp(s, a, false, false);
-}
+#define MAKE_ONE_VFM_TRANS_FN(INSN, PREC, NEGN, NEGD) \
+ static bool trans_##INSN##_##PREC(DisasContext *s, \
+ arg_##INSN##_##PREC *a) \
+ { \
+ return do_vfm_##PREC(s, a, NEGN, NEGD); \
+ }
-static bool trans_VFMS_dp(DisasContext *s, arg_VFMS_dp *a)
-{
- return do_vfm_dp(s, a, true, false);
-}
+#define MAKE_VFM_TRANS_FNS(PREC) \
+ MAKE_ONE_VFM_TRANS_FN(VFMA, PREC, false, false) \
+ MAKE_ONE_VFM_TRANS_FN(VFMS, PREC, true, false) \
+ MAKE_ONE_VFM_TRANS_FN(VFNMA, PREC, false, true) \
+ MAKE_ONE_VFM_TRANS_FN(VFNMS, PREC, true, true)
-static bool trans_VFNMA_dp(DisasContext *s, arg_VFNMA_dp *a)
-{
- return do_vfm_dp(s, a, false, true);
-}
-
-static bool trans_VFNMS_dp(DisasContext *s, arg_VFNMS_dp *a)
-{
- return do_vfm_dp(s, a, true, true);
-}
+MAKE_VFM_TRANS_FNS(sp)
+MAKE_VFM_TRANS_FNS(dp)
static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a)
{
--
2.20.1
- [PATCH v2 00/45] target/arm: Implement fp16 for AArch32 VFP and Neon, Peter Maydell, 2020/08/28
- [PATCH v2 06/45] target/arm: Implement VFP fp16 for fused-multiply-add, Peter Maydell, 2020/08/28
- [PATCH v2 03/45] target/arm: Implement VFP fp16 for VFP_BINOP operations, Peter Maydell, 2020/08/28
- [PATCH v2 01/45] target/arm: Remove local definitions of float constants, Peter Maydell, 2020/08/28
- [PATCH v2 04/45] target/arm: Implement VFP fp16 VMLA, VMLS, VNMLS, VNMLA, VNMUL, Peter Maydell, 2020/08/28
- [PATCH v2 02/45] target/arm: Use correct ID register check for aa32_fp16_arith, Peter Maydell, 2020/08/28
- [PATCH v2 07/45] target/arm: Macroify uses of do_vfp_2op_sp() and do_vfp_2op_dp(), Peter Maydell, 2020/08/28
- [PATCH v2 09/45] target/arm: Implement VFP fp16 for VMOV immediate, Peter Maydell, 2020/08/28
- [PATCH v2 05/45] target/arm: Macroify trans functions for VFMA, VFMS, VFNMA, VFNMS,
Peter Maydell <=
- [PATCH v2 10/45] target/arm: Implement VFP fp16 VCMP, Peter Maydell, 2020/08/28
- [PATCH v2 08/45] target/arm: Implement VFP fp16 for VABS, VNEG, VSQRT, Peter Maydell, 2020/08/28
- [PATCH v2 12/45] target/arm: Implement VFP fp16 VCVT between float and integer, Peter Maydell, 2020/08/28
- [PATCH v2 13/45] target/arm: Make VFP_CONV_FIX macros take separate float type and float size, Peter Maydell, 2020/08/28
- [PATCH v2 11/45] target/arm: Implement VFP fp16 VLDR and VSTR, Peter Maydell, 2020/08/28
- [PATCH v2 14/45] target/arm: Use macros instead of open-coding fp16 conversion helpers, Peter Maydell, 2020/08/28
- [PATCH v2 15/45] target/arm: Implement VFP fp16 VCVT between float and fixed-point, Peter Maydell, 2020/08/28
- [PATCH v2 16/45] target/arm: Implement VFP vp16 VCVT-with-specified-rounding-mode, Peter Maydell, 2020/08/28
- [PATCH v2 18/45] target/arm: Implement VFP fp16 VRINT*, Peter Maydell, 2020/08/28
- [PATCH v2 21/45] target/arm: Implement VFP fp16 VMOV between gp and halfprec registers, Peter Maydell, 2020/08/28