From patchwork Mon Jul 23 20:17:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 142639 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6504504ljj; Mon, 23 Jul 2018 14:16:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdY0C3/yPFjwYxU+G9LZzWXmn3kzsjip3eo4QLEbuUnpHoUhwD5HCqKVPUboEnIEjxCBF8D X-Received: by 2002:a37:61cd:: with SMTP id v196-v6mr13451780qkb.101.1532380597314; Mon, 23 Jul 2018 14:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532380597; cv=none; d=google.com; s=arc-20160816; b=iMUxtPiquMKV40F8bMiRogSZdo3nw/ibG5B2R5znWUxv2xs8Uc9n+Tg2RxAoOptGQt BzX4wojEANhLFNuI0kF6GLc9ZSY55csuHyJDTvT/bKG+tqZn6GgqP5ss8gR4hW7+vcKa pWdTbIa2yUTjhj+nTra0bVFbHtDGErzdBniUAT9Nq9NLebSyWmuL3yBJoWrOW+viQ8FM Jxh8wsDrOnPP1xWdEKCiC0oS+eo2Udzz23AGx7PLgbUu3NTIP8PZm4kXpwzjV2L1+5VI v8RFNoWQWyMezQUqf207GDLuupoqHJDK8ZN99FunOi7Yu/GeFBTyJpokyJcp437B+D2k V63Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=ZheyVE/pjPhu9F8cg6sWew5iy2ewnczU/RjVypp3QrE=; b=qUkI1yfUlhivPpf/kOQ9CF+0J4jmj0vD1qdTqaylt+h5W7k70OtHwVma861iaex/lF xd0V7vZXvAZRa7aZMGeckSO15Fl5fqA2EG+drajuT7AVkK5fl97PCh0TM+eT5VEl1Hq+ 7QnOy3KStjnDwKIhNq5UontB28FDBxI6bmKRP6RLgNOP52S90nm1IegJjkGkQVyERcLY XARcbULPtiNWaYotiTHt5GfaUjyM5xZn3EyBv/UdtScT465UfpMagLLHPgokuOWZ8QDu Lk/JiQnR3XWTMImRhift8AaAbD4Bq8fPulgEN/7TDVlFgforF62wCr6UkdvrMUU6L8wq CahQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pwkq1aac; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o19-v6si4809023qki.245.2018.07.23.14.16.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 23 Jul 2018 14:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pwkq1aac; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([::1]:36701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhiC4-0003TY-NM for patch@linaro.org; Mon, 23 Jul 2018 17:16:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhKm-0003wj-8G for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhKi-0005NQ-8q for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:31 -0400 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:40410) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhKi-0005NF-2M; Mon, 23 Jul 2018 16:21:28 -0400 Received: by mail-oi0-x241.google.com with SMTP id w126-v6so3482743oie.7; Mon, 23 Jul 2018 13:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZheyVE/pjPhu9F8cg6sWew5iy2ewnczU/RjVypp3QrE=; b=pwkq1aacGwxDdXo9nYovy9+XLdXFyJXuqIwWQ2CA16WBqKi4/IKKYJ7wRRL+2hUqad ww3uF4lWTj2mTx8k9SvJ3ALwqcCKnlwoXBgfBYVl8DMPTZMZMgtCTSyqIgV+tfT72aZW +Xa6iiKfmdnNia2od9+5wtFDlDmVYTET0ln0LSLbqbn82RF7p1s82u01VFO2RsHlDHZG ixaAkh2OJ3cIbV2tsrtb4AVfqFCw/zrze2E+KdvQWTEqp87ZaN4Mcw0ZsTsgcEsutPu8 /xnQ7BG6cIcGj4NRVXOgTAZktHMFyUFyetxB5w+TA3lppVytYWn2oamjgqZaQ0oMgKLR BeNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZheyVE/pjPhu9F8cg6sWew5iy2ewnczU/RjVypp3QrE=; b=eLFXsKh++WnUaSE/meIubQATaGRzZfy+o9S9EezJhW2kNY5aZE891VwF/0zkK5APhi drKUYjUfo7+Q4n3ycu8XvClsQhHuooKmJ1GI0hyd6HkPGBRA3zC6Os6Q+WHdFrlOmOqu J8AvwbEr9Zg/PD8f4CTetb2jPH7/e7MfpEfSMpSlgf9RMCOdcjuXY7lhUTkl1T6Jjjua uoTghv3SqSnw5oQPRccILLY3wwvLxDxMmL0P1DriA4Xroa7LdglcXDWuxHKvLXnuYza1 XvM0aZGhcZpHdWmH70d7o9v6kA1QSz4iP9sF1pRP6+xP14Np+7p3PUJVSgEAgGQSZ5y3 9Nog== X-Gm-Message-State: AOUpUlEGUg1U3CutFBwEGhhuci/oOjLVF7FG3i9Updr85SNVb7LHPiEU LOUPgRb6sTi19PByVHUsWcjfwi+G0uwjzg== X-Received: by 2002:aca:e185:: with SMTP id y127-v6mr291260oig.245.1532377286875; Mon, 23 Jul 2018 13:21:26 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id w204-v6sm12600096oif.2.2018.07.23.13.21.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:21:25 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:17:28 -0500 Message-Id: <20180723201748.25573-80-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::241 Subject: [Qemu-devel] [PATCH 79/99] target/arm: Introduce and use read_fp_hreg X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Tested-by: Alex Bennée Message-id: 20180512003217.9105-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 3d99d931266eaeaf7e83703a53f32232cd6faad7) Signed-off-by: Michael Roth --- target/arm/translate-a64.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index c5be901b5f..bcb3b5c5e7 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. */ @@ -4638,11 +4646,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); @@ -7538,13 +7544,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); @@ -8085,13 +8088,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); @@ -12010,11 +12010,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 */