From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH v3 12/16] target/arm: Decode aa64 armv8.3 fcmla
Date: Thu, 1 Mar 2018 15:28:28 +0000 [thread overview]
Message-ID: <CAFEAcA-FOV6JSaZrhD+FZ-T46n_e--suEDbha5EXAEPyW5YAEw@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-pUMgUnR0cWd9j7n0EyTeXkMTzhPQU_fqhyaXy1hMfxw@mail.gmail.com>
On 1 March 2018 at 13:33, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 28 February 2018 at 19:31, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>> target/arm/helper.h | 11 ++++
>> target/arm/translate-a64.c | 94 +++++++++++++++++++++++++---
>> target/arm/vec_helper.c | 149 +++++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 246 insertions(+), 8 deletions(-)
>>
>> diff --git a/target/arm/helper.h b/target/arm/helper.h
>> index 1e2d7025de..0d2094f2be 100644
>> --- a/target/arm/helper.h
>> +++ b/target/arm/helper.h
>> @@ -585,6 +585,17 @@ DEF_HELPER_FLAGS_5(gvec_fcadds, TCG_CALL_NO_RWG,
>> DEF_HELPER_FLAGS_5(gvec_fcaddd, TCG_CALL_NO_RWG,
>> void, ptr, ptr, ptr, ptr, i32)
>>
>> +DEF_HELPER_FLAGS_5(gvec_fcmlah, TCG_CALL_NO_RWG,
>> + void, ptr, ptr, ptr, ptr, i32)
>> +DEF_HELPER_FLAGS_5(gvec_fcmlah_idx, TCG_CALL_NO_RWG,
>> + void, ptr, ptr, ptr, ptr, i32)
>> +DEF_HELPER_FLAGS_5(gvec_fcmlas, TCG_CALL_NO_RWG,
>> + void, ptr, ptr, ptr, ptr, i32)
>> +DEF_HELPER_FLAGS_5(gvec_fcmlas_idx, TCG_CALL_NO_RWG,
>> + void, ptr, ptr, ptr, ptr, i32)
>> +DEF_HELPER_FLAGS_5(gvec_fcmlad, TCG_CALL_NO_RWG,
>> + void, ptr, ptr, ptr, ptr, i32)
>> +
>> #ifdef TARGET_AARCH64
>> #include "helper-a64.h"
>> #endif
>> diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
>> index efed4fd9d2..31ff0479e6 100644
>> --- a/target/arm/translate-a64.c
>> +++ b/target/arm/translate-a64.c
>> @@ -10842,6 +10842,10 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn)
>> }
>> feature = ARM_FEATURE_V8_RDM;
>> break;
>> + case 0x8: /* FCMLA, #0 */
>> + case 0x9: /* FCMLA, #90 */
>> + case 0xa: /* FCMLA, #180 */
>> + case 0xb: /* FCMLA, #270 */
>> case 0xc: /* FCADD, #90 */
>> case 0xe: /* FCADD, #270 */
>> if (size == 0
>> @@ -10891,6 +10895,29 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn)
>> }
>> return;
>>
>> + case 0x8: /* FCMLA, #0 */
>> + case 0x9: /* FCMLA, #90 */
>> + case 0xa: /* FCMLA, #180 */
>> + case 0xb: /* FCMLA, #270 */
>> + rot = extract32(opcode, 0, 2);
>> + switch (size) {
>> + case 1:
>> + gen_gvec_op3_fpst(s, is_q, rd, rn, rm, true, rot,
>> + gen_helper_gvec_fcmlah);
>> + break;
>> + case 2:
>> + gen_gvec_op3_fpst(s, is_q, rd, rn, rm, false, rot,
>> + gen_helper_gvec_fcmlas);
>> + break;
>> + case 3:
>> + gen_gvec_op3_fpst(s, is_q, rd, rn, rm, false, rot,
>> + gen_helper_gvec_fcmlad);
>> + break;
>> + default:
>> + g_assert_not_reached();
>> + }
>> + return;
>> +
>> case 0xc: /* FCADD, #90 */
>> case 0xe: /* FCADD, #270 */
>> rot = extract32(opcode, 1, 1);
>
> Shouldn't there be a feature check on ARM_FEATURE_V8_FCMA somewhere
> in the three_reg_same_extra code path?
>
>
>> diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c
>> index a868ca6aac..d81eb7730d 100644
>> --- a/target/arm/vec_helper.c
>> +++ b/target/arm/vec_helper.c
>> @@ -278,3 +278,152 @@ void HELPER(gvec_fcaddd)(void *vd, void *vn, void *vm,
>> }
>> clear_tail(d, opr_sz, simd_maxsz(desc));
>> }
>> +
>> +void HELPER(gvec_fcmlah)(void *vd, void *vn, void *vm,
>> + void *vfpst, uint32_t desc)
>> +{
>> + uintptr_t opr_sz = simd_oprsz(desc);
>> + float16 *d = vd;
>> + float16 *n = vn;
>> + float16 *m = vm;
>> + float_status *fpst = vfpst;
>> + intptr_t flip = extract32(desc, SIMD_DATA_SHIFT, 1);
>> + uint32_t neg_imag = extract32(desc, SIMD_DATA_SHIFT + 1, 1);
>> + uint32_t neg_real = flip ^ neg_imag;
>> + uintptr_t i;
>> +
>> + /* Shift boolean to the sign bit so we can xor to negate. */
>> + neg_real <<= 15;
>> + neg_imag <<= 15;
>> +
>> + for (i = 0; i < opr_sz / 2; i += 2) {
>> + float16 e1 = n[H2(i + flip)];
>> + float16 e2 = m[H2(i + flip)] ^ neg_real;
>> + float16 e3 = e1;
>> + float16 e4 = m[H2(i + 1 - flip)] ^ neg_imag;
>
> These don't match up with the element1 ... element4 in the
> Arm ARM pseudocode. It's e2 and e4 that are always the same,
> not e1 and e3. Ditto in the other functions.
Specifically I think:
this code pseudocode
e1 element2
e2 element1
e3 element4
e4 element2
So if we renumber these to match the pseudocode
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
next prev parent reply other threads:[~2018-03-01 15:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 19:31 [Qemu-arm] [PATCH v3 00/16] ARM v8.1 simd + v8.3 complex insns Richard Henderson
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 01/16] target/arm: Add ARM_FEATURE_V8_RDM Richard Henderson
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 02/16] target/arm: Refactor disas_simd_indexed decode Richard Henderson
2018-03-01 13:12 ` Peter Maydell
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 03/16] target/arm: Refactor disas_simd_indexed size checks Richard Henderson
2018-03-01 13:19 ` Peter Maydell
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 04/16] target/arm: Decode aa64 armv8.1 scalar three same extra Richard Henderson
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 05/16] target/arm: Decode aa64 armv8.1 " Richard Henderson
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 06/16] target/arm: Decode aa64 armv8.1 scalar/vector x indexed element Richard Henderson
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 07/16] target/arm: Decode aa32 armv8.1 three same Richard Henderson
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 08/16] target/arm: Decode aa32 armv8.1 two reg and a scalar Richard Henderson
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 09/16] target/arm: Enable ARM_FEATURE_V8_RDM Richard Henderson
2018-03-01 13:19 ` Peter Maydell
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 10/16] target/arm: Add ARM_FEATURE_V8_FCMA Richard Henderson
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 11/16] target/arm: Decode aa64 armv8.3 fcadd Richard Henderson
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 12/16] target/arm: Decode aa64 armv8.3 fcmla Richard Henderson
2018-03-01 13:33 ` [Qemu-arm] " Peter Maydell
2018-03-01 14:27 ` Peter Maydell
2018-03-01 15:28 ` Peter Maydell [this message]
2018-03-01 15:37 ` Peter Maydell
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 13/16] target/arm: Decode aa32 armv8.3 3-same Richard Henderson
2018-03-01 13:53 ` Peter Maydell
2018-03-01 14:01 ` Peter Maydell
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 14/16] target/arm: Decode aa32 armv8.3 2-reg-index Richard Henderson
2018-03-01 14:05 ` Peter Maydell
2018-02-28 19:31 ` [Qemu-devel] [PATCH v3 15/16] target/arm: Decode t32 simd 3reg and 2reg_scalar extension Richard Henderson
2018-03-01 14:07 ` [Qemu-arm] " Peter Maydell
2018-02-28 19:31 ` [Qemu-arm] [PATCH v3 16/16] target/arm: Enable ARM_FEATURE_V8_FCMA Richard Henderson
2018-03-01 13:20 ` Peter Maydell
2018-03-01 14:12 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA-FOV6JSaZrhD+FZ-T46n_e--suEDbha5EXAEPyW5YAEw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).