From patchwork Tue Feb 12 04:57:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158081 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3420159jaa; Mon, 11 Feb 2019 21:10:34 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibh9M+c/y/NdhYxfHMGezRsUwTuldH3682YT8zpF+jqcQYIYcRf6flDlokT8+0yvWWdB9VW X-Received: by 2002:a25:418a:: with SMTP id o132mr1433551yba.180.1549948233956; Mon, 11 Feb 2019 21:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549948233; cv=none; d=google.com; s=arc-20160816; b=NQLlzTsD76IiDL/EYucEDPtHsuSmMHYL3NMcCHPPbeSMHpTe4BXT53m1CELzwKzhyK LV5OiKnP0X/Vl3Ij9NVSyc7MZy9Foas2V/C9hKNfZoYPbP9XJNCtQjNxRmXERleyOYhX 1r/uCbfWnzk0Py8rmUrU4jhMgxZvmOn3WHZEvlQkvQMWoYiBgO/GnwAnbpdQpaWb0DK/ nJ7fRmC8xNvLekd9768zEXyeFEsSjZXtV0VlWGwg1SoGiJ+3liw3P9rdvIUPMV0/nhJf CEV/nUmDfduTnOAnsNfmsg2mMrP1z/tDX3bM0Vn5L4psm+6CPK7FRfi3LgX4ImOY34vG DlfA== 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; bh=Q3A96WVPBWaMc6bcOLCezvVP2BbuDUnX3Um0NLg1fDA=; b=T1ug9xoLMVVqYQ2juzPcMXMxPN0fMpopHmET48zG6NH3yHN9YbRnI+pMyjc/xK0kSv KvveRzNoDnCfFcDRiL1HwDvjbQKLPMN4TIB3TaxZRi35y668iQ+FhTan4l7awuVApkSE vmq3FEQXVgyc49SfsmjH93IR/0oqL07Qq0CstGL2fpUQgPCVHWSUlK1/l9wWopDiujYY sF3Pc2mPI8J8F5csyPDVFsUFA/NzWO9rwAdlWcU44eRy0lHoJB+ydSvtSeN3eWqaSNfb AKqOx+zzWubR5UnimtZsS5bcOA17zsSG/YYvMoA5kSnWhmIMbnJmn5ChPU4TWtgTIZQ9 Xrrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=C3XkITzq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id t128si7081682yba.7.2019.02.11.21.10.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 21:10:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=C3XkITzq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:33273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtQL3-000416-Dw for patch@linaro.org; Tue, 12 Feb 2019 00:10:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtQ95-0002mx-9x for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:58:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtQ8n-0001ub-Rr for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:58:01 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:32961) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtQ8m-0001iU-6H for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:57:53 -0500 Received: by mail-pl1-x642.google.com with SMTP id y10so705793plp.0 for ; Mon, 11 Feb 2019 20:57:45 -0800 (PST) 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=Q3A96WVPBWaMc6bcOLCezvVP2BbuDUnX3Um0NLg1fDA=; b=C3XkITzqKqBXwrlKNzLZKDHz0dqbuYS0OtdbPo92T55SBq4FtKhhcj2SS+gdAQUljY V5rPoZl2Rq3KNHERV8ek2OMn4H7xwwSTVSbZvYeIxCpwJmjTNHg4P7fSZ25WAzquPiiO 08dKrOOOy79413pB2M/HWvVv4evwRFggD1h2Nbf6ZG+KvXVWyLlDQK/D48JSSgOXguS1 Bgw9UmuYSdBwnu2cnekO1TYqezwIL/b+JqRtjz/0wfFxIjUfNH+LvtxgxgHYHsAYExhd s2Pl96dUIdAs7KWbIrfV0YmVUuipId4kBXs7uAFnjPFGIEvXTTGMGzVpSjPnpTB0tBhV acIw== 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=Q3A96WVPBWaMc6bcOLCezvVP2BbuDUnX3Um0NLg1fDA=; b=ANZJ+JRBXG4IGDiRyqslKkVJBBxeB4YOaCQFeH78tUeSRFCuYN8I07xlVKTy9m3Fs9 eG+oCOIyGqZvfF2jQ6czx7LDueIuAR3JoRktbE5THb8b9XQCi/O0bmj9FIbaAc/hWB3G IBTxto1gfvqvu0gcujXk2kOWBnppILOu2cDiAG0PPlCiBBLukJqaqjSDkzsGGDy9pF1C UehmqGvH0L7sAlnN1hyg/uZM5CbEBO8Df24V04mu6pK1ENzYUeGZl5IPIRrkQyPOuJ5C mDlPv7kcJXoW/9EvFgt5r7YKU5XcV00s3jSzu8OFaVy//R2kWNM/JCUvYgaL0OjtOJ76 tKtg== X-Gm-Message-State: AHQUAubA2JSrNwBsFIeusuFtdPkX/17GF88vGHfzeHFn6g60UYu3nvSH qj0TOtk9TVxb7C8G1amMAJ56fA/eJmA= X-Received: by 2002:a17:902:ab92:: with SMTP id f18mr2022863plr.221.1549947464650; Mon, 11 Feb 2019 20:57:44 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id a90sm22088923pfj.109.2019.02.11.20.57.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 20:57:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 20:57:14 -0800 Message-Id: <20190212045721.28041-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190212045721.28041-1-richard.henderson@linaro.org> References: <20190212045721.28041-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [PULL 17/24] target/hppa: Convert fp fused multiply-add insns 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Helge Deller Tested-by: Sven Schnelle Signed-off-by: Richard Henderson --- target/hppa/translate.c | 77 +++++++++++++--------------------------- target/hppa/insns.decode | 12 +++++++ 2 files changed, 36 insertions(+), 53 deletions(-) -- 2.17.2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c73a7ab3db..3889851109 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -876,14 +876,6 @@ static unsigned assemble_rb64(uint32_t insn) return r1 * 32 + r0; } -static unsigned assemble_rc64(uint32_t insn) -{ - unsigned r2 = extract32(insn, 8, 1); - unsigned r1 = extract32(insn, 13, 3); - unsigned r0 = extract32(insn, 9, 2); - return r2 * 32 + r1 * 4 + r0; -} - static inline unsigned assemble_sr3(uint32_t insn) { unsigned s2 = extract32(insn, 13, 1); @@ -4041,67 +4033,50 @@ static bool trans_fmpysub_d(DisasContext *ctx, arg_mpyadd *a) return do_fmpyadd_d(ctx, a, true); } -static bool trans_fmpyfadd_s(DisasContext *ctx, uint32_t insn, - const DisasInsn *di) +static bool trans_fmpyfadd_f(DisasContext *ctx, arg_fmpyfadd_f *a) { - unsigned rt = assemble_rt64(insn); - unsigned neg = extract32(insn, 5, 1); - unsigned rm1 = assemble_ra64(insn); - unsigned rm2 = assemble_rb64(insn); - unsigned ra3 = assemble_rc64(insn); - TCGv_i32 a, b, c; + TCGv_i32 x, y, z; nullify_over(ctx); - a = load_frw0_i32(rm1); - b = load_frw0_i32(rm2); - c = load_frw0_i32(ra3); + x = load_frw0_i32(a->rm1); + y = load_frw0_i32(a->rm2); + z = load_frw0_i32(a->ra3); - if (neg) { - gen_helper_fmpynfadd_s(a, cpu_env, a, b, c); + if (a->neg) { + gen_helper_fmpynfadd_s(x, cpu_env, x, y, z); } else { - gen_helper_fmpyfadd_s(a, cpu_env, a, b, c); + gen_helper_fmpyfadd_s(x, cpu_env, x, y, z); } - tcg_temp_free_i32(b); - tcg_temp_free_i32(c); - save_frw_i32(rt, a); - tcg_temp_free_i32(a); + tcg_temp_free_i32(y); + tcg_temp_free_i32(z); + save_frw_i32(a->t, x); + tcg_temp_free_i32(x); return nullify_end(ctx); } -static bool trans_fmpyfadd_d(DisasContext *ctx, uint32_t insn, - const DisasInsn *di) +static bool trans_fmpyfadd_d(DisasContext *ctx, arg_fmpyfadd_d *a) { - unsigned rt = extract32(insn, 0, 5); - unsigned neg = extract32(insn, 5, 1); - unsigned rm1 = extract32(insn, 21, 5); - unsigned rm2 = extract32(insn, 16, 5); - unsigned ra3 = assemble_rc64(insn); - TCGv_i64 a, b, c; + TCGv_i64 x, y, z; nullify_over(ctx); - a = load_frd0(rm1); - b = load_frd0(rm2); - c = load_frd0(ra3); + x = load_frd0(a->rm1); + y = load_frd0(a->rm2); + z = load_frd0(a->ra3); - if (neg) { - gen_helper_fmpynfadd_d(a, cpu_env, a, b, c); + if (a->neg) { + gen_helper_fmpynfadd_d(x, cpu_env, x, y, z); } else { - gen_helper_fmpyfadd_d(a, cpu_env, a, b, c); + gen_helper_fmpyfadd_d(x, cpu_env, x, y, z); } - tcg_temp_free_i64(b); - tcg_temp_free_i64(c); - save_frd(rt, a); - tcg_temp_free_i64(a); + tcg_temp_free_i64(y); + tcg_temp_free_i64(z); + save_frd(a->t, x); + tcg_temp_free_i64(x); return nullify_end(ctx); } -static const DisasInsn table_fp_fused[] = { - { 0xb8000000u, 0xfc000800u, trans_fmpyfadd_s }, - { 0xb8000800u, 0xfc0019c0u, trans_fmpyfadd_d } -}; - static void translate_table_int(DisasContext *ctx, uint32_t insn, const DisasInsn table[], size_t n) { @@ -4137,10 +4112,6 @@ static void translate_one(DisasContext *ctx, uint32_t insn) case 0x0E: translate_table(ctx, insn, table_float_0e); return; - - case 0x2E: - translate_table(ctx, insn, table_fp_fused); - return; } gen_illegal(ctx); } diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index f564e54f1d..1c8102f76e 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -39,6 +39,10 @@ %rm64 1:1 16:5 %rt64 6:1 0:5 +%ra64 7:1 21:5 +%rb64 12:1 16:5 +%rc64 8:1 13:3 9:2 +%rc32 13:3 9:2 %im5_0 0:s1 1:4 %im5_16 16:s1 17:4 @@ -338,3 +342,11 @@ blr 111010 l:5 x:5 010 00000000000 n:1 0 bv 111010 b:5 x:5 110 00000000000 n:1 0 bve 111010 b:5 00000 110 10000000000 n:1 - l=0 bve 111010 b:5 00000 111 10000000000 n:1 - l=2 + +#### +# FP Fused Multiple-Add +#### + +fmpyfadd_f 101110 ..... ..... ... . 0 ... . . neg:1 ..... \ + rm1=%ra64 rm2=%rb64 ra3=%rc64 t=%rt64 +fmpyfadd_d 101110 rm1:5 rm2:5 ... 0 1 ..0 0 0 neg:1 t:5 ra3=%rc32