From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 154197955726436.553447309295734; Sun, 11 Nov 2018 15:39:17 -0800 (PST) Received: from localhost ([::1]:44011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzJn-0006ZC-4i for importer@patchew.org; Sun, 11 Nov 2018 18:39:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Jd-6o for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHc-0007Hu-Mj for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:42508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHc-00075B-BZ for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:48 -0500 Received: by mail-wr1-x42d.google.com with SMTP id u5-v6so2107094wrn.9 for ; Sun, 11 Nov 2018 15:36:34 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g6s7gOJ4y2TaCur+bIIF66cMn1Pnyvgg+M0NTfYS7ro=; b=a/pN7pIEfJJmZFX4h9l1MoWDzQtcsl9QJ/NfGZps2q8/Vl7jS2K7y2XlxmO0dFkmYS JBDx7LKLX750E4z97Q3nStvPiOXgzK16PPgo9yEXdd/fwGDXYzY4JvJDu+9/IYnxGBr2 SnIDEYH4ALfDfpK60J7JVqaC5uXSVbfCGUaalkbFvKE3x6JFhXN3TXjVkK+JubWoRDgI YCJ3gQlupOd79CVvyQlRRUprw1hK1mmW4ZL7KQYBTEZ18Tf5M4/3MpimGf+Oc8y5yBJx pIR2B/GsDrz5ouJEEQ4BwNAb716w5HkmJRgMe6hsx35iVW2sKy01y9XTdoKQB7kcoHoQ DlMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=g6s7gOJ4y2TaCur+bIIF66cMn1Pnyvgg+M0NTfYS7ro=; b=muXsfAKGUdO/MxOa+7+G5TL+LqLA0sZ/T72+YduEEAlaLzs2It5qyWl6k5luySa3/G 2VLiDhxNKDhFq1DIZNIPyDYGsV1GXdXkLuSPv0kUTa/15CD2Z6jP+BWhOr0IdHhWPim+ MQ48E44f+fNu6RR/WXjsFbB7bdggIzZ0JOp7x/UZiFt1eGsXah6VD+BCgGRmZTwKMOl5 u8kIuj6ISBLlbmp5OeaICMf1y7KX/pJqAUESRpwyFwtFFbJbkITvh+9q6O3Db9IhC0gQ np2R99iBMHNSibrx4g5AGqd0VPkBMPf991ZOzdIjgDLjEzKf/tM3YvHV82AcMrikZ+Wl zG6w== X-Gm-Message-State: AGRZ1gLo2CfoOtiwPufqxPqBi8tCuGkFLkZKF/L7XvJ/cLjntrDumhM4 JXrdiswBTv1DMIHbKiUpyEA= X-Google-Smtp-Source: AJdET5eUaKB0u4nRn/lqLbYRHYfL5phzsgV3yXWoCuYrOsa8xMlJnNZ9MG4+NAWAFFgUiyRNXHVbiA== X-Received: by 2002:adf:e206:: with SMTP id j6-v6mr15185160wri.205.1541979393222; Sun, 11 Nov 2018 15:36:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:12 +0100 Message-Id: <20181111233622.8976-2-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d Subject: [Qemu-devel] [RFC PATCH 01/11] MAINTAINERS: Add scripts/decodetree.py to the TCG section 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 126fe0be7e..45e4bfcd87 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -112,6 +112,7 @@ S: Maintained F: cpus.c F: exec.c F: accel/tcg/ +F: scripts/decodetree.py F: include/exec/cpu*.h F: include/exec/exec-all.h F: include/exec/helper*.h --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541979924889948.8151905249526; Sun, 11 Nov 2018 15:45:24 -0800 (PST) Received: from localhost ([::1]:44050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzPm-0004ue-Ho for importer@patchew.org; Sun, 11 Nov 2018 18:45:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Ja-6o for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHc-0007H9-5J for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:33553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHb-00076T-Sw for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:48 -0500 Received: by mail-wm1-x341.google.com with SMTP id f19-v6so7677806wmb.0 for ; Sun, 11 Nov 2018 15:36:35 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b/EkvK84+7PdAkg1hTw1dxBpU7DwunxMLyk7w3+ugsI=; b=gVeoPQWpT6rfH4JEKj0k7bBlbF/Rmy8c+wuSRQ0RwWjzgFG17U9h4YoqDD3625TD79 9ue2peOy9eT2P8ejOTyAU2uM/9hZoPosVxJ9snVLCB9OM5jLgr2z+uv14DholuKR2Whx sXOE0AL8e3JuilXNbRCyWUUr5roslN9kaAJgRj0CgEhxG9FvWQoSThia7rvz6P+1680W aNP8xHjl3ZfBq/ShIQJNeqnIcMhNl9Zh6ixc8pguCJ8lPIxYDJe1dx6CcBVN8Ulra3tA Z9UMVMnONvHUUy3sACTewQQ9vbHFLVyQoTAMf0EmQwwvyBgJYIE1dhCwBri2Ijko5aqu fQfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=b/EkvK84+7PdAkg1hTw1dxBpU7DwunxMLyk7w3+ugsI=; b=kD7jHzoR4R0bqRFgqRCotzrxmcs219pSeTbbjL1NYjjXnWBQFrRNyW80NCnEE1d5MM ufqQstdHcxp7+VN8wNOw2Q2Ai2s5WzYsrj8wsm+nG6VoQNiYFHEGVZNcZWUuLcQ69wEA ZdAGmJQ5PoDyVH9t3s43cwJAHh69JdOyqbBPmKjDTXhgceHVSX6D6QjynN2oPQe1UJIc nckmycVzILBa0AO54J6EZ3xi1zpKfBhyqmQfqXGK7TIvP3AHSRWOPvtbjU0ioQzytMWB qoPxZ5ERs1fNiOmlvInR01PQ+kJRnP8462uFlhR8DRWGmLuCdAn6TVqjr46Skqb+3+nm 3sNw== X-Gm-Message-State: AGRZ1gLvYrz4Y5XExbZNz6PewmP0v96Tk4rQzeo5VCQqUoaLh+VgsmY5 20cGYsXwa7wvHO5fG7ASEmk= X-Google-Smtp-Source: AJdET5fwAaIbJU11f3kkAjG2mcIFu2W89Aib1MQnoBRBt4e0NwDFXZ2m70ZcPzAoQ0hYdCp1g8gyCg== X-Received: by 2002:a1c:6283:: with SMTP id w125-v6mr5972051wmb.117.1541979394449; Sun, 11 Nov 2018 15:36:34 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:13 +0100 Message-Id: <20181111233622.8976-3-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [RFC PATCH 02/11] decodetree: Add multiple include guard 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: Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) It is necessary when splitting an ISA, or when using multiple ISAs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- TODO: explain why, use case TODO: escape full path? --- scripts/decodetree.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 0bc73b5990..5dea15e7a5 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1030,7 +1030,11 @@ def main(): else: output_fd =3D sys.stdout =20 + hdr_guard =3D filename.split(os.path.sep)[-1].upper().replace('.', '_'= ) + "_H" + output_autogen() + output('#ifndef ' + hdr_guard + '\n') + output('#define ' + hdr_guard + '\n') for n in sorted(arguments.keys()): f =3D arguments[n] f.output_def() @@ -1066,6 +1070,7 @@ def main(): t.output_code(4, False, 0, 0) =20 output('}\n') + output('#endif /* ' + hdr_guard + ' */\n') =20 if output_file: output_fd.close() --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541980323311763.8528367055104; Sun, 11 Nov 2018 15:52:03 -0800 (PST) Received: from localhost ([::1]:44083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzWH-0002hI-Fm for importer@patchew.org; Sun, 11 Nov 2018 18:51:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHg-0003Jz-C2 for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHd-0007IV-7V for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:35281) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHc-00079n-TP for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:49 -0500 Received: by mail-wr1-x434.google.com with SMTP id z16-v6so7398825wrv.2 for ; Sun, 11 Nov 2018 15:36:36 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sj+8FEx9F28OiwZw9lo4iDworHxZOr0OVuJQDvzcpYY=; b=bRUgJi2w5UuiBxh4tGJOmVWRXMWN1OMHH1BmLqW3kA6UsXptoB0hmYdIporQce5mO+ /8akxad1LZvKtgSMS4Z/jxbM2wsD3H5FKbIT5ZdVyHaRuVb/rHrBFUFI2q3ErlaE3dt3 DEyttI1bR+KTkJ+KFujySscJUwkZgDfewgKFb0EuzT7cmMWEpZK1KJGhdS4hci/55FZw TNy3+3/MYymIdwlwbuzITm4LgyeETzh+b6c9LRxK77Irs7q6B7ztzXRB1Lhw2u8a9Da7 ug1jQxd6xjZQJponJdufSTp3IdD0OD7vFivnVvrFnk8jm3atY6Ugu4O9qBGZ8t6PrYWi SQAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sj+8FEx9F28OiwZw9lo4iDworHxZOr0OVuJQDvzcpYY=; b=pwuy1UCDBoewupSrQbK/4u3kEW9Dzph+bW3o/cvSrJjVPDXWNH5Atd6m4kZEVeFaNa XflgFsIq1w0LSTkWrJ0Q750kkfimmseqCOmNiAZp2MxreKAHA56lSco7UjG1xKBKhYqr K6BsUUFqEo8UxYl8MVuwwZfbO521+EsqLeB6P+2XSlnYdhvkFJiYFhjY9xYFy+/AR97E a2j8Ff0MBlcn+C2C/BcaIjqDntDppLO16dqNtm2feL+JvchSnHd7KDJ6Aucd1FTxnvi5 RcjqHWQ2m+XnCl128nYSWsCq90/b8BVXeOoLki5s7HNhhN7iTng/VFy/XOz/iq73TCVV UWSA== X-Gm-Message-State: AGRZ1gLmwud9a21RykFDb4Je0fdsi+hQC4A7DphfT9NvlFyp04Bqs60Z 822wlTAxn8q7tC5gqZxkARI= X-Google-Smtp-Source: AJdET5dkFJQfAJsyEpGTgSGErnRzIaVDRQdvqs+9mGVssDRp9en9blrbZsg87Hw6nYmiejRB7gxQvQ== X-Received: by 2002:adf:f082:: with SMTP id n2-v6mr14215424wro.88.1541979395781; Sun, 11 Nov 2018 15:36:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:14 +0100 Message-Id: <20181111233622.8976-4-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 Subject: [Qemu-devel] [RFC PATCH 03/11] target/mips: Move the !ISA_MIPS32R6 check out of decode_opc_special2_legacy 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: Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/mips/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 60320cbe69..f5e8d0b4d2 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -25649,8 +25649,6 @@ static void decode_opc_special2_legacy(CPUMIPSState= *env, DisasContext *ctx) int rs, rt, rd; uint32_t op1; =20 - check_insn_opc_removed(ctx, ISA_MIPS32R6); - rs =3D (ctx->opcode >> 21) & 0x1f; rt =3D (ctx->opcode >> 16) & 0x1f; rd =3D (ctx->opcode >> 11) & 0x1f; @@ -27890,6 +27888,7 @@ static void decode_opc(CPUMIPSState *env, DisasCont= ext *ctx) } else if (ctx->insn_flags & ASE_MXU) { decode_opc_mxu(env, ctx); } else { + check_insn_opc_removed(ctx, ISA_MIPS32R6); decode_opc_special2_legacy(env, ctx); } break; --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541979701687840.3767955693673; Sun, 11 Nov 2018 15:41:41 -0800 (PST) Received: from localhost ([::1]:44029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzMK-0000K0-7K for importer@patchew.org; Sun, 11 Nov 2018 18:41:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003JY-5Q for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHc-0007Gt-1N for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:53062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHb-0007AA-Om for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:47 -0500 Received: by mail-wm1-x341.google.com with SMTP id r11-v6so6742489wmb.2 for ; Sun, 11 Nov 2018 15:36:38 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RfrDkvg14WphT4ihObxidd+bVc9awNZtXYbbTqYH3TY=; b=rjaUKkDGSBF+DDw6qnImGJDDWfZ2Q+jAEcLIHdNtsG8KF/hFFrFbk9XkpS8QOEdlHE dPj0gKtrU42YjIJgEzux84ZIV4VsQvFNU0WIPdyq7E2YB2HfsxHEikANi3L/AsS+XRja 3MIj/iD6bot5GVn8WEYJboGk3rStKPxU7OerESP3OCRH1M3T8sG0+ouVo5FZs67HXz1k WbEyyOkXPFhvxzMd0vnBdDxM+BH6wPt0eTdk3ZD7iouzZ4jQx3gy6pdhcFXErJ8/5wuK bKWohPNyTAzyaZOmch90vP/KIquyb6EuL3R0U/+SbqxxdVfjYT2U1OwxWal7jIhsl6m+ QFUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RfrDkvg14WphT4ihObxidd+bVc9awNZtXYbbTqYH3TY=; b=bLzQrU7b8EtXQ1e5PwzB8QF/ddvmH3tj+Imdx7JXHcPxld6Ryq+dRqEzxW7DxgYqzL phgDHW5vdgV+sHK9hSSl6bFLPmdmbw1yZQryAh4tMuZSCOxNiGzIOQIapT8kl+6JO5t9 AS050phHHYNSmt88aMrxDLNNcVeQPqIZpMxT3dE6QtoVjS7PTcNRcbfV1WBaRMnQAVNr 8dKgtMuDY5W4W1ABCS0iQGvsoTBiQHEz1coKsUcZOzZvB4Rz9s6rej60XKCN5qj2dPPz LOohmrhHvO9zl/7vXx90e7bPNhItmi0yoqS9O7NoVWGXrRx9W5q+GgZB8PG7ocBD4t79 Ez+Q== X-Gm-Message-State: AGRZ1gLlCebfK68n7NijRuPG72mgfYX53FZg+hSktR7Jk/2WrLcWHdsj trIugvct2jArcxOkCvq1oNVuZcjF X-Google-Smtp-Source: AJdET5eHlk7mbfAgpAq4G3u8q5WOuXZykw/DfBYu6M5p72ptJlgNB9aYHTmJbYMno6Q/sxARd1Oj+w== X-Received: by 2002:a1c:ae0a:: with SMTP id x10-v6mr6224117wme.137.1541979396977; Sun, 11 Nov 2018 15:36:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:15 +0100 Message-Id: <20181111233622.8976-5-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [RFC PATCH 04/11] target/mips: Avoid access to CPUMIPSState from decode* functions 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: Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The DisasContext is already initialized from the CPUMIPSState in mips_tr_init_disas_context(). Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/mips/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index f5e8d0b4d2..e726f3ec00 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -16534,7 +16534,7 @@ static void decode_micromips32_opc(CPUMIPSState *en= v, DisasContext *ctx) check_insn(ctx, ASE_MIPS3D); /* Fall through */ do_cp1branch: - if (env->CP0_Config1 & (1 << CP0C1_FP)) { + if (ctx->CP0_Config1 & (1 << CP0C1_FP)) { check_cp1_enabled(ctx); gen_compute_branch1(ctx, mips32_op, (ctx->opcode >> 18) & 0x7, imm << 1); @@ -23809,7 +23809,7 @@ static void decode_opc_special_legacy(CPUMIPSState = *env, DisasContext *ctx) break; case OPC_MOVCI: check_insn(ctx, ISA_MIPS4 | ISA_MIPS32); - if (env->CP0_Config1 & (1 << CP0C1_FP)) { + if (ctx->CP0_Config1 & (1 << CP0C1_FP)) { check_cp1_enabled(ctx); gen_movci(ctx, rd, rs, (ctx->opcode >> 18) & 0x7, (ctx->opcode >> 16) & 1); --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541979557327986.401893565844; Sun, 11 Nov 2018 15:39:17 -0800 (PST) Received: from localhost ([::1]:44012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzJm-0006ZU-Ea for importer@patchew.org; Sun, 11 Nov 2018 18:39:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Jc-6i for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHc-0007HQ-Ig for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:44007) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHc-0007BG-6B for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:48 -0500 Received: by mail-wr1-x444.google.com with SMTP id y3-v6so7365726wrh.10 for ; Sun, 11 Nov 2018 15:36:39 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yfjlXowSZB39pHc0oGQom9Oq+G6mlaI/HOALXbwwfHQ=; b=RzaiSZB4beyvS+8xHjdhWGNU+eqGiPOrcU9wh1iJ3Xd0lV1H1YG6SOk5WMStHCMZ6M wsLyvI/ML+D1PVdAmGVTlwT2K2Cqa/fB2b0oVXdVF4ZJCH7Eym10hEAwg/CB7lHFHXm9 m+aFIej/M74ZX4NqcFc1421MQnTtnaH9ozegAvP1Y28q1bUY2kAjPjYrC0gmuGeG0ggF dLsJjuaI8TODK/2cc8hQYaicdW2M+WSK5GMor6gAFu8hhqLl61k/in9J56YS6pJQ5KsN NyfvkbHVpabty5KOYaw3A3maqBD4sUeaVd+UTsKrX1IEVBYB8sc0OiJlZRUbEMmNAZsQ Fj0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yfjlXowSZB39pHc0oGQom9Oq+G6mlaI/HOALXbwwfHQ=; b=C2S+Qdt1HjgYLWTVlb/P6hT6zww7MHQFJO0GFrVG+XbvpbcXLtADWbKmoUU4zzNRhP Ay3Ubvy31XrdPgIReNPXrai/cZ/LvP9nvVWlqcSQ/Juve02w/5WXdQS7sHhgesk6Gtb5 H6p+CO2Wuhfdl9oSHA3/abEsumR8Rm2qEA9QF0Y4027bYtrSJ4E7mBFyLecZ3A+wxSzv 2WfgLzzEJN9lescAYJN1L6wCSPpQI0X8jWiY3PDBE5lMLB2nlaZLgbSAk9Bvkm3bI/xE BYVCg5oVdimI6iMYY7CH9DLFAs6Ee8T4SmnyNyTRpHesI+qCqE7GYuQXJlixyFuqhBBt CGpw== X-Gm-Message-State: AGRZ1gJaelKHKNk167iuPLeVZUPpRmnLnIPnt61KkENw+Lgn0+gHl5eg r9Y1l2kF9s3YPJ9r5EDVZ0w= X-Google-Smtp-Source: AJdET5eF8n50Gv+w6i9kKzS2z1SxM19i4EjSQZIzh8uaHqSi9nFyLJ2bhnmE0gwqulJ19Z38zXzHsg== X-Received: by 2002:adf:a109:: with SMTP id o9-v6mr15148745wro.169.1541979398207; Sun, 11 Nov 2018 15:36:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:16 +0100 Message-Id: <20181111233622.8976-6-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [RFC PATCH 05/11] decodetree: Force Python to print unsigned values 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: Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Python internal representation is signed, so unsigned values bigger than 31-bit are interpreted as signed (and printed with a '-' signed). Mask out to force unsigned values. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Habkost Reviewed-by: Richard Henderson --- TODO: display error encountered: case 0x-1: .... --- scripts/decodetree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 5dea15e7a5..08aa52d544 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -900,12 +900,12 @@ class Tree: def str_case(b): return '0x{0:08x}'.format(b) =20 - output(ind, 'switch (', str_switch(self.thismask), ') {\n') + output(ind, 'switch (', str_switch(self.thismask & insnmask), ') {= \n') for b, s in sorted(self.subs): assert (self.thismask & ~s.fixedmask) =3D=3D 0 innermask =3D outermask | self.thismask innerbits =3D outerbits | b - output(ind, 'case ', str_case(b), ':\n') + output(ind, 'case ', str_case(b & insnmask), ':\n') output(ind, ' /* ', str_match_bits(innerbits, innermask), ' */\n') s.output_code(i + 4, extracted, innerbits, innermask) --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541979818504989.587370891005; Sun, 11 Nov 2018 15:43:38 -0800 (PST) Received: from localhost ([::1]:44038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzOD-0003ub-4g for importer@patchew.org; Sun, 11 Nov 2018 18:43:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Jf-7c for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHd-0007IM-6S for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:34976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHc-0007Cr-S5 for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:49 -0500 Received: by mail-wm1-x344.google.com with SMTP id t15-v6so6531830wmt.0 for ; Sun, 11 Nov 2018 15:36:40 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rqBWWKEyG1MFHcNgRgguBKBpSuKqdjMxvztphZfSzDI=; b=rna9APni+DGlqbcaLXCbvZp1HgxMA6541fBbxe9oxV8pP8dVeXAePn4GLBFEYlOepk Qa3faKqGJT/7SjiPkfLGt3RGrc3hWcL+OZRgZQGfNvikjuQv7sYDnyNAau4JEJQR+9Nw EwlERwagyWJUMA8h3W73X8Nx4SR2b5nqZSd4hrYNt+f6c11veX9ba6PASLAZogiYKmRm DDzH6ZoeIoUyui9nFgXZkSfBsVvgeHlRt/Khl11wc93tSJ9sOXdxH3ItzpDHWrxmEfb0 pFOcUdJb54FkfRIqUbilzmIyL96S/ZLdHQ3jwTJLt53Z90GFlu1slvRmIRKPaOBm4wnS 3YQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rqBWWKEyG1MFHcNgRgguBKBpSuKqdjMxvztphZfSzDI=; b=t3WE4DIwTrIjGaJDJy3TUFiYtVmJwOlSSVHlNyhWtHj4ziTbh4mFGKtTgGbbQ5o+i2 WTsXj7V6gZlnYmD3z98Rz+lDH5ok0aWpo6IhHkBeIYdvN/ewqn1YL3nbOWlbckfxGA8W 3Lzg8Qu7/XjHcIiz2+hy6HFTquIlBmmi7cae+VBX/jXIIvGHziACHhV7WUGa5HZzaeFz jSjEDv+uWowwqsJYBioVK7YU9UiS9FblPTj67IDozTCJOshlFAOCh+3gyz+bD20m3eX9 u+CbPxS4NzFjfkN1rJtxNlmjGTe1GJPEQc/m/DZyd4WIyXdTXX8hcgDfkdo9C35CxPe4 HiMQ== X-Gm-Message-State: AGRZ1gI5IBVHacdoQ8CoH71wYIztL3AVSagRkiQaBFC2es+8Ej4tV9bK eF9IOhRRjzTBzty3kZz3jak= X-Google-Smtp-Source: AJdET5fkJzDyD0OZQNeROJq3pDBEMIOtEkl/04Nspw+I4CoMVcF5JnIADGC4vYgetiDS68VWvSGfVQ== X-Received: by 2002:a1c:e004:: with SMTP id x4-v6mr5936623wmg.71.1541979399422; Sun, 11 Nov 2018 15:36:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:17 +0100 Message-Id: <20181111233622.8976-7-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [RFC PATCH 06/11] scripts/decodetree: Allow empty specifications 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: Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Starting with empty specifications allow to write stubs/templates, useful when testing/rebasing. This fixes: decode.inc.c: In function =E2=80=98decode=E2=80=99: decode.inc.c:9:7: error: unused variable =E2=80=98u=E2=80=99 [-Werror=3Du= nused-variable] } u; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- scripts/decodetree.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 08aa52d544..41ed67132d 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1060,12 +1060,13 @@ def main(): output(decode_scope, 'bool ', decode_function, '(DisasContext *ctx, ', insntype, ' insn)\n{\n') =20 - i4 =3D str_indent(4) - output(i4, 'union {\n') - for n in sorted(arguments.keys()): - f =3D arguments[n] - output(i4, i4, f.struct_name(), ' f_', f.name, ';\n') - output(i4, '} u;\n\n') + if arguments: + i4 =3D str_indent(4) + output(i4, 'union {\n') + for n in sorted(arguments.keys()): + f =3D arguments[n] + output(i4, i4, f.struct_name(), ' f_', f.name, ';\n') + output(i4, '} u;\n\n') =20 t.output_code(4, False, 0, 0) =20 --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541979707817152.2733953410733; Sun, 11 Nov 2018 15:41:47 -0800 (PST) Received: from localhost ([::1]:44031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzMQ-0000Oi-EI for importer@patchew.org; Sun, 11 Nov 2018 18:41:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Je-6w for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHb-0007Ga-Th for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42818) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHb-0007DH-KW for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:47 -0500 Received: by mail-wr1-x441.google.com with SMTP id u5-v6so2107232wrn.9 for ; Sun, 11 Nov 2018 15:36:41 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RlX5hO/FH1tcdLsBVUEkl47ashjikoePKQd72SYG2bU=; b=LEvGMHg145nA2jBcQWRSAOrNGkB7DccDxj9o5LZylrzbNxWQmda8ssj7qe3qoeHVFC yYpYQwfKuZotGXJU/Kwz8rmqvZ6g89K2QzAPryvPbjAIhdkcV3tCne6X3uaBVC4fdVgm x8eH4pcsTqoL9QlUVAfsZI6abUTVCqcMakhbmGw4EhmYXHidHWwCaP17g0FI/IDifjMK E28sSqLm8Fy2PdkFvG/lOy5y0IJmd3YgzkiEGXFPoGwM4ERJ5Q8CkB7jNoSczIdaJYtz +mqYLaAaAMpyxGKV8AKJL16m4a+obQBGYsHMu+0jo22m7n/R2NiXm1iH0b3FsLOoI0cj VeDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RlX5hO/FH1tcdLsBVUEkl47ashjikoePKQd72SYG2bU=; b=mb0KYWe1e1UPqggGDxUGLKBLOBvk38ASaolBT3fSU36101TtRnJ7yzSpxXCOpKSXnA I0zmSnEU+FXHgTzG46Y9kHjhs8siaGeVZcQ18gWVNNc6Kpmx18b3upNQiDGcM2TMwnah aCRBHNodK5dVI1f7cnTjKZ7+u+r45MfiOg05R0qWxIahNDRlI6POJDJATVSfhab9RCJe l4/ZxN3dbPIgGA6vntz+DDMe3W5wrVak5/H1r7X3hcHiRV4apart+LeUM6S4bHnk9SnV I+gSNZoVvuGS4jGxdSrwVHdCxxhG6e6V85QzEYxpwbwKRzYpbV/aaTUdvCdsBo8XXqDA vYXg== X-Gm-Message-State: AGRZ1gKegbaOKmhZppfdovSX8Bu019Sy66hcQJz8nHN07X+F6o+d07cC 5LWmcgn8/g1W7cFSla3T4gY= X-Google-Smtp-Source: AJdET5eRzZno5Vyv820RbEAuJf9uwzdcnZV5WCfuoQOdqZy4Qt26U9kzcRLf6os31Gwq1JClZOu7ng== X-Received: by 2002:a5d:684f:: with SMTP id o15-v6mr14370188wrw.186.1541979400741; Sun, 11 Nov 2018 15:36:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:18 +0100 Message-Id: <20181111233622.8976-8-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [RFC PATCH 07/11] scripts/decodetree: Add add_func_check() 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: Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The '>' token allow to call a check(arg) function. This is useful to assert an instruction is supported by an ISA. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- scripts/decodetree.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 41ed67132d..2450cc1a63 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -420,7 +420,7 @@ class Arguments: =20 class General: """Common code between instruction formats and instruction patterns""" - def __init__(self, name, lineno, base, fixb, fixm, udfm, fldm, flds): + def __init__(self, name, lineno, base, fixb, fixm, udfm, fldm, flds, c= hkfs): self.name =3D name self.file =3D input_file self.lineno =3D lineno @@ -430,6 +430,7 @@ class General: self.undefmask =3D udfm self.fieldmask =3D fldm self.fields =3D flds + self.check_funcs =3D chkfs =20 def __str__(self): r =3D self.name @@ -480,6 +481,8 @@ class Pattern(General): output(ind, self.base.extract_name(), '(&u.f_', arg, ', insn);= \n') for n, f in self.fields.items(): output(ind, 'u.f_', arg, '.', n, ' =3D ', f.str_extract(), ';\= n') + for f, a in self.check_funcs: + output(ind, 'check_', f, '(ctx, ', a, ');\n') output(ind, 'return ', translate_prefix, '_', self.name, '(ctx, &u.f_', arg, ');\n') # end Pattern @@ -583,6 +586,11 @@ def add_field_byname(lineno, flds, new_name, old_name): return add_field(lineno, flds, new_name, lookup_field(lineno, old_name= )) =20 =20 +def add_func_check(lineno, chkfns, check_funcname, check_arg): + chkfns +=3D [(check_funcname, check_arg)] + return chkfns + + def infer_argument_set(flds): global arguments global decode_function @@ -624,7 +632,7 @@ def infer_format(arg, fieldmask, flds): if not arg: arg =3D infer_argument_set(flds) =20 - fmt =3D Format(name, 0, arg, 0, 0, 0, fieldmask, var_flds) + fmt =3D Format(name, 0, arg, 0, 0, 0, fieldmask, var_flds, []) formats[name] =3D fmt =20 return (fmt, const_flds) @@ -646,6 +654,7 @@ def parse_generic(lineno, is_format, name, toks): undefmask =3D 0 width =3D 0 flds =3D {} + chkfns =3D [] arg =3D None fmt =3D None for t in toks: @@ -690,6 +699,13 @@ def parse_generic(lineno, is_format, name, toks): flds =3D add_field(lineno, flds, fname, ConstField(value)) continue =20 + # '>FUNC=3DARG' calls check_FUNC(ctx, ARG). + if t[0] =3D=3D '>': + (fname, farg) =3D t[1:].split('=3D') + tt =3D t[2 + len(fname) + len(farg):] + chkfns =3D add_func_check(lineno, chkfns, fname, farg) + continue + # Pattern of 0s, 1s, dots and dashes indicate required zeros, # required ones, or dont-cares. if re_fullmatch('[01.-]+', t): @@ -752,7 +768,7 @@ def parse_generic(lineno, is_format, name, toks): if name in formats: error(lineno, 'duplicate format name', name) fmt =3D Format(name, lineno, arg, fixedbits, fixedmask, - undefmask, fieldmask, flds) + undefmask, fieldmask, flds, chkfns) formats[name] =3D fmt else: # Patterns can reference a format ... @@ -779,7 +795,7 @@ def parse_generic(lineno, is_format, name, toks): if f not in flds.keys() and f not in fmt.fields.keys(): error(lineno, 'field {0} not initialized'.format(f)) pat =3D Pattern(name, lineno, fmt, fixedbits, fixedmask, - undefmask, fieldmask, flds) + undefmask, fieldmask, flds, chkfns) patterns.append(pat) =20 # Validate the masks that we have assembled. --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541980053800993.5857343145789; Sun, 11 Nov 2018 15:47:33 -0800 (PST) Received: from localhost ([::1]:44065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzRx-0006Lk-Fg for importer@patchew.org; Sun, 11 Nov 2018 18:47:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Ji-82 for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHc-0007IC-T1 for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:39363) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHc-0007Dq-JY for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:48 -0500 Received: by mail-wm1-x344.google.com with SMTP id u13-v6so6507408wmc.4 for ; Sun, 11 Nov 2018 15:36:42 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KCmO+yxGl3mKj3Z3V9WXdMHQrNtnFDtAOJcSdOwO6TU=; b=CykH1ERTldwxBLHjG1ox3cGipLDUxoDon3g1RnCVyi6VTi8x+WdvUYTzX7GErZ2hgR Nv5Vw8qZp+F37CbxXSQGT4TvfRKQ5hgjZ1E9HeDyPphucGWgyB9c/65zPRUCdUOU85m9 /maWJ+YQa3Ow3VMHX9nCsxBfheXz13U0f+uGuR9e6jp7waBTmjVq7eC0CavMvPjzXA8r bD6LNpBTKQ4I81npE8uXaQUNe7MM5kLMym1RdWY1yBb1jLe3w/lfHDOMY+dECzT4sBqD fttSNCDxhRrxkBy+vUXyhlIN64syJeMYgny3mhi8mhxVHxyefbFkkhVTDTrZ4Z3DF3ZH vWyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KCmO+yxGl3mKj3Z3V9WXdMHQrNtnFDtAOJcSdOwO6TU=; b=Po440n1a4Ckp1IZLJumml/EaOU2a7MxuptBAxdpgheTc+Dhg+Sk/+er8fdeeT4VYHd 8FwSKZcp+E52pHJnraYiBZrTysrPe1YN8QUgg+j97eeDTdGK+up/JJl17m0d6ExCehym HohAKTEErcKiOv/ACtYSCkH0zNdrHhSx+ZGHLgi4Yd+kJgmsWWb7KmKiewjgo5cDW+2p xbY33Tot8MlcAm1ffoA7FLF5Qc4nNHzK4OTsbWp5s2VCgPzBJKC/RO7ekin6F7zxYNku ff+pQ5fLJJQbkAbGxcj7A2qFdnU5mfpGXGzTo1XcDm2Yk/NRD0leYfxkTtVn3vp4ycZr DvTg== X-Gm-Message-State: AGRZ1gLVL5X9LKvWNyAJFwNyiNVu45QWvk6dPt2YAae4etbER37VzxFw Gx4O5IBbCGrsVdxM+1ThAe0= X-Google-Smtp-Source: AJdET5eUw0WTMEPh3BXoo6YNLslPnifmx7RTuPaFu3ONgr/5lHcT3IiNAoI5hF96C5XKDKmzNCPOFw== X-Received: by 2002:a1c:6783:: with SMTP id b125-v6mr5737941wmc.147.1541979402045; Sun, 11 Nov 2018 15:36:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:19 +0100 Message-Id: <20181111233622.8976-9-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [RFC PATCH 08/11] target/mips: Add a decodetree stub 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: Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/Makefile.objs | 8 ++++++++ target/mips/insns.decode | 2 ++ target/mips/translate.c | 7 +++++++ target/mips/translate.inc.c | 13 +++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 target/mips/insns.decode create mode 100644 target/mips/translate.inc.c diff --git a/target/mips/Makefile.objs b/target/mips/Makefile.objs index 651f36f517..3510835d57 100644 --- a/target/mips/Makefile.objs +++ b/target/mips/Makefile.objs @@ -2,3 +2,11 @@ obj-y +=3D translate.o dsp_helper.o op_helper.o lmi_helper= .o helper.o cpu.o obj-y +=3D gdbstub.o msa_helper.o mips-semi.o obj-$(CONFIG_SOFTMMU) +=3D machine.o cp0_timer.o obj-$(CONFIG_KVM) +=3D kvm.o + +DECODETREE =3D $(SRC_PATH)/scripts/decodetree.py + +target/mips/decode.inc.c: $(SRC_PATH)/target/mips/insns.decode $(DECODETRE= E) + $(call quiet-command,\ + $(PYTHON) $(DECODETREE) -o $@ $<, "GEN", $(TARGET_DIR)$@) + +target/mips/translate.o: target/mips/decode.inc.c diff --git a/target/mips/insns.decode b/target/mips/insns.decode new file mode 100644 index 0000000000..7fbf21cbb9 --- /dev/null +++ b/target/mips/insns.decode @@ -0,0 +1,2 @@ +# MIPS32/MIPS64 Instruction Set +# diff --git a/target/mips/translate.c b/target/mips/translate.c index e726f3ec00..560325c563 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -27848,6 +27848,8 @@ static void gen_msa(CPUMIPSState *env, DisasContext= *ctx) =20 } =20 +#include "translate.inc.c" + static void decode_opc(CPUMIPSState *env, DisasContext *ctx) { int32_t offset; @@ -27872,6 +27874,11 @@ static void decode_opc(CPUMIPSState *env, DisasCon= text *ctx) gen_set_label(l1); } =20 + /* Transition to the auto-generated decoder. */ + if (decode(ctx, ctx->opcode)) { + return; + } + op =3D MASK_OP_MAJOR(ctx->opcode); rs =3D (ctx->opcode >> 21) & 0x1f; rt =3D (ctx->opcode >> 16) & 0x1f; diff --git a/target/mips/translate.inc.c b/target/mips/translate.inc.c new file mode 100644 index 0000000000..69fe78ac89 --- /dev/null +++ b/target/mips/translate.inc.c @@ -0,0 +1,13 @@ +/* + * MIPS emulation for QEMU - MIPS32 translation routines + * + * Copyright (c) 2004-2005 Jocelyn Mayer + * Copyright (c) 2006 Marius Groeger (FPU operations) + * Copyright (c) 2006 Thiemo Seufer (MIPS32R2 support) + * Copyright (c) 2018 Philippe Mathieu-Daud=C3=A9 + * + * This code is licensed under the GNU GPLv2 and later. + */ + +/* Include the auto-generated decoder. */ +#include "decode.inc.c" --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 154197970153210.686187269291509; Sun, 11 Nov 2018 15:41:41 -0800 (PST) Received: from localhost ([::1]:44030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzMJ-0000LA-TX for importer@patchew.org; Sun, 11 Nov 2018 18:41:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Jh-7r for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHc-0007Ho-MQ for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:38601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHc-0007EL-9Q for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:48 -0500 Received: by mail-wr1-x443.google.com with SMTP id e3-v6so7396487wrs.5 for ; Sun, 11 Nov 2018 15:36:44 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z69mC74SdfiTUtLzvj5H87XziaPOU/9v3uHLTgMUn34=; b=Bak6Qe+YIS/W/lnykELGK7ll5nKRvUwtHhtOIVg2wWPVHwPKA+cu/cCbSztHA5P3Y9 BaI2xD6Cml0tyWzvvrXwUEc0px3iSTKFQtuQ6ELemW1+EwakJaqy2zII4dUhlvEia8ll xwKswqD/lWYZVNaXgpIL0MBAxRwvLxkJapzOezYPsWh8pWHOWCKSyjcA2aILcppKBxJO TWNo+q7XphRZs/EV/rdYfyVVusIA89bJlJ2pA0eM9/755nGF+4rBcqTTw9gHAFwLm+5d cp0HO6iUh44kQeFDrwoesu2Dr15nHQCsgIzwfNlfeqeVlZ0jhHEZ1bxF6gTY9s1ipMnD KhhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Z69mC74SdfiTUtLzvj5H87XziaPOU/9v3uHLTgMUn34=; b=rmHzwm3Pz9VfVewVXKzMB4rAsiCC/AqQUYBO2J+KjA/EJ4vUtJDEh4aJSQAIJKTV0q g7+zGnEt7HLNFzBzNRbKqvwVS9wGB1sQjWOsYiBcShHh2D5GLB3B2GvhhxXG1ZKAGTqp S2MtU7Kz96BvZdbDqIA75SFrQ5+Il3H4h5HReunUZdDnuUgj9i3GWEXIlXT6FuzzkP4g /tZDRSkYqrRsayY47C/nCqZSSG4QIOTKOUXFWkYjVv0SnBqaSYVzTKO5km10HUN1Zli5 T4De+gkLhBJkOzwaOAW4t8fsR6UKnN4s5Yllbvdj/7ervZo7oqpx5SKMsPcVuNURGqo4 r0RQ== X-Gm-Message-State: AGRZ1gIoBNBUnj6DvevFxKcP4llUtH6mtHqD0FHnnumTOMS+t/ZNYaVr IzVc0Be18yEvbxYGQVvZ2Ms= X-Google-Smtp-Source: AJdET5cLwekmFTFoRTFrby+7wwrokfIPNRScgoKqCqX8TprMWqj46CLlhB0/vSFjJPDW/UdgSFEKCw== X-Received: by 2002:a5d:4450:: with SMTP id x16-v6mr15277807wrr.308.1541979403275; Sun, 11 Nov 2018 15:36:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:20 +0100 Message-Id: <20181111233622.8976-10-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [RFC PATCH 09/11] target/mips: Port SYNCI to decodetree 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: Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/insns.decode | 8 ++++++++ target/mips/translate.c | 6 ------ target/mips/translate.inc.c | 7 +++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/target/mips/insns.decode b/target/mips/insns.decode index 7fbf21cbb9..8a1a7acf3a 100644 --- a/target/mips/insns.decode +++ b/target/mips/insns.decode @@ -1,2 +1,10 @@ # MIPS32/MIPS64 Instruction Set # +# From: +# - MIPS32 Architecture For Programmers Volume II-A (Document Number: MD00= 086) + +#### +# System Instructions +#### + +synci 000001 ----- 11111 ---------------- >insn=3DISA_M= IPS32R2 diff --git a/target/mips/translate.c b/target/mips/translate.c index 560325c563..760cca8262 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -27948,12 +27948,6 @@ static void decode_opc(CPUMIPSState *env, DisasCon= text *ctx) check_insn(ctx, ISA_MIPS32R6); generate_exception_end(ctx, EXCP_RI); break; - case OPC_SYNCI: - check_insn(ctx, ISA_MIPS32R2); - /* Break the TB to be able to sync copied instructions - immediately */ - ctx->base.is_jmp =3D DISAS_STOP; - break; case OPC_BPOSGE32: /* MIPS DSP branch */ #if defined(TARGET_MIPS64) case OPC_BPOSGE64: diff --git a/target/mips/translate.inc.c b/target/mips/translate.inc.c index 69fe78ac89..f3dcd32f98 100644 --- a/target/mips/translate.inc.c +++ b/target/mips/translate.inc.c @@ -11,3 +11,10 @@ =20 /* Include the auto-generated decoder. */ #include "decode.inc.c" + +static bool trans_synci(DisasContext *dc, arg_synci *a) +{ + /* Break the TB to be able to sync copied instructions immediately */ + dc->base.is_jmp =3D DISAS_STOP; + return true; +} --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541979553008114.9564987652476; Sun, 11 Nov 2018 15:39:13 -0800 (PST) Received: from localhost ([::1]:44014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzJq-0006dp-7K for importer@patchew.org; Sun, 11 Nov 2018 18:39:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003JZ-6M for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHb-0007Gi-Ui for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:42819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHb-0007Ev-Lp for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:47 -0500 Received: by mail-wr1-x442.google.com with SMTP id u5-v6so2107301wrn.9 for ; Sun, 11 Nov 2018 15:36:45 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=69cetdNxjZtWZtF+yb7X2f7PR8UQrFehCxVc0M4hhio=; b=ngE5NC9he9X3YJ3MLDwTVuUDxDyRterVjVrAdaI7mSYgpFtBaZ+lbHkWLMkS/LOaiX 5FuvxE9wWFI143GyiYXW+Zihyp0lLac22OhNEa/rueePgrVGlbfUYYknsQk6SpWxE8jc 0fWy1sv6CulCNoQ+EJ+rlI3OBnaolt3Py9C/9UmNYTXoEvTAr3NFKAYGHIZLbhigvelN sWsCiy7WRR4/HN2y/5VtpeOW9ZJ+3dNdqgWqlbHFXS3tMeiy18BUZX5jjPXdcDwrMTy2 c2mGNOmbG0O9fnZTD9V3pIv2CHavG6IGX8OT9zBV6CvkirHOwkhy+VuSaq/AMi7i7/Yo R8Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=69cetdNxjZtWZtF+yb7X2f7PR8UQrFehCxVc0M4hhio=; b=mHCCjL+d2a+GZeKRuXdcwU179hWD8vTnikG9KUy6qs+qpz6gvk6aVQkjKgGXMlCvvI wg/dtzGwsDio9QRGg2mfPReW44d6lnb7k/494KEjUh76BMXxu8u4ytDip65dLaF1hdI8 vTSQMdPBPkwiE//TFcvAyeqNA3T7rbW1EIeB4ad8QvDNlkhBvO7MNqL8rQemS4y8ajUd oHPqNyEK5ZbvnyvIuNlM9ZiBi8R7nY7a7kE2iCR3o7+4L1OYGh/lW6PBe5reVkAJhuRF aJVd5/0SFpeEx+oFBMrCcJkukv7GIZoJCdwNb2ft2JADBB8zyKYEqLPzROMp0Bp6hdkV bG1g== X-Gm-Message-State: AGRZ1gLGfZIIv9VtoM8187eEG7JY4020buVsGeC1JR2ht8jJ1npCPzWY OqhTMW6J3Jj98AlZ6t8Na8o= X-Google-Smtp-Source: AJdET5diB4ZYS6deB27CC7kTQosLfJUziN9kXagbx5TmQkWo28mVwXlLMFUoHYRI4XhyJlzl901krw== X-Received: by 2002:adf:e406:: with SMTP id g6-v6mr15518316wrm.277.1541979404450; Sun, 11 Nov 2018 15:36:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:21 +0100 Message-Id: <20181111233622.8976-11-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [RFC PATCH 10/11] scripts/decodetree: Add add_cond_check() 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: Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The '?' token allow to check for a condition. This is useful to take the translate the instruction only if the condition is valid. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- scripts/decodetree.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 2450cc1a63..ba53ee589e 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -420,7 +420,7 @@ class Arguments: =20 class General: """Common code between instruction formats and instruction patterns""" - def __init__(self, name, lineno, base, fixb, fixm, udfm, fldm, flds, c= hkfs): + def __init__(self, name, lineno, base, fixb, fixm, udfm, fldm, flds, c= hkfs, chkif): self.name =3D name self.file =3D input_file self.lineno =3D lineno @@ -431,6 +431,7 @@ class General: self.fieldmask =3D fldm self.fields =3D flds self.check_funcs =3D chkfs + self.check_cond =3D chkif =20 def __str__(self): r =3D self.name @@ -483,6 +484,9 @@ class Pattern(General): output(ind, 'u.f_', arg, '.', n, ' =3D ', f.str_extract(), ';\= n') for f, a in self.check_funcs: output(ind, 'check_', f, '(ctx, ', a, ');\n') + if self.check_cond: + output(ind, 'if (!(', self.check_cond, '))\n') + output(ind, ' return false;\n') output(ind, 'return ', translate_prefix, '_', self.name, '(ctx, &u.f_', arg, ');\n') # end Pattern @@ -591,6 +595,10 @@ def add_func_check(lineno, chkfns, check_funcname, che= ck_arg): return chkfns =20 =20 +def add_cond_check(lineno, chkifs, condition): + return condition + + def infer_argument_set(flds): global arguments global decode_function @@ -632,7 +640,7 @@ def infer_format(arg, fieldmask, flds): if not arg: arg =3D infer_argument_set(flds) =20 - fmt =3D Format(name, 0, arg, 0, 0, 0, fieldmask, var_flds, []) + fmt =3D Format(name, 0, arg, 0, 0, 0, fieldmask, var_flds, [], None) formats[name] =3D fmt =20 return (fmt, const_flds) @@ -655,6 +663,7 @@ def parse_generic(lineno, is_format, name, toks): width =3D 0 flds =3D {} chkfns =3D [] + chkifs =3D None arg =3D None fmt =3D None for t in toks: @@ -706,6 +715,13 @@ def parse_generic(lineno, is_format, name, toks): chkfns =3D add_func_check(lineno, chkfns, fname, farg) continue =20 + # '?condition' calls if(condition). + if t[0] =3D=3D '?': + cond =3D t[1:] + tt =3D t[1 + len(cond):] + chkifs =3D add_cond_check(lineno, chkifs, cond) + continue + # Pattern of 0s, 1s, dots and dashes indicate required zeros, # required ones, or dont-cares. if re_fullmatch('[01.-]+', t): @@ -768,7 +784,7 @@ def parse_generic(lineno, is_format, name, toks): if name in formats: error(lineno, 'duplicate format name', name) fmt =3D Format(name, lineno, arg, fixedbits, fixedmask, - undefmask, fieldmask, flds, chkfns) + undefmask, fieldmask, flds, chkfns, chkifs) formats[name] =3D fmt else: # Patterns can reference a format ... @@ -795,7 +811,7 @@ def parse_generic(lineno, is_format, name, toks): if f not in flds.keys() and f not in fmt.fields.keys(): error(lineno, 'field {0} not initialized'.format(f)) pat =3D Pattern(name, lineno, fmt, fixedbits, fixedmask, - undefmask, fieldmask, flds, chkfns) + undefmask, fieldmask, flds, chkfns, chkifs) patterns.append(pat) =20 # Validate the masks that we have assembled. --=20 2.17.2 From nobody Mon Apr 29 07:44:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541979553011218.41068108878312; Sun, 11 Nov 2018 15:39:13 -0800 (PST) Received: from localhost ([::1]:44013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzJn-0006bA-Jl for importer@patchew.org; Sun, 11 Nov 2018 18:39:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLzHf-0003Jg-7j for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLzHc-0007Hg-Ld for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:51 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:35491) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLzHc-0007Fh-9p for qemu-devel@nongnu.org; Sun, 11 Nov 2018 18:36:48 -0500 Received: by mail-wr1-x442.google.com with SMTP id z16-v6so7399044wrv.2 for ; Sun, 11 Nov 2018 15:36:46 -0800 (PST) Received: from x1.local (2.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.2]) by smtp.gmail.com with ESMTPSA id g8-v6sm15828011wri.58.2018.11.11.15.36.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 15:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E+jgjenhpLfcRlhd3r4Vwr0fPPMlUV1IfwvKdIC7Pf8=; b=UkfHxV9sjVdXT1BFgTOlayfXDqR9a8sGSJNHYahzHkfzEqV82OKvhgFNvuvBkwyOD8 q3E9RLuHdiB+2brHnmRAtmgAHQiCvl8cpDLVyRiS1XiJbmubIw2Pq7O6r9jBYCvYm0Q4 XiQdoOb4C7zf5p30K8XWmO4/IL49MJ4r0ioVgqS1KvQjooiiEhsg7Xn+tsJNxkqBZdCJ zWWIS9qNysXRdwOEAF2W0Cs0SUIf89IdmGuX223kR1dANE3jDf96yh9GYrU9KiUyFAfm M1bjVxDcqZZKguJSTOGKRO2YIcFhDaNVxF2kbeMeyEaJeMHJ3zfzIkk4DrbaWyd0lJ3/ XbJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=E+jgjenhpLfcRlhd3r4Vwr0fPPMlUV1IfwvKdIC7Pf8=; b=Ct3GvvowiBb41vgl5kSOU7s6mk92NRrn7cDfHFP1uPLohjVFTfXCGn2iz/lUzsPViF 2YUe7vwhxXvZsZ08966158FXW/CEFTVBOT6l6MwSgGT1IEh/t02z8rNKkNzz+gDV3WKt 86kVi1nrpoThNpHWQGzLTQN9bQMVIPf9JByjkoJ6W0rAy02nBDbh2Q596QzrIrgQB5aq waBX03NyqI2qaBPEI+oqoHCQ9KfJq3tdECDh9cpWiKJNpKnTXX1us4s3DqLOrU0B20dT QkWvZH114lw2iqVEcb8o4dW9ptf38nkNKP3WYCrLc/K4mPqLqaVcPjjiyLfjmgSY1l0v Is9g== X-Gm-Message-State: AGRZ1gJxpJLC2n5Kmw5x2n1mAwhQfdCBwS3+spmDXf/2f5JgllAtWEbz 5CnEonWh5iaLK60PDsBgCCI= X-Google-Smtp-Source: AJdET5cfJGEkSkJSttfgABbZv4eH7hzHy87pR1dFDJYsf8zff/amcgtNIe9Rl0iMR6iNucNIXdIUqQ== X-Received: by 2002:adf:f9d2:: with SMTP id w18-v6mr15571102wrr.134.1541979405711; Sun, 11 Nov 2018 15:36:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bastian Koppelmann , Peer Adelt , Richard Henderson Date: Mon, 12 Nov 2018 00:36:22 +0100 Message-Id: <20181111233622.8976-12-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org> References: <20181111233622.8976-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [RFC PATCH 11/11] target/mips: Port MIPS64 DCL[Z/O] to decodetree 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: Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/insns.decode | 12 ++++++++++++ target/mips/translate.inc.c | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/target/mips/insns.decode b/target/mips/insns.decode index 8a1a7acf3a..e256220211 100644 --- a/target/mips/insns.decode +++ b/target/mips/insns.decode @@ -2,9 +2,21 @@ # # From: # - MIPS32 Architecture For Programmers Volume II-A (Document Number: MD00= 086) +# - MIPS64 Architecture For Programmers Volume II-A (Document Number: MD00= 087) + +&rs_rt_rd rs rt rd + +@rs_rt_rd ...... rs:5 rt:5 rd:5 00000 ...... &rs_rt_rd =20 #### # System Instructions #### =20 synci 000001 ----- 11111 ---------------- >insn=3DISA_M= IPS32R2 + +#### +# Special2 Instructions +#### + +dclz 011100 ..... ..... ..... ..... 100100 @rs_rt_rd ?ctx->= insn_flags&ISA_MIPS64 +dclo 011100 ..... ..... ..... ..... 100101 @rs_rt_rd ?ctx->= insn_flags&ISA_MIPS64 diff --git a/target/mips/translate.inc.c b/target/mips/translate.inc.c index f3dcd32f98..90fe868605 100644 --- a/target/mips/translate.inc.c +++ b/target/mips/translate.inc.c @@ -18,3 +18,15 @@ static bool trans_synci(DisasContext *dc, arg_synci *a) dc->base.is_jmp =3D DISAS_STOP; return true; } + +static bool trans_dclz(DisasContext *ctx, arg_rs_rt_rd *a) +{ + gen_cl(ctx, OPC_DCLZ, a->rd, a->rs); + return true; +} + +static bool trans_dclo(DisasContext *ctx, arg_rs_rt_rd *a) +{ + gen_cl(ctx, OPC_DCLO, a->rd, a->rs); + return true; +} --=20 2.17.2