From patchwork Fri May 11 02:44:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135469 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp327447lji; Thu, 10 May 2018 19:49:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZopf0bj2cuoOGi2I9LRbJK/gorV2eOg0G2kzRCxHbKPKb7ZCOBHfy1bus387rbqD5mFhHx5 X-Received: by 2002:a0c:c602:: with SMTP id v2-v6mr3602619qvi.11.1526006951678; Thu, 10 May 2018 19:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526006951; cv=none; d=google.com; s=arc-20160816; b=t9jToYOkq4+qMFgz+jBOmUsKr31Cx7aOJfafxn26d+1IeLBSS86BsuVVDjEzlDgkFp JkWhWVG9HctMfWkInpHSKVih6zlPAMhloWBTMuspol4nDqXYCNnKoZhNcpJKuNnw/2xN qhmBcZxvBTA1aIdaQJJplZxWSsSSWln7lFhWqChvYuyt7i9SRjyYj0tJYpeWihuFr64p 1u9lEhnAalG+HnzBbFXFc3fVgavd9MJBJQGzV0JKNBM4qdNl2+OsJtfd9qIwiHVfPJUF 96zltcz2WdulCEcBTRRqCVOscmS1Slomc/ABfGAzrngmvRpV3nH8k7Ep/lBB29bayDVI 2Mpg== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=uR2Q5iEyxGiWW0TsSf+fLL7yus1zRFGEpIBJL3HBzdQ=; b=fzvx/d4+6KnEX61JcQWVW9WZuJcYGbTbNEgbIpw1ubRfLFMveZqP2i3qfhutcLy+jE SBz7GKvxky3XzfEZ9nGkHVQSd1ZBFG1Q8VI1XCeHvoW8TbBWjm4ZZxWOsWDaf8k/PSU7 VphyNZch56j7YXo8wudnLtA92supozMW+QFoRqqF9RLoPZ+hK6fVo2QYriCHRK67p5lj p5efSHBVl1+aODKHG3cDuu+sk5ZIuIi0hWcbGD/0l1yDdalG+3J+e9Oaq6IxzCWhCpPn 5tCvWSLeKurcdT0dHnYTMATZsIe1fEwWTB96M0HsGSHSDySPw6+Gah/5XKYuSyd00aOt /3NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PD4zimq1; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y144-v6si2032258qkb.402.2018.05.10.19.49.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 19:49:11 -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=@linaro.org header.s=google header.b=PD4zimq1; 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=linaro.org Received: from localhost ([::1]:36449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy7L-0005Uc-3U for patch@linaro.org; Thu, 10 May 2018 22:49:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy3Y-00025L-Go for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGy3X-00060E-II for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:16 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:37017) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGy3X-0005zl-DK for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:15 -0400 Received: by mail-pg0-x242.google.com with SMTP id a13-v6so1797757pgu.4 for ; Thu, 10 May 2018 19:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uR2Q5iEyxGiWW0TsSf+fLL7yus1zRFGEpIBJL3HBzdQ=; b=PD4zimq1XPyVapVnmni1xzZZM5ExIm2wRsNjo1DVVDl1xISy37Q7Y4rsghXu9pqykm TXHaiY1N2QUgyIAAJAFkYcYQkdokE7e0Jm35d/O3IMSp7HsdgmRzgmwS4kwGdDzqQiJW oBOgpAB6YTm/m4XV4A/D2BZCEW9TMA9i9ROc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uR2Q5iEyxGiWW0TsSf+fLL7yus1zRFGEpIBJL3HBzdQ=; b=pF117qqO/urUySFxXGCdcJWCYCBO/Qyp69CBad0s4hKBaDpB/sy7BFZOws2nFpEuvE nVfckzRiXL3iysxR6RnbApx33C27u8XWcQcKrfTHdT5Dkv1xhF3KGpUMOEYg4NOC8xS2 WGGM1MH7hN5kJMfguTAv9fGp3kzixJPdohhWJmjS1J85BSrBv8oHyjNk9vZHw16W57TR XZw/8150y4B68KQ1ilcSLJ/qalrdhsd4MW8hFJBA1XNNnaD+4UwN5pdlbRwhuVFK5HUR mGPrt1sCEMrN7YTF+6U4Cv0Jz9dK8iVwNADsbuynvUHZUtx4PWObosKB+kKjzBfVK9Ox 4ydA== X-Gm-Message-State: ALKqPwdoVa+Hi4bAMCZT/G+z6rf4x1cE/bdLXVnOlV1beLZ7FMBBeJHG locIk5uuNN1LK3ugW7rR69TTexlB3F0= X-Received: by 2002:a62:c485:: with SMTP id h5-v6mr3725878pfk.86.1526006713994; Thu, 10 May 2018 19:45:13 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id n18-v6sm5420915pfg.36.2018.05.10.19.45.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 19:45:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 19:44:48 -0700 Message-Id: <20180511024454.31679-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511024454.31679-1-richard.henderson@linaro.org> References: <20180511024454.31679-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH v3 05/11] 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@linaro.org, alex.bennee@linaro.org, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) -- 2.17.0 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index eb69a548e1..031213bb06 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -615,6 +615,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. */ @@ -4881,11 +4889,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); @@ -7784,13 +7790,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); @@ -8331,13 +8334,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); @@ -12235,11 +12235,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 */