From patchwork Sun May 26 01:09:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 165185 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5434409ili; Sat, 25 May 2019 18:35:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOQm9kQf7avLMRtMy6IEEPabiTZp5432xQmKQ8vooRXHZZ0aBKpaHrHfrioOj3AltrsRwx X-Received: by 2002:ab0:13ef:: with SMTP id n44mr9731149uae.4.1558834523174; Sat, 25 May 2019 18:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558834523; cv=none; d=google.com; s=arc-20160816; b=BgovfeVtjFAdM+rEhlL7VwbWYuxXNp8cekRi8tK4m6aCDcwqmx+YkueuCuxgD4Rc5i NJZ3wXMlr9a+BSaY1HewK0iUJQCyj8t2fl3ay+/UefsUVUGlbZ0EKA/x/bLzALaOk5im rP0rLxjnMuNYkBeGzc3ZLK5hXo4ufsdznk7rNo7i9MOMRj82o3t3uK6GWzXJRpo6xwbb F2HdrgMwefQ3cX7FEnuyzdlCuTdu6DM3rj6QkT6E1DSDzEl63at5a9+T73/D/17piUsO yDN5hD93aUaq/CuuiLAPUfAb53cTZc8fkRfCYwtCVE/EjQG8MguBzE8QoIhxtYTx0r7j ZzvA== 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:to:from :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date; bh=AGynrsN21pUOx1n9WYF4sVDzoqOhDbKXNfRUTxBfjrw=; b=GMsyb0vuVTJubT5QSfDePQRVadNkSvStJv5N/juY4qoO66AvdWY0flKVCGf/erxCTq DVsDLsLP30T2SatVVZvH8DMC4s4difEGX24btJ50T4QUI1no3wWJuzvWR9tEfCoh2/c6 SP815S25SiYMAnaLKPXetdMoWWSGb2yC9Vi/W8qcAtccAhZJCPrpNwAYGLz1nevPxX+v UJeJi6LJQgu/zy1HpIJydoAmzGnu0vjRshSRcq+CSJNi2R4YoHd4s+yHqUXVw1tgYCCf cwIc6axaqHGcQOumCuJocqkpstZ0dGApe1om5RrQWw14GjuTyuttBquSpIKuxN9IWcUx 3c3w== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z4si2750531uae.211.2019.05.25.18.35.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 25 May 2019 18:35:23 -0700 (PDT) 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; 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" Received: from localhost ([127.0.0.1]:49181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUi4I-00018j-LZ for patch@linaro.org; Sat, 25 May 2019 21:35:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUhxR-0003Hg-27 for qemu-devel@nongnu.org; Sat, 25 May 2019 21:28:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUhfr-0005nT-DL for qemu-devel@nongnu.org; Sat, 25 May 2019 21:10:08 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hUhfr-0005lj-69 for qemu-devel@nongnu.org; Sat, 25 May 2019 21:10:07 -0400 Received: by mail-pf1-f193.google.com with SMTP id b76so7496168pfb.5 for ; Sat, 25 May 2019 18:10:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=AGynrsN21pUOx1n9WYF4sVDzoqOhDbKXNfRUTxBfjrw=; b=O8sDa5kVYJLu0kOQNUNewa9Zhl7pqUVzOWCUxhyRpTsvRc4DP5L0I5n72LDHALSz2I C48E5TSIt5VQsSvqOAJt5JId00z4FV8RTKc7gphiNlG595gA9ew55UaGpZv+XG+4zz8S GiJyeQ//5SmldHibJsw5eENTiOgsM670jU2ni7QWhEgCEb6T8oBxS8Ef70TgKrqzUzmq +OumWLAvOEdN9GcNlgqJT4h9J+oPU9gEMCurdrbqW//uelYGC/dLz/ozktnIqFIeS5Dw I8l3Sko47XGWvLGTc22mZuDRiQlsrI9cIHTFY7TK9rf6TSzmPbnkkVKpZY5h/NWgYrk1 gQsg== X-Gm-Message-State: APjAAAWi97+HnaWZrIV94MtC36BdGPbPyYf3+4Xjl63yCC+yvVqCC4gO L3Hu9bf8Gck799rVU3EOAdRDwwkFSds= X-Received: by 2002:aa7:8dcd:: with SMTP id j13mr22711737pfr.107.1558833005679; Sat, 25 May 2019 18:10:05 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id e123sm6733854pgc.29.2019.05.25.18.10.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 May 2019 18:10:05 -0700 (PDT) Date: Sat, 25 May 2019 18:09:23 -0700 Message-Id: <20190526010948.3923-5-palmer@sifive.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190526010948.3923-1-palmer@sifive.com> References: <20190526010948.3923-1-palmer@sifive.com> MIME-Version: 1.0 From: Palmer Dabbelt To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.210.193 Subject: [Qemu-devel] [PULL 04/29] target/riscv: Name the argument sets for all of insn32 formats 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: Richard Henderson , Palmer Dabbelt , qemu-riscv@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 10 +++++++--- target/riscv/translate.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) -- 2.21.0 diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 6f3ab7aa52d3..77f794ed703d 100644 --- a/target/riscv/insn32.decode +++ b/target/riscv/insn32.decode @@ -34,9 +34,13 @@ %imm_u 12:s20 !function=ex_shift_12 # Argument sets: +&empty &b imm rs2 rs1 &i imm rs1 rd +&j imm rd &r rd rs1 rs2 +&s imm rs1 rs2 +&u imm rd &shift shamt rs1 rd &atomic aq rl rs2 rs1 rd @@ -44,9 +48,9 @@ @r ....... ..... ..... ... ..... ....... &r %rs2 %rs1 %rd @i ............ ..... ... ..... ....... &i imm=%imm_i %rs1 %rd @b ....... ..... ..... ... ..... ....... &b imm=%imm_b %rs2 %rs1 -@s ....... ..... ..... ... ..... ....... imm=%imm_s %rs2 %rs1 -@u .................... ..... ....... imm=%imm_u %rd -@j .................... ..... ....... imm=%imm_j %rd +@s ....... ..... ..... ... ..... ....... &s imm=%imm_s %rs2 %rs1 +@u .................... ..... ....... &u imm=%imm_u %rd +@j .................... ..... ....... &j imm=%imm_j %rd @sh ...... ...... ..... ... ..... ....... &shift shamt=%sh10 %rs1 %rd @csr ............ ..... ... ..... ....... %csr %rs1 %rd diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 840ecbef36e7..928374242e83 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -687,11 +687,29 @@ static bool gen_shift(DisasContext *ctx, arg_r *a, #include "insn_trans/trans_rvd.inc.c" #include "insn_trans/trans_privileged.inc.c" +/* + * Auto-generated decoder. + * Note that the 16-bit decoder reuses some of the trans_* functions + * initially declared by the 32-bit decoder, which results in duplicate + * declaration warnings. Suppress them. + */ +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wredundant-decls" +# ifdef __clang__ +# pragma GCC diagnostic ignored "-Wtypedef-redefinition" +# endif +#endif + bool decode_insn16(DisasContext *ctx, uint16_t insn); /* auto-generated decoder*/ #include "decode_insn16.inc.c" #include "insn_trans/trans_rvc.inc.c" +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic pop +#endif + static void decode_opc(DisasContext *ctx) { /* check for compressed insn */