[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-6.2 08/34] target/arm: Fix VPT advance when ECI is non-ze
From: |
Peter Maydell |
Subject: |
Re: [PATCH for-6.2 08/34] target/arm: Fix VPT advance when ECI is non-zero |
Date: |
Mon, 19 Jul 2021 15:16:41 +0100 |
On Fri, 16 Jul 2021 at 17:58, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 7/13/21 6:37 AM, Peter Maydell wrote:
> > if (mask01 > 8) {
> > - /* high bit set, but not 0b1000: invert the relevant half of P0 */
> > - vpr ^= 0xff;
> > + if (eci == ECI_NONE) {
> > + /* high bit set, but not 0b1000: invert the relevant half of
> > P0 */
> > + vpr ^= 0xff;
> > + } else if (eci == ECI_A0) {
> > + /* Invert only the beat 1 P0 bits, as we didn't execute beat 0
> > */
> > + vpr ^= 0xf0;
> > + } /* otherwise we didn't execute either beat 0 or beat 1 */
> > }
> > if (mask23 > 8) {
> > - /* high bit set, but not 0b1000: invert the relevant half of P0 */
> > - vpr ^= 0xff00;
> > + if (eci != ECI_A0A1A2 && eci != ECI_A0A1A2B0) {
> > + /* high bit set, but not 0b1000: invert the relevant half of
> > P0 */
> > + vpr ^= 0xff00;
> > + } else {
> > + /* We didn't execute beat 2, only invert the beat 3 P0 bits */
> > + vpr ^= 0xf000;
> > + }
> > }
>
> It might not be any cleaner, but I wondered if mve_eci_mask could help here.
>
> inv_mask = mve_eci_mask(...);
> if (mask01 <= 8) {
> inv_mask &= ~0xff;
> }
> if (mask23 <= 8) {
> inv_mask &= ~0xff00;
> }
> vpr ^= inv_mask;
Yes, I think that works better (you need to capture the ECI mask at the
start of the function before we update env->condexec_bits, though).
thanks
-- PMM
- Re: [PATCH for-6.2 01/34] target/arm: Note that we handle VMOVL as a special case of VSHLL, (continued)
- [PATCH for-6.2 04/34] target/arm: Fix signed VADDV, Peter Maydell, 2021/07/13
- [PATCH for-6.2 03/34] target/arm: Fix MVE VSLI by 0 and VSRI by <dt>, Peter Maydell, 2021/07/13
- [PATCH for-6.2 07/34] target/arm: Fix calculation of LTP mask when LR is 0, Peter Maydell, 2021/07/13
- [PATCH for-6.2 08/34] target/arm: Fix VPT advance when ECI is non-zero, Peter Maydell, 2021/07/13
- [PATCH for-6.2 09/34] target/arm: Factor out mve_eci_mask(), Peter Maydell, 2021/07/13
- [PATCH for-6.2 12/34] target/arm: Implement MVE incrementing/decrementing dup insns, Peter Maydell, 2021/07/13
- [PATCH for-6.2 06/34] target/arm: Fix 48-bit saturating shifts, Peter Maydell, 2021/07/13
- [PATCH for-6.2 10/34] target/arm: Fix VLDRB/H/W for predicated elements, Peter Maydell, 2021/07/13