|
From: | Richard Henderson |
Subject: | Re: [PATCH v2 09/12] target/arm: Optimize MVE VSHL, VSHR immediate forms |
Date: | Mon, 13 Sep 2021 06:56:16 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 9/13/21 2:54 AM, Peter Maydell wrote:
+static void do_gvec_shri_s(unsigned vece, uint32_t dofs, uint32_t aofs, + int64_t shift, uint32_t oprsz, uint32_t maxsz) +{ + /* + * We get here with a negated shift count, and we must handle + * shifts by the element size, which tcg_gen_gvec_sari() does not do. + */ + shift = -shift;
You've already performed the negation in do_2shift_vec.
+ if (shift == (8 << vece)) { + shift--; + } + tcg_gen_gvec_sari(vece, dofs, aofs, shift, oprsz, maxsz);
...
+ if (shift == (8 << vece)) { + tcg_gen_gvec_dup_imm(vece, dofs, oprsz, maxsz, 0); + } else { + tcg_gen_gvec_shri(vece, dofs, aofs, shift, oprsz, maxsz); + }
Perhaps worth placing these functions somewhere we can share code with NEON? Tactical error, perhaps, open-coding these tests in trans_VSHR_S_2sh and trans_VSHR_U_2sh.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |