All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, peter.maydell@linaro.org, qemu-stable@nongnu.org
Subject: [Qemu-devel] [PATCH v2 08/14] target/arm: Introduce and use read_fp_hreg
Date: Wed,  2 May 2018 15:15:46 -0700	[thread overview]
Message-ID: <20180502221552.3873-9-richard.henderson@linaro.org> (raw)
In-Reply-To: <20180502221552.3873-1-richard.henderson@linaro.org>

Cc: qemu-stable@nongnu.org
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index e19d97e8f1..8c63d5e743 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -614,6 +614,14 @@ static TCGv_i32 read_fp_sreg(DisasContext *s, int reg)
     return v;
 }
 
+static TCGv_i32 read_fp_hreg(DisasContext *s, int reg)
+{
+    TCGv_i32 v = tcg_temp_new_i32();
+
+    tcg_gen_ld16u_i32(v, cpu_env, fp_reg_offset(s, reg, MO_16));
+    return v;
+}
+
 /* Clear the bits above an N-bit vector, for N = (is_q ? 128 : 64).
  * If SVE is not enabled, then there are only 128 bits in the vector.
  */
@@ -4644,11 +4652,9 @@ static void disas_fp_csel(DisasContext *s, uint32_t insn)
 static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn)
 {
     TCGv_ptr fpst = NULL;
-    TCGv_i32 tcg_op = tcg_temp_new_i32();
+    TCGv_i32 tcg_op = read_fp_hreg(s, rn);
     TCGv_i32 tcg_res = tcg_temp_new_i32();
 
-    read_vec_element_i32(s, tcg_op, rn, 0, MO_16);
-
     switch (opcode) {
     case 0x0: /* FMOV */
         tcg_gen_mov_i32(tcg_res, tcg_op);
@@ -7543,13 +7549,10 @@ static void disas_simd_scalar_three_reg_diff(DisasContext *s, uint32_t insn)
         tcg_temp_free_i64(tcg_op2);
         tcg_temp_free_i64(tcg_res);
     } else {
-        TCGv_i32 tcg_op1 = tcg_temp_new_i32();
-        TCGv_i32 tcg_op2 = tcg_temp_new_i32();
+        TCGv_i32 tcg_op1 = read_fp_hreg(s, rn);
+        TCGv_i32 tcg_op2 = read_fp_hreg(s, rm);
         TCGv_i64 tcg_res = tcg_temp_new_i64();
 
-        read_vec_element_i32(s, tcg_op1, rn, 0, MO_16);
-        read_vec_element_i32(s, tcg_op2, rm, 0, MO_16);
-
         gen_helper_neon_mull_s16(tcg_res, tcg_op1, tcg_op2);
         gen_helper_neon_addl_saturate_s32(tcg_res, cpu_env, tcg_res, tcg_res);
 
@@ -8090,13 +8093,10 @@ static void disas_simd_scalar_three_reg_same_fp16(DisasContext *s,
 
     fpst = get_fpstatus_ptr(true);
 
-    tcg_op1 = tcg_temp_new_i32();
-    tcg_op2 = tcg_temp_new_i32();
+    tcg_op1 = read_fp_hreg(s, rn);
+    tcg_op2 = read_fp_hreg(s, rm);
     tcg_res = tcg_temp_new_i32();
 
-    read_vec_element_i32(s, tcg_op1, rn, 0, MO_16);
-    read_vec_element_i32(s, tcg_op2, rm, 0, MO_16);
-
     switch (fpopcode) {
     case 0x03: /* FMULX */
         gen_helper_advsimd_mulxh(tcg_res, tcg_op1, tcg_op2, fpst);
@@ -12015,11 +12015,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)
     }
 
     if (is_scalar) {
-        TCGv_i32 tcg_op = tcg_temp_new_i32();
+        TCGv_i32 tcg_op = read_fp_hreg(s, rn);
         TCGv_i32 tcg_res = tcg_temp_new_i32();
 
-        read_vec_element_i32(s, tcg_op, rn, 0, MO_16);
-
         switch (fpop) {
         case 0x1a: /* FCVTNS */
         case 0x1b: /* FCVTMS */
-- 
2.14.3

  parent reply	other threads:[~2018-05-02 22:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 22:15 [Qemu-devel] [PATCH v2 00/14] target/arm: Fixups for ARM_FEATURE_V8_FP16 Richard Henderson
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 01/14] target/arm: Implement vector shifted SCVF/UCVF for fp16 Richard Henderson
2018-05-10 16:03   ` Peter Maydell
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 02/14] target/arm: Implement vector shifted FCVT " Richard Henderson
2018-05-10 16:04   ` Peter Maydell
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 03/14] target/arm: Fix float16 to/from int16 Richard Henderson
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 04/14] target/arm: Clear SVE high bits for FMOV Richard Henderson
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 05/14] target/arm: Implement FMOV (general) for fp16 Richard Henderson
2018-05-10 16:21   ` Peter Maydell
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 06/14] target/arm: Implement FCVT (scalar, integer) " Richard Henderson
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 07/14] target/arm: Implement FCVT (scalar, fixed-point) " Richard Henderson
2018-05-02 22:15 ` Richard Henderson [this message]
2018-05-10 16:30   ` [Qemu-devel] [PATCH v2 08/14] target/arm: Introduce and use read_fp_hreg Peter Maydell
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 09/14] target/arm: Implement FP data-processing (2 source) for fp16 Richard Henderson
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 10/14] target/arm: Implement FP data-processing (3 " Richard Henderson
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 11/14] target/arm: Implement FCMP " Richard Henderson
2018-05-10 16:59   ` Peter Maydell
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 12/14] target/arm: Implement FCSEL " Richard Henderson
2018-05-10 17:01   ` Peter Maydell
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 13/14] target/arm: Implement FMOV (immediate) " Richard Henderson
2018-05-10 17:02   ` Peter Maydell
2018-05-02 22:15 ` [Qemu-devel] [PATCH v2 14/14] target/arm: Fix sqrt_f16 exception raising Richard Henderson
2018-05-02 22:33 ` [Qemu-devel] [PATCH v2 00/14] target/arm: Fixups for ARM_FEATURE_V8_FP16 no-reply
2018-05-10 17:09 ` 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=20180502221552.3873-9-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.