From patchwork Sat May 12 00:32:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135580 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1559038lji; Fri, 11 May 2018 17:38:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZogCHTMTcNkDjBrtW54AlFHDVwypfnjoU8rpfc4Y0I1T412pklfzwKnvI/uFwfDoC5HujNn X-Received: by 2002:a0c:d2f9:: with SMTP id x54-v6mr542548qvh.245.1526085513776; Fri, 11 May 2018 17:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526085513; cv=none; d=google.com; s=arc-20160816; b=EP+jHo0U0+uhLD8+f7Mvb5/DFSFR0MestvFKw5iTW7xjmasfxsvZZsLlTNQ4Em+Kca pJuNCjR4NYJa/IRJAyBptRNBW+SfUyWZH0d0klmO3OVe8A5Kf0Ez8svLU9e2emuZ90CA iXHSzzHatNVwN6jyjpBaJm9e3qCwRftPiGvzQlgqQZ6m3Mw46u84UN+b8FlKAoj12sxN 0cNKRXw5EVTemi1KHjIBH0YYmmeUPItx750inhvo/ppz3gwtAOEzuyXQXy95wxRkhb+6 EghQfkMHbE1WaoeLO5T7+Eij/TZb2pluF1nlf2+eXtxkjEK+5zi82T5vbXKfiMvqLFfA Fb4A== 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=Gl9IacEMEk7hTYbHfUyGESBtRu8Edb0SzjekHtJHhvI=; b=CoKwJt2rmGKbWGTiwmsotWqf8nV23q3CyAI6NjiThqdHDbKv9O65BtvBEj3UE4jsW8 9bd/5/shLDaLpIjKiWhcjNHlIXsy5Nkogu+uezUd90OK7SWMGUZuiI9BidXMXeIHGnOP PhtVk2fldbBOLe6QjRW9VbsV8EWVw7rEhj13pcOeBslZQPrnSdcFoQ7BuItgOxqpHf8s 9r4UnWnVityLTvsA9ZQ9hvRjy9HTqZn+3IcIQKBTzQieZCgGruPT/+B9ds7J1U7Yvs1I xrQV5/ZnSFrP5XtdPfxWO0p4Q5PkKVD5ztWlSvCHSXRP5xwOcAjEZWoDGWux3rOdGCd6 +wVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U8soI7RG; 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 a184-v6si4195656qke.81.2018.05.11.17.38.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 11 May 2018 17:38:33 -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=U8soI7RG; 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]:58636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHIYT-0003ep-6x for patch@linaro.org; Fri, 11 May 2018 20:38:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHISb-0006Ef-Vz for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHISa-0008AM-Um for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:30 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:34156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHISa-00089F-QZ for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:28 -0400 Received: by mail-pl0-x241.google.com with SMTP id ay10-v6so4134338plb.1 for ; Fri, 11 May 2018 17:32:28 -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=Gl9IacEMEk7hTYbHfUyGESBtRu8Edb0SzjekHtJHhvI=; b=U8soI7RGo+8JXIOGQ6PNoFU87O++gLbddTBJRpGQds3qnpzvVqpncg1I+skDk791tG 3aZflIhuFy5UsmyO3KfSQ8Tz5181ld6Pl7f2Ekn/s+z9XmnZnrct4zOCLuPvuMdrj5sV P4IG74m8cTk437f9nxrGg1yrYuYVvTrRI1M+Y= 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=Gl9IacEMEk7hTYbHfUyGESBtRu8Edb0SzjekHtJHhvI=; b=SqkN0Y23IHVll+vJNEmX9RhmTLpBLbUgnvfcfBUuIWRQAZpwuTxekDi35+PNihsrf/ L8x6eTlkvG0WPXqu1pq0OE4sNZ9bO/ifpOEww/aTsohz9rCGcdtI7gzeunYsAbJay0hd Ykh49fVCJpNnqEE25XyhC2/Hk37O9lt1wU3s9M2cD2fMFp6rhUNHUAuWdVWe0jNHW1xY b2KJh/Is5ND9IYAz77MDHQNbBOQYXoBdb3wr0MjaFIkSJXdbv/zHb4SEANKMUQ12CVzz w2mk6fhzg93vMJYF/5O+sR6SodTJgJY5WxuXlNxi55oModCgPCRxBkE0y0W1F5zLWkRW 4JPQ== X-Gm-Message-State: ALKqPwcaiIFMwPtMN3TYRnJZdWnPzA8kLznl/S329xl4chKZRGa5nI6w r2tEXFTWfwSrQ1KusHsfVLkOpoQKbkM= X-Received: by 2002:a17:902:4545:: with SMTP id m63-v6mr269459pld.268.1526085147619; Fri, 11 May 2018 17:32:27 -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 v186-v6sm7599735pfb.45.2018.05.11.17.32.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 May 2018 17:32:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 11 May 2018 17:32:11 -0700 Message-Id: <20180512003217.9105-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512003217.9105-1-richard.henderson@linaro.org> References: <20180512003217.9105-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:c01::241 Subject: [Qemu-devel] [PATCH v4 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 Reviewed-by: Alex Bennée diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index d0ed125442..78f12daaf6 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 */