From nobody Tue Feb 10 08:31:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549540724568587.2543633391097; Thu, 7 Feb 2019 03:58:44 -0800 (PST) Received: from localhost ([127.0.0.1]:38462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griKE-0002Oi-Fi for importer@patchew.org; Thu, 07 Feb 2019 06:58:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griFt-0007AD-Bg for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1griFs-0001Nk-6Q for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:09 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:37562) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1griFr-0001Mm-VK for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:08 -0500 Received: by mail-wm1-x342.google.com with SMTP id g67so6357047wmd.2 for ; Thu, 07 Feb 2019 03:54:07 -0800 (PST) Received: from cloudburst.twiddle.net ([37.205.61.206]) by smtp.gmail.com with ESMTPSA id w16sm34030016wrp.1.2019.02.07.03.54.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 03:54:05 -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=Wex9tkOudTlKEMJKUmmswWyKmSvTRcgb3wqfx0OKj5M=; b=uqIfJ2mTE+yiBJMQsryZJRumyYfgdLAokXWOX9wa3kseTCCdKFo1E+M9zYtRvoGobj gr4QjiYzk/lwbZ60D5um1dQ5w3XgHrBBrzVrhExqjoBa6Y+ByCb40TmOLohmLzbpNzXZ zSp/2qisZbPZ+SIEQoYakuo3niy/5Z8sebwGzW8u+U6zYeJ3oX8cPMboMQltBrLwmMXf 0fQMalqaCVYQDCQ/eYF+MTFSxeXzx87+By3LPtO+MT2249+NcuJmNaqfvRNIOTokpWHb KpHX6YjB6vFjsdJoyYUg0+RXxSoZfYXlxDk8+VKruvsElWbjG5FU/XApq75rhjBC5fAY SO5g== 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=Wex9tkOudTlKEMJKUmmswWyKmSvTRcgb3wqfx0OKj5M=; b=JYYlqFZNpnyjHEnB8D+nmzXvcdqsx3dcxqzbUP7V9PkJCAzdF8ZGDy5/xH0O7VgEYQ OPcICcLBNHyfkb1dPv5xkJ7ZjcAFEoCoCHAHnghAb7vhvA8MKRs5QyLVIywPHfoCK+Bf kH4NlUP+Jkxp563BrnXMcopEdibwXqPvm+raErog56TofGctzjTE9suGZ3zltsUDLUkV uT7Q1fLhCKcBVmVwv76TMPImfiUcCXnl7hJdZTXSUrAz3AQ7skSUmCerLv0zwxSMVQem e40KDQD+z4nGeMUTA/CwW04O2lFhfT6YjuE++T/FVm1yYosc4ZPkJu1ICVm+fqGb7DnR zI7A== X-Gm-Message-State: AHQUAuZxywSVBqanbKDjbBMBJ70qgUUaYETsWLGqQBzxIQPQXu2ajjZ/ vrR+qzD/1utXYrGWgnHnZy9UirBr+nPPNQ== X-Google-Smtp-Source: AHgI3IaLogGNfmBQzWmOLwVlvlhtGl9q0e8nLfHrlfair4iCKp6AkWUvMCS3o6DV0d/9Brk6QpUwMw== X-Received: by 2002:a1c:5656:: with SMTP id k83mr7231484wmb.125.1549540445852; Thu, 07 Feb 2019 03:54:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Feb 2019 11:53:43 +0000 Message-Id: <20190207115400.647-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190207115400.647-1-richard.henderson@linaro.org> References: <20190207115400.647-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 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: , Cc: deller@gmx.de, svens@stackframe.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Convert the BREAK instruction to start. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 24 +++++++++++++++++++----- target/hppa/Makefile.objs | 8 ++++++++ target/hppa/insns.decode | 24 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 target/hppa/insns.decode diff --git a/target/hppa/translate.c b/target/hppa/translate.c index a4f253a022..f50ec7b9c2 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -278,6 +278,9 @@ typedef struct DisasContext { bool psw_n_nonzero; } DisasContext; =20 +/* 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 @@ -661,7 +664,8 @@ static void nullify_set(DisasContext *ctx, bool x) } =20 /* Mark the end of an instruction that may have been nullified. - This is the pair to nullify_over. */ + This is the pair to nullify_over. Always returns true so that + it may be tail-called from a translate function. */ static bool nullify_end(DisasContext *ctx) { TCGLabel *null_lab =3D ctx->null_lab; @@ -745,12 +749,17 @@ static bool gen_illegal(DisasContext *ctx) return gen_excp_iir(ctx, EXCP_ILL); } =20 -#define CHECK_MOST_PRIVILEGED(EXCP) \ +#ifdef CONFIG_USER_ONLY +#define CHECK_MOST_PRIVILEGED(EXCP) \ + return gen_excp_iir(ctx, EXCP) +#else +#define CHECK_MOST_PRIVILEGED(EXCP) \ do { \ if (ctx->privilege !=3D 0) { \ return gen_excp_iir(ctx, EXCP); \ } \ } while (0) +#endif =20 static bool use_goto_tb(DisasContext *ctx, target_ureg dest) { @@ -1982,7 +1991,7 @@ static bool trans_nop(DisasContext *ctx, uint32_t ins= n, const DisasInsn *di) return true; } =20 -static bool trans_break(DisasContext *ctx, uint32_t insn, const DisasInsn = *di) +static bool trans_break(DisasContext *ctx, arg_break *a) { return gen_excp_iir(ctx, EXCP_BREAK); } @@ -2308,7 +2317,6 @@ static bool gen_hlt(DisasContext *ctx, int reset) #endif /* !CONFIG_USER_ONLY */ =20 static const DisasInsn table_system[] =3D { - { 0x00000000u, 0xfc001fe0u, trans_break }, { 0x00001820u, 0xffe01fffu, trans_mtsp }, { 0x00001840u, 0xfc00ffffu, trans_mtctl }, { 0x016018c0u, 0xffe0ffffu, trans_mtsarcm }, @@ -4534,8 +4542,14 @@ static void translate_table_int(DisasContext *ctx, u= int32_t insn, =20 static void translate_one(DisasContext *ctx, uint32_t insn) { - uint32_t opc =3D extract32(insn, 26, 6); + uint32_t opc; =20 + /* Transition to the auto-generated decoder. */ + if (decode(ctx, insn)) { + return; + } + + opc =3D 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 +=3D translate.o helper.o cpu.o op_helper.o gdbstub.o mem_helper.o obj-y +=3D int_helper.o obj-$(CONFIG_SOFTMMU) +=3D machine.o + +DECODETREE =3D $(SRC_PATH)/scripts/decodetree.py + +target/hppa/decode.inc.c: $(SRC_PATH)/target/hppa/insns.decode $(DECODETRE= E) + $(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..2822fbc58b --- /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 ----- --=20 2.17.2