[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-6.2 13/34] target/arm: Factor out gen_vpst()
From: |
Peter Maydell |
Subject: |
[PATCH for-6.2 13/34] target/arm: Factor out gen_vpst() |
Date: |
Tue, 13 Jul 2021 14:37:05 +0100 |
Factor out the "generate code to update VPR.MASK01/MASK23" part of
trans_VPST(); we are going to want to reuse it for the VPT insns.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/translate-mve.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/target/arm/translate-mve.c b/target/arm/translate-mve.c
index 52400864692..de65a1c3cf1 100644
--- a/target/arm/translate-mve.c
+++ b/target/arm/translate-mve.c
@@ -737,33 +737,24 @@ static bool trans_VRMLSLDAVH(DisasContext *s,
arg_vmlaldav *a)
return do_long_dual_acc(s, a, fns[a->x]);
}
-static bool trans_VPST(DisasContext *s, arg_VPST *a)
+static void gen_vpst(DisasContext *s, uint32_t mask)
{
- TCGv_i32 vpr;
-
- /* mask == 0 is a "related encoding" */
- if (!dc_isar_feature(aa32_mve, s) || !a->mask) {
- return false;
- }
- if (!mve_eci_check(s) || !vfp_access_check(s)) {
- return true;
- }
/*
* Set the VPR mask fields. We take advantage of MASK01 and MASK23
* being adjacent fields in the register.
*
- * This insn is not predicated, but it is subject to beat-wise
+ * Updating the masks is not predicated, but it is subject to beat-wise
* execution, and the mask is updated on the odd-numbered beats.
* So if PSR.ECI says we should skip beat 1, we mustn't update the
* 01 mask field.
*/
- vpr = load_cpu_field(v7m.vpr);
+ TCGv_i32 vpr = load_cpu_field(v7m.vpr);
switch (s->eci) {
case ECI_NONE:
case ECI_A0:
/* Update both 01 and 23 fields */
tcg_gen_deposit_i32(vpr, vpr,
- tcg_constant_i32(a->mask | (a->mask << 4)),
+ tcg_constant_i32(mask | (mask << 4)),
R_V7M_VPR_MASK01_SHIFT,
R_V7M_VPR_MASK01_LENGTH + R_V7M_VPR_MASK23_LENGTH);
break;
@@ -772,13 +763,25 @@ static bool trans_VPST(DisasContext *s, arg_VPST *a)
case ECI_A0A1A2B0:
/* Update only the 23 mask field */
tcg_gen_deposit_i32(vpr, vpr,
- tcg_constant_i32(a->mask),
+ tcg_constant_i32(mask),
R_V7M_VPR_MASK23_SHIFT, R_V7M_VPR_MASK23_LENGTH);
break;
default:
g_assert_not_reached();
}
store_cpu_field(vpr, v7m.vpr);
+}
+
+static bool trans_VPST(DisasContext *s, arg_VPST *a)
+{
+ /* mask == 0 is a "related encoding" */
+ if (!dc_isar_feature(aa32_mve, s) || !a->mask) {
+ return false;
+ }
+ if (!mve_eci_check(s) || !vfp_access_check(s)) {
+ return true;
+ }
+ gen_vpst(s, a->mask);
mve_update_and_store_eci(s);
return true;
}
--
2.20.1
- [PATCH for-6.2 10/34] target/arm: Fix VLDRB/H/W for predicated elements, (continued)
- [PATCH for-6.2 10/34] target/arm: Fix VLDRB/H/W for predicated elements, Peter Maydell, 2021/07/13
- [PATCH for-6.2 05/34] target/arm: Fix mask handling for MVE narrowing operations, Peter Maydell, 2021/07/13
- [PATCH for-6.2 16/34] target/arm: Implement MVE VPSEL, Peter Maydell, 2021/07/13
- [PATCH for-6.2 11/34] target/arm: Implement MVE VMULL (polynomial), Peter Maydell, 2021/07/13
- [PATCH for-6.2 19/34] target/arm: Move 'x' and 'a' bit definitions into vmlaldav formats, Peter Maydell, 2021/07/13
- [PATCH for-6.2 13/34] target/arm: Factor out gen_vpst(),
Peter Maydell <=
- [PATCH for-6.2 15/34] target/arm: Implement MVE integer vector-vs-scalar comparisons, Peter Maydell, 2021/07/13
- [PATCH for-6.2 14/34] target/arm: Implement MVE integer vector comparisons, Peter Maydell, 2021/07/13
- [PATCH for-6.2 21/34] target/arm: Implement MVE VABAV, Peter Maydell, 2021/07/13
- [PATCH for-6.2 23/34] target/arm: Rename MVEGenDualAccOpFn to MVEGenLongDualAccOpFn, Peter Maydell, 2021/07/13