From patchwork Tue Oct 23 12:04:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 149441 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp609785ljp; Tue, 23 Oct 2018 05:07:58 -0700 (PDT) X-Google-Smtp-Source: AJdET5fwocLFYsRVJ7i+MMPiuovc21l2FpLRGpTo7s1CGCIirXlXXvKlBJwKCgQfHhUNHkVvjZ5n X-Received: by 2002:a37:116a:: with SMTP id b103mr6001511qkh.77.1540296477977; Tue, 23 Oct 2018 05:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540296477; cv=none; d=google.com; s=arc-20160816; b=kQt/s/WBOCtZRMYSWLSecuQvPpOx5qwZNWCdQt9TvOZVcSJ6A/iPnxitDK+MpEOK1v b2oLDCnHj9nCM0yc5Zsnn7/Ye3Wyhe9b3swrenyMMPO6DQaVH2tIFLhnAYuymvt3r0hK MPVfd05adCa44Rq1vuiX9L8MdNVc0KtlmfC2lynTgk0hlNxkunaxNqwhxN2DWKxPooUI nYRsWQycF7ztVXe9LAdOXWPDFuUyea0G7ZKMNN3xMgT8DFDl0imhcBfDUVZQII+lzpqb qAnATdkYqfy996LIauP9rxOpVPdX/Ji7r4LqgkC9caBND2sX71aCg+w1wSbvMWyXCk6Y r1sA== 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:message-id:date:to:from :dkim-signature; bh=OhmUCf4HuYgZ6FcxzOkPCYu9fFzds2MXRStOq04ueFc=; b=JPUcIR52mP/QS84wX0yugWQYGc6vdl9svF60tCN8tIpHcSzffFujtbye1w15wH7PoM 4KhH11sf5AaNTMDmTHyPa8HUBALcjPmT8sBJZPYbyOoemiORc040Oo8+eOWqOydkNHHr VVH30GvbvpeULk6xCBoABxCJOS1IsKt0IanNtCqcT3aht4ZyN+o2vD9nxhK6mbpoV1UJ z/zcwXOo/Dg07R2k0zQjpzRNDF3zlxc5im5C2/mvcsx/P04LPCtM+iKC1VACE7YNlTd1 t3WEKrVFrqk5MC2CNg4+TJRJpmi6OcYCeaFJl0VGcYbReDd9S9NOdSk10JKqxjeoNqYb MQtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kuCgFqjB; 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 k17si1025872qvh.114.2018.10.23.05.07.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 23 Oct 2018 05:07:57 -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=kuCgFqjB; 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]:40710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEvTZ-0001Ny-Bq for patch@linaro.org; Tue, 23 Oct 2018 08:07:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEvQq-0005Wy-Lv for qemu-devel@nongnu.org; Tue, 23 Oct 2018 08:05:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEvQl-0007Td-Kw for qemu-devel@nongnu.org; Tue, 23 Oct 2018 08:05:08 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:37196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEvQl-0007T8-AT for qemu-devel@nongnu.org; Tue, 23 Oct 2018 08:05:03 -0400 Received: by mail-wm1-x32e.google.com with SMTP id x19-v6so1500392wmc.2 for ; Tue, 23 Oct 2018 05:05:03 -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; bh=OhmUCf4HuYgZ6FcxzOkPCYu9fFzds2MXRStOq04ueFc=; b=kuCgFqjBUYtrIigmwYXWp2hynQcQAh7U7jK2t9SWUsIA5kwklThfdjUpvJ++TrWOKJ 3vnbfmylTQ0nUr/zYX/QgCA7nDIUC6jEoU2Itc65NUtND+xx1bUajxcprzM6jzMKvnBz 6GSZFR/L+KfvDsDH9EiwU6v2YPt1Hn0kJd8W0= 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; bh=OhmUCf4HuYgZ6FcxzOkPCYu9fFzds2MXRStOq04ueFc=; b=P4b/gS3c+lNeklj4MbX61is20bAAncQJ5V08L+Cc5fc3shPczLTNUheYKE00vQmgQ0 nHxBMxYirkD24VqvkCTIIqF+nZ9VDWgouTizWQv9Ih6MheSgVkB0unT8Mu4VWiwxFrHx gCOKGlV8MYrouBdiarJzKMVux5vHab9abh/uaEdKJzv0luULYc2gFzh3WexoG7OBqFV4 usKFv+mYU06X0+OI1vQuIXDtAsaBlnJHuGAucRiHrjL0zihb4ukmHqwf3/v8vuA1k2TH 3gHkvnmESfbjKx4lV3ea7ZGwRYHv6xaayzWg83s8sIIofea2mFR0i7N+dU2suPs7FpHu m3mA== X-Gm-Message-State: ABuFfogjPUjlexKDzJ2vHPJGqWbY78LVSiwQPtAqhYfAMO2V0uT8aNHl R2RvLPeoq8Cb9uFl5sy8/8iysQmWRLU= X-Received: by 2002:a1c:e157:: with SMTP id y84-v6mr20020500wmg.104.1540296301899; Tue, 23 Oct 2018 05:05:01 -0700 (PDT) Received: from cloudburst.twiddle.net.net ([185.7.230.213]) by smtp.gmail.com with ESMTPSA id a1-v6sm1009200wrt.79.2018.10.23.05.05.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 05:05:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 23 Oct 2018 13:04:47 +0100 Message-Id: <20181023120454.28553-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e Subject: [Qemu-devel] [PATCH 0/7] riscv decodetree followup 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: sagark@eecs.berkeley.edu, kbastian@mail.uni-paderborn.de, palmer@sifive.com, peer.adelt@hni.uni-paderborn.de, Alistair.Francis@wdc.com, mjc@sifive.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The first patch is the promised change to argument sets to allow them to be shared between two decoders. Then I set about trying to use this... and ran into some other interesting problems. The first of which is that bool trans_add(DecodeContext *ctx, struct arg_r *a, uint32_t insn); bool trans_add(DecodeContext *ctx, struct arg_r *a, uint16_t insn); conflicts. I think the best solution is to remove the insn argument to the trans_* functions. When this goes in for real, this will be a big patch that touches lots of lines in target/arm and target/openrisc. For now, I'm ignoring that and only building riscv{32,64}-linux-user. Second, it occured to me that if we smoosh several files together at build time, we don't have to play silly games with trying to decode for riscv32 and riscv64 at the same time. The last patch is, I think, a big improvement in that. Full tree at https://github.com/rth7680/qemu.git riscv-dt-rth. r~ Richard Henderson (7): decodetree: Add !extern flag to argument sets decodetree: Remove "insn" argument from trans_* expanders target/riscv: Update for decodetree insn argument change target/riscv: Rename some argument sets in insn32.decode target/riscv: Convert @cs_2 insns to share translation functions target/riscv: Convert @cl_d, @cl_w, @cs_d, @cs_w insns target/riscv: Splice decodetree inputs for riscv32 vs riscv64 .../riscv/insn_trans/trans_privileged.inc.c | 19 +- target/riscv/insn_trans/trans_rva.inc.c | 90 ++------ target/riscv/insn_trans/trans_rvc.inc.c | 215 ++++-------------- target/riscv/insn_trans/trans_rvd.inc.c | 90 +++----- target/riscv/insn_trans/trans_rvf.inc.c | 78 +++---- target/riscv/insn_trans/trans_rvi.inc.c | 165 ++++++-------- target/riscv/insn_trans/trans_rvm.inc.c | 48 ++-- target/riscv/translate.c | 30 ++- scripts/decodetree.py | 39 ++-- target/riscv/Makefile.objs | 23 +- target/riscv/insn16-32.decode | 31 +++ target/riscv/insn16-64.decode | 33 +++ target/riscv/insn16.decode | 55 ++--- target/riscv/insn32.decode | 68 +----- target/riscv/insn64.decode | 71 ++++++ 15 files changed, 450 insertions(+), 605 deletions(-) create mode 100644 target/riscv/insn16-32.decode create mode 100644 target/riscv/insn16-64.decode create mode 100644 target/riscv/insn64.decode -- 2.17.2