From patchwork Sat Feb 17 20:31:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 128741 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1897802ljc; Sat, 17 Feb 2018 12:32:17 -0800 (PST) X-Google-Smtp-Source: AH8x2257k5lZ9DKFnoGaoOxJ/c7cZo7h6wgVXxO9kzpPrJzB0uQQwDJOsd4GSQVTp/+dUCSgBz1A X-Received: by 10.13.223.75 with SMTP id i72mr1459370ywe.285.1518899537833; Sat, 17 Feb 2018 12:32:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518899537; cv=none; d=google.com; s=arc-20160816; b=arElZ+KjCoqa48EswFTHGli15hh5eppsdPaR3iKJeT7Nk5aGNijTumCJPeU3PNMo6f Kp+kF+KGO8nd84wnsJ5MbYPYhRSWt/vRgqwhobA876JO42r/xL40itrAP0TZqECN62Wo p1y+Vcn4HcHR9N9bapwCaZs9jmX7oYDdXz/wsQY7Z2Wn1fGcbVgHPmdMnuRvfK5jZjlu 4DsZCIqCKqiXuTHJn8KKm+inWOKNdhDzEH5jZ3Se6q2DjHRalOTgCwzXE8ThwFnfdn69 e1yCW6Ua1APtID5Jrn7D7fxI6Md3wpTe66oTRr+Vc0M4ZblIs3nuqTn8eCGd5vlYMLtj LpIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=1JzbxS8rOBy0VrzamLLiGiQjn/KzPVZOI//dCcG7ieU=; b=KfAbY/6bF3IsXksl4f8GOcMsqewZ3XKyPQhprYWRr5phUQ3f5ElDNL7piP0wXJkkst FZmd49kD48WQIOabBU/FL0N87t22dqyXlxNHddH5v+FbVRYbphHwTBGYAtUmvCUxa5K2 BsyeA62r5NVCZ1mJ3PBcZwnrFJ8NwZPh8yWEE9NFTAQKpNM3pUNrZIVYtEWywHvYVIC4 Xenihzy6cTNJZexYHyiutvR21PNGUWWXhpNzOehWO4/v1jRf1PTy6ZbSXTA4/b6K+YIO +K9KrtSsiuoV9dvK8l1yfQ325+F6NeruROixFv2WkEolhg8pB/PMtrorSIS4Xzkm3mUT cUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EK1bz366; 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 x34si855080ybh.287.2018.02.17.12.32.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 17 Feb 2018 12:32:17 -0800 (PST) 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=EK1bz366; 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]:60370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en99d-0008RP-6c for patch@linaro.org; Sat, 17 Feb 2018 15:32:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en994-0008Oy-Qd for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:31:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en993-0000jZ-Hb for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:31:42 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:41651) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en993-0000jB-Aq for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:31:41 -0500 Received: by mail-pg0-x241.google.com with SMTP id t4so4412657pgp.8 for ; Sat, 17 Feb 2018 12:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=1JzbxS8rOBy0VrzamLLiGiQjn/KzPVZOI//dCcG7ieU=; b=EK1bz366tXEQ+DZEVh6pYqtWMYUvVveKlJIdScwJV7I+ShEuXdBhcXX0F6NOQxfPn/ RrQ4rrovjvFxob9m+DIQX0dI3XU14QpYW6d9PxHSQNB8lFajgd5N4AHIKQjWosZWNO32 Og6Z2EyLJ62tky85q3pOjwO53SyJrsVbczoRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=1JzbxS8rOBy0VrzamLLiGiQjn/KzPVZOI//dCcG7ieU=; b=maU0UiW0MMVSb+CYF3ZCRXoWXX4aQuFSkb0tXx/MrP2Tmhch1JM3id7NcuFFrushVG 3NuIzBCo+73+T0U4cv9BuVtOw8K0RoSqdh8qTk1Tgg54GVUdioZCNiLAQvB6ehDvRZ9q JglwEq0GmoERSLYgJgHQ3J5B1KPMTvDeExfv0MUjY80M+TkPYtEn3FqzRNzU2Qbe+87a T4X5q69pUaJjgqYGHjr0Mbap4UUrMPcnSuhIsVv/9dUcNRtuOiSPk7f8IvCQ5tPNciGl W7Anf7SLDqbEdl68pSAx32dj8SRQV8mUeiBrT7HKw9gWzcFfk2PArBNjjVT6w2fqmUWy 9wkw== X-Gm-Message-State: APf1xPCCHQhavY/7ixZxUUZQFko6YeP5McYLmgOJ5kn6PtSKSY3LRt32 BDU15Wh4kSFbhLX41cvd0Kw3UGmdv2A= X-Received: by 10.99.186.88 with SMTP id l24mr8322415pgu.369.1518899499796; Sat, 17 Feb 2018 12:31:39 -0800 (PST) Received: from cloudburst.twiddle.net ([50.0.192.64]) by smtp.gmail.com with ESMTPSA id y7sm48203797pfe.26.2018.02.17.12.31.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 12:31:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 17 Feb 2018 12:31:15 -0800 Message-Id: <20180217203132.31780-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180217203132.31780-1-richard.henderson@linaro.org> References: <20180217203132.31780-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::241 Subject: [Qemu-devel] [PATCH 02/19] target/hppa: Begin using scripts/decodetree.py 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the BREAK instruction to start. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 14 +++++++++++--- target/hppa/Makefile.objs | 8 ++++++++ target/hppa/insns.decode | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 target/hppa/insns.decode -- 2.14.3 Reviewed-by: Bastian Koppelmann diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f72bc84873..a503ae38d4 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -290,6 +290,9 @@ typedef struct DisasContext { bool psw_n_nonzero; } DisasContext; +/* Include the auto-generated decoder. */ +#include "decode.inc.c" + /* We are not using a goto_tb (for whatever reason), but have updated the iaq (for whatever reason), so don't do it again on exit. */ #define DISAS_IAQ_N_UPDATED DISAS_TARGET_0 @@ -1997,7 +2000,7 @@ static void trans_nop(DisasContext *ctx, uint32_t insn, const DisasInsn *di) cond_free(&ctx->null_cond); } -static void trans_break(DisasContext *ctx, uint32_t insn, const DisasInsn *di) +static void trans_break(DisasContext *ctx, arg_break *a, uint32_t insn) { nullify_over(ctx); gen_excp_iir(ctx, EXCP_BREAK); @@ -2320,7 +2323,6 @@ static void gen_hlt(DisasContext *ctx, int reset) #endif /* !CONFIG_USER_ONLY */ static const DisasInsn table_system[] = { - { 0x00000000u, 0xfc001fe0u, trans_break }, { 0x00001820u, 0xffe01fffu, trans_mtsp }, { 0x00001840u, 0xfc00ffffu, trans_mtctl }, { 0x016018c0u, 0xffe0ffffu, trans_mtsarcm }, @@ -4508,8 +4510,14 @@ static void translate_table_int(DisasContext *ctx, uint32_t insn, static void translate_one(DisasContext *ctx, uint32_t insn) { - uint32_t opc = extract32(insn, 26, 6); + uint32_t opc; + /* Transition to the auto-generated decoder. */ + if (decode(ctx, insn)) { + return; + } + + opc = extract32(insn, 26, 6); switch (opc) { case 0x00: /* system op */ translate_table(ctx, insn, table_system); diff --git a/target/hppa/Makefile.objs b/target/hppa/Makefile.objs index 3359da5341..174f50a96c 100644 --- a/target/hppa/Makefile.objs +++ b/target/hppa/Makefile.objs @@ -1,3 +1,11 @@ obj-y += translate.o helper.o cpu.o op_helper.o gdbstub.o mem_helper.o obj-y += int_helper.o obj-$(CONFIG_SOFTMMU) += machine.o + +DECODETREE = $(SRC_PATH)/scripts/decodetree.py + +target/hppa/decode.inc.c: $(SRC_PATH)/target/hppa/insns.decode $(DECODETREE) + $(call quiet-command,\ + $(PYTHON) $(DECODETREE) -o $@ $<, "GEN", $(TARGET_DIR)$@) + +target/hppa/translate.o: target/hppa/decode.inc.c diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode new file mode 100644 index 0000000000..6c2d3a3a52 --- /dev/null +++ b/target/hppa/insns.decode @@ -0,0 +1,24 @@ +# +# HPPA instruction decode definitions. +# +# Copyright (c) 2018 Richard Henderson +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, see . +# + +#### +# System +#### + +break 000000 ----- ----- --- 00000000 -----