From patchwork Tue Nov 30 10:37:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519731 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp7288511imj; Tue, 30 Nov 2021 02:39:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvCI79h/ZKPxC0pbTYJH6VCte/s0vj9m0nVfqsm+DIVXaATJqwzpWi+WsSj6Zq6ntR3a1N X-Received: by 2002:a25:6c89:: with SMTP id h131mr39843882ybc.222.1638268779701; Tue, 30 Nov 2021 02:39:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638268779; cv=none; d=google.com; s=arc-20160816; b=qZaAAaElCEu005Ee5b1F7r3LG81jqRGK1U6pYU7ko70UlB1TCI+gOdj20HLJVhny5q C1oGiZxkkSAZFhU8boHs51cQ55C9JwIlvnKd8EE2/ucc9CJBLaQutvntu6dW1cFQJiQo IFChqE5ahqamoLvl3rJfKlkzZ32OWDG62BrwrSpIvKG9IlPHFy3W3eb77Qo1DW0/Yxc8 eja3bG41uDlY3kMx7ahpFDchia62Ko3zAY1+UFlb21HFtM89km8IS1liyH0FjJvo3txP CLQizWhb1LCbu2GZNJsK1GLHq9txDZsNxMVEro6jWJCXvaEsIAF9cEqA+Lr6RTV/XYQ3 Pd1g== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=T7M2wmWcneioAfDJGxuBBR28RTxKODOxRCKMrpc/wvg=; b=ItJO+ke7YbVs8o6J3Gd7W2Dg3f5v4JIP6kFUnBSUyjq3YWBuSQKJkjO+iNWKeZSolI Vu0KkfmgVSw6yWTmDUDhyZSuI+X8X2RGSE7B1m03pNG7Zx+GDB3F3UcsnuQ/U2Upqz34 cBzfVnEy9z2MIPchpXBzlNlrFjhekY1PwzZMXCgPAuiFtH5YhIwmd8auReo/cdPCo8Hc mtopEJNr2dKce5+Ocf1MzpzZfgBhjhiE4hH4+QryoboJnXWMC0cWvnEc1bau+hYFtiDU CdACVW9kvXrqv9ufQUtfZXpgTCYWwaJ5/iE7EECIE6I1Fab5UoCXNwTTP276nPI+TODc /MwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rfqNfmU4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w3si7336366ybt.533.2021.11.30.02.39.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Nov 2021 02:39:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rfqNfmU4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms0Xz-0006lY-3z for patch@linaro.org; Tue, 30 Nov 2021 05:39:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms0WM-0006lI-7V for qemu-devel@nongnu.org; Tue, 30 Nov 2021 05:37:58 -0500 Received: from [2a00:1450:4864:20::332] (port=42802 helo=mail-wm1-x332.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ms0WK-0000P2-SJ for qemu-devel@nongnu.org; Tue, 30 Nov 2021 05:37:57 -0500 Received: by mail-wm1-x332.google.com with SMTP id d72-20020a1c1d4b000000b00331140f3dc8so14422879wmd.1 for ; Tue, 30 Nov 2021 02:37:56 -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 :mime-version:content-transfer-encoding; bh=T7M2wmWcneioAfDJGxuBBR28RTxKODOxRCKMrpc/wvg=; b=rfqNfmU4gU3znD8zLdlLJVP1KXB66OJMSzHZ2b67xyUA5sgxkwDmaxBu7WVMPeQA8/ xkDnTC1T/PFGsnSe4vNXwa6JRt0+Vn+seJ00yIQhOgJVVM5NbaScIfkwngcig38IniSj taoxPTmHcNOV1GWZFGbRZXT+MW5SiMTnswly2wFndTWixNzHAa+XkYFvHiNsEJBn+G17 H4al4BM0eUlF61eshz4xJL0eAC2UTG50+njw2QIQ4FqIpA4s6MUia7iuPk7iDqOm+kz8 A9yg44obyQIfZufBTxGYNUTVICvHsaQl1HclDpzmgVJLO5vTTdDEdYRBh5UqTmPJZwjO 5TZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T7M2wmWcneioAfDJGxuBBR28RTxKODOxRCKMrpc/wvg=; b=OY6afA9470BToIR2Nq6r3ojndyJLw/PSEBWTaXfk53Ule5dWF+IUzx5y66dPcfkaUA WGNJODldsayA6l2T1rb5dCkfT3nVZaQ8TbWUd9QSo06KTGPKhgYA2z+UISvhiq2RSjO8 0Twhb4vuEnc6QefTO3ma7zpK6QZhmmQB2a4Pj8em0/iCKhqieEZ3RhO2t2/5moVW54WT gwqcnzKhnqmtAA8nRtTmQ+qyipGYrQKWaZT707o8uFmpW4Ht4mNUhSqJHgE21nSkh87f isrf8uGkHT7ey2QdEEZYcejnqTskNMR+8RB+OgS8O7WdRfY7jFNDnpfpolT9D26+LfGH aFcw== X-Gm-Message-State: AOAM533wQ/v1q0RdVqJ2ixsQZMW+JvxeE7yiZrJc4ju3jl1j3xr+TTrB b/xcMhOOjB5mdLsTOxzMn5UgFTz1Sn55C4zizRY= X-Received: by 2002:a05:600c:210a:: with SMTP id u10mr3925001wml.33.1638268675508; Tue, 30 Nov 2021 02:37:55 -0800 (PST) Received: from cloudburst.home (149.164.14.37.dynamic.jazztel.es. [37.14.164.149]) by smtp.gmail.com with ESMTPSA id m21sm16311280wrb.2.2021.11.30.02.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 02:37:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/3] target/m68k: Implement TRAPV Date: Tue, 30 Nov 2021 11:37:50 +0100 Message-Id: <20211130103752.72099-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211130103752.72099-1-richard.henderson@linaro.org> References: <20211130103752.72099-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::332 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- target/m68k/translate.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index af43c8eab8..858ba761fc 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4863,6 +4863,22 @@ DISAS_INSN(trap) gen_exception(s, s->base.pc_next, EXCP_TRAP0 + (insn & 0xf)); } +static void do_trapcc(DisasContext *s, int cond) +{ + TCGLabel *over = gen_new_label(); + + /* Jump over if !cond. */ + gen_jmpcc(s, cond ^ 1, over); + + gen_exception(s, s->base.pc_next, EXCP_TRAPCC); + gen_set_label(over); +} + +DISAS_INSN(trapv) +{ + do_trapcc(s, 9); /* VS */ +} + static void gen_load_fcr(DisasContext *s, TCGv res, int reg) { switch (reg) { @@ -6026,6 +6042,7 @@ void register_m68k_insns (CPUM68KState *env) BASE(nop, 4e71, ffff); INSN(rtd, 4e74, ffff, RTD); BASE(rts, 4e75, ffff); + INSN(trapv, 4e76, ffff, M68000); INSN(rtr, 4e77, ffff, M68000); BASE(jump, 4e80, ffc0); BASE(jump, 4ec0, ffc0); From patchwork Tue Nov 30 10:37:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519733 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp7290841imj; Tue, 30 Nov 2021 02:42:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/Kih7vwhkQMi0IdxnXdv4uQx2vue76f21LtAeeZofV1GJ5lu+kOZ47uTtjageDlacK8ZQ X-Received: by 2002:a25:69c3:: with SMTP id e186mr38985699ybc.249.1638268957217; Tue, 30 Nov 2021 02:42:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638268957; cv=none; d=google.com; s=arc-20160816; b=JYG773oYa816a5I77Hr/cmgR59HBfN9OM5ZX+t0hDBej+VEbzdqUa6ItGhJQwVYEHK DIlg7c/E3veIZWdRFBhmV59Z0bAUYLSVpzjnwpahBDPqkixKbXT95u+Y8uFMG1RpPJ2C bpykM9B1eDW1CzzsfYSYH+mRCwQH7CCjjgfc7hbsZgE35CCXnyhqDMEE8ufNh+uJu0Vr V7zOcWnKKivyMNTc4kSLN33vR9MswrKl6P0a7QX4fg8AjYPnuklGqGb24kyvbaj2R0s4 YRznllljgu02f7nxJy/F04wrcsXIUBpzKzQ+H/hmBGDO2wGGhqsi4s5yOIJu2YWiNXK9 A+YQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dP+9d3o+4iGiJYfpiZHLiWZnrSima8SPJ1WsmYW0nMk=; b=ILun4qMY3GM0VRqj37PCiS5W9ilXKEX+G8sOyZm4Zlvc1ZIR6AZIj5Pe2CuN71MM5n hH3NUzryHntZeFWKWyoBNlQ+F7IsmVJdEzpyNZMwm6HDB54Zu4G9FNtW1gnKAq/Zt8Cs ZLWLMoj76G+egVw3VR/i3kK0LJ4lE1lpct6f5QckpdpEXy4p86XH5+x6qqxJA6E9YrA7 Zfk6sgeS7lM9t7DI9yTchItn27jPto9UC7dMpfkuuPhdMK6zLZOMbcZMxzbpWuWFZo9a PnULrNTEh99jXsFbbT3hkakrdBSPt4TKWZPwO+gd5aiJv08uUbzIan3jkEFpIoj1mwwd 4W1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zeiBICkH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d129si4874228ybb.606.2021.11.30.02.42.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Nov 2021 02:42:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zeiBICkH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms0aq-00044X-NA for patch@linaro.org; Tue, 30 Nov 2021 05:42:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms0WN-0006mN-Ur for qemu-devel@nongnu.org; Tue, 30 Nov 2021 05:37:59 -0500 Received: from [2a00:1450:4864:20::331] (port=43673 helo=mail-wm1-x331.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ms0WL-0000P8-M6 for qemu-devel@nongnu.org; Tue, 30 Nov 2021 05:37:59 -0500 Received: by mail-wm1-x331.google.com with SMTP id o19-20020a1c7513000000b0033a93202467so14442934wmc.2 for ; Tue, 30 Nov 2021 02:37:57 -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 :mime-version:content-transfer-encoding; bh=dP+9d3o+4iGiJYfpiZHLiWZnrSima8SPJ1WsmYW0nMk=; b=zeiBICkHMjLbjBhxK5vU9sulFdhiKJD7uuWpUXC4QRDEzjm8Fc6AZ28OpdXZxxo1k3 +Xewkp9Nu3xewMxxpJrNS6ID6KHKHluPrUC9mH1B6fx08Oic/lz7RiQyCcG6s/XhSEJW tVc7Amrq4jWoCG0ivx9jz8vyCVsLGL2OZQ1Y6LJ3hG6bF5j/KlayEG5rATTTm+JcQjmo 5uKbRPGBkI2fLRLN7oSLNm3Fh2CYgycBPBoVZoeeGWc2ZCrdZgonYedSVcDzwYSg86m7 yEpSwpV8P+6yeCZIwOc4juV4mlsBrLqFGdu+bTqEMTYwyH0hmxBey7q/gQe1o6JDzVXz 5lPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dP+9d3o+4iGiJYfpiZHLiWZnrSima8SPJ1WsmYW0nMk=; b=4YJyVnKDJ5a6QNM0nooSKnTe5EyMwTlSkm2lpUfnJsD7bR6lCs8JGl2bq3VaUVMB1k usPpiyy0ElfgGd+1YeCH01rUOg+6f8/YXhHSUJBeAVNPFRyPyiXVl0UZUnSJGK3zHe/S JkJo38rhIqW+DegGQk3HcCBZ6JBaBSj1dWlyF0ArmSYAtbfSRtHOZbxwxeC1Kqm+bwz7 F5WkJgW9CzgQxwVxnlpo8n0KLaCCUNwbU9epApG8/ntDthf1YIzz5G1GMxikM0KDUVUI XZGBF1c8mfY3u5RyqKG71rGpm77S4F0bz1UmdlvDK/xpKpDfx8MJ1AQOb0IGbWhB4M4M ABgw== X-Gm-Message-State: AOAM531MhbIosk9ryn1wIK3awcu/FgfY7ZKqZZdDb//9l+GNgK1Fqa4R IPZKKojfkf8T7rwUigNcCbc7uvapGpfSgUykwu4= X-Received: by 2002:a7b:c8c8:: with SMTP id f8mr3978165wml.49.1638268676339; Tue, 30 Nov 2021 02:37:56 -0800 (PST) Received: from cloudburst.home (149.164.14.37.dynamic.jazztel.es. [37.14.164.149]) by smtp.gmail.com with ESMTPSA id m21sm16311280wrb.2.2021.11.30.02.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 02:37:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/3] target/m68k: Implement TRAPcc Date: Tue, 30 Nov 2021 11:37:51 +0100 Message-Id: <20211130103752.72099-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211130103752.72099-1-richard.henderson@linaro.org> References: <20211130103752.72099-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::331 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Resolves: https://gitlab.com/qemu-project/qemu/-/issues/754 Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 1 + target/m68k/translate.c | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index a3423729ef..03f600f7e7 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -527,6 +527,8 @@ enum m68k_features { M68K_FEATURE_MOVEC, /* Unaligned data accesses (680[2346]0) */ M68K_FEATURE_UNALIGNED_DATA, + /* TRAPCC insn. (680[2346]0, and CPU32) */ + M68K_FEATURE_TRAPCC, }; static inline int m68k_feature(CPUM68KState *env, int feature) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index c7aeb7da9c..5f778773d1 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -162,6 +162,7 @@ static void m68020_cpu_initfn(Object *obj) m68k_set_feature(env, M68K_FEATURE_CHK2); m68k_set_feature(env, M68K_FEATURE_MSP); m68k_set_feature(env, M68K_FEATURE_UNALIGNED_DATA); + m68k_set_feature(env, M68K_FEATURE_TRAPCC); } /* diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 858ba761fc..cf29f35d91 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4879,6 +4879,26 @@ DISAS_INSN(trapv) do_trapcc(s, 9); /* VS */ } +DISAS_INSN(trapcc) +{ + /* Consume and discard the immediate operand. */ + switch (extract32(insn, 0, 3)) { + case 2: /* trapcc.w */ + (void)read_im16(env, s); + break; + case 3: /* trapcc.l */ + (void)read_im32(env, s); + break; + case 4: /* trapcc (no operand) */ + break; + default: + /* Illegal insn */ + disas_undef(env, s, insn); + return; + } + do_trapcc(s, extract32(insn, 8, 4)); +} + static void gen_load_fcr(DisasContext *s, TCGv res, int reg) { switch (reg) { @@ -6051,6 +6071,7 @@ void register_m68k_insns (CPUM68KState *env) INSN(scc, 50c0, f0f8, CF_ISA_A); /* Scc.B Dx */ INSN(scc, 50c0, f0c0, M68000); /* Scc.B */ INSN(dbcc, 50c8, f0f8, M68000); + INSN(trapcc, 50f8, f0f8, TRAPCC); INSN(tpf, 51f8, fff8, CF_ISA_A); /* Branch instructions. */ From patchwork Tue Nov 30 10:37:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519732 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp7288520imj; Tue, 30 Nov 2021 02:39:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlR1Xgz+wQ6VGU1AvV40xd1BoyXbnWaNhWZ9ktvgIWnNBsqWdIyTl19fSCDEQTq7sBUcIO X-Received: by 2002:a05:6214:529e:: with SMTP id kj30mr49596148qvb.50.1638268780697; Tue, 30 Nov 2021 02:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638268780; cv=none; d=google.com; s=arc-20160816; b=r0ocEZQ5vSmBKPinE2IteO21iGymphFeFaNCmOSp2eiEwIssEkc6Eyq03pvimJZsxD B8QlsUfQNZbozruSytmIuRdDzmxyX8OpMWM56ucArQ0FrUn6wId+PfCnnS/2YPgDpRSC 1QUf5Mekd674rXr7GVAx/Pe0pEgUkiJSlNIAxo+KxW2rx1ugcvzUNqBQ2xx0zeiqqyVn uLSGNAVaC/FlLlXrrwn2b02bPZVuApwRL1b8wAKpTj/swVV58mpGL2k6wqsBkOVCpxUp 2ctPWpFdLLZGXTqhyOZQeeItz0nQgoZcbKqqrMNc98rB8buAxoGsFQ3u6gthI0WaziJz 3O9w== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/v1m4qA4Gd41n8sF4rBW1hEMHXgoFCZFYmlKAxz/UNs=; b=yTXFm45qgh365Ap19ER/d+ChTn/bcG8howo4z+1eddK9nSaF8qr7nW4Rxrrtvywod2 rCa7Mg+OfP57TGC/Hsnbr6wzcIaD5Bs58LaOSFeC4vOFvLT5QIqzKSDN7gaTVDTjWzMO jVmfdL2QFAV2IA6wR7znEAVulC5T98iYcKY045z3MP6W4n6M+3Jks43S9P3vEszW/1Hv kzIrI9ohMHWxf8N7D0v8fwhrz9JiBsIBT4HB4XOqJ8hpgaL9H9lewYA0gDY/zLiSKXUu NrzXz/kNzQvyfJn7z/QZC58iKv4XsAbJ9IZZVmFXWjD4Kf2W+ohHa0/bTpaZENdRvGEi GsEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tab4pbil; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gg11si16677510qvb.468.2021.11.30.02.39.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Nov 2021 02:39:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tab4pbil; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms0Y0-0006vk-6A for patch@linaro.org; Tue, 30 Nov 2021 05:39:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms0WO-0006mm-Bg for qemu-devel@nongnu.org; Tue, 30 Nov 2021 05:38:00 -0500 Received: from [2a00:1450:4864:20::32a] (port=39626 helo=mail-wm1-x32a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ms0WM-0000PE-L6 for qemu-devel@nongnu.org; Tue, 30 Nov 2021 05:38:00 -0500 Received: by mail-wm1-x32a.google.com with SMTP id n33-20020a05600c502100b0032fb900951eso19125791wmr.4 for ; Tue, 30 Nov 2021 02:37:58 -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 :mime-version:content-transfer-encoding; bh=/v1m4qA4Gd41n8sF4rBW1hEMHXgoFCZFYmlKAxz/UNs=; b=Tab4pbilmwYerSq6cvH5M/W+1i9sgXxgXfNhfO7QeV3J+ZBQ7Uac5tjdOKBr4sfg3N DXBC2v1sPGXQHiI7bk3o9J8gVGpyw+bn9nq2GnEoSMWyRXnrGjzzypj5AS2PLh9ALsnn eHU67YLLoeXSQf+UqXcB9zvMraRQbMMb866eLLaBXmsAjASDcX5R8nejdNgeQ8d1LoSC crUeeMruXVqWYRwEQVovGCrAvS+iwdf5eu4U0qpk7HVpZScLEXTBoHY1CrSfrMtRFUkL ZTXsDlK8LyOd88mno5HVkKxZwYacUN9w9f/yph98IGvCYqlvFKQc9TnBIq85K3qaqXIz R5dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/v1m4qA4Gd41n8sF4rBW1hEMHXgoFCZFYmlKAxz/UNs=; b=RhwenKatN2s9iefxlgzS72m6TGAkYDaoyUQAZF6ogSmNrk6plkHgUJtH2NZWfOGjxA QcOIHdnDGZ1UgKR/I1lgtRWVYDTOeIMmeG9JYH8YAniWFZDd4+kuf8pk3/iHmdD2WDmh ppP4za/RdAF/hg8fzEx2oWlvpfZejQNK3f7hP2f1BxEWm74QuOr5pA+obRijKwIHdUhr UjN179Qa8iq5TSQnh+6jrrmyoKjSIVsRc8uCzvLuZPa6GfTfMtZla+1VssWguP7BHIxy GdJAPFIOXJQYwFj3weyI26B6XEdQcTgt79i1F1tgbe0SeIH/vcqvQnWIC/9IoVcUexhg vK+Q== X-Gm-Message-State: AOAM531wjB3TrLyw1EgfDPzgNZ2tW65Oo3yAX2pfsE3X6/HzmeISkOyo Hgm69kJsKK7OCzbpTNWo7s+3il7db1PE+8lFlSE= X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr3964317wmh.104.1638268677160; Tue, 30 Nov 2021 02:37:57 -0800 (PST) Received: from cloudburst.home (149.164.14.37.dynamic.jazztel.es. [37.14.164.149]) by smtp.gmail.com with ESMTPSA id m21sm16311280wrb.2.2021.11.30.02.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 02:37:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/3] target/m68k: Implement FTRAPcc Date: Tue, 30 Nov 2021 11:37:52 +0100 Message-Id: <20211130103752.72099-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211130103752.72099-1-richard.henderson@linaro.org> References: <20211130103752.72099-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/m68k/translate.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index cf29f35d91..3c04f9d1a9 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -5547,6 +5547,43 @@ DISAS_INSN(fscc) tcg_temp_free(tmp); } +DISAS_INSN(ftrapcc) +{ + DisasCompare c; + TCGLabel *over; + uint16_t ext; + int cond; + + ext = read_im16(env, s); + cond = ext & 0x3f; + + /* Consume and discard the immediate operand. */ + switch (extract32(insn, 0, 3)) { + case 2: /* ftrapcc.w */ + (void)read_im16(env, s); + break; + case 3: /* ftrapcc.l */ + (void)read_im32(env, s); + break; + case 4: /* ftrapcc (no operand) */ + break; + default: + /* Illegal insn */ + disas_undef(env, s, insn); + return; + } + + /* Jump over if !cond. */ + gen_fcc_cond(&c, s, cond); + update_cc_op(s); + over = gen_new_label(); + tcg_gen_brcond_i32(tcg_invert_cond(c.tcond), c.v1, c.v2, over); + free_cond(&c); + + gen_exception(s, s->base.pc_next, EXCP_TRAPCC); + gen_set_label(over); +} + #if defined(CONFIG_SOFTMMU) DISAS_INSN(frestore) { @@ -6170,6 +6207,7 @@ void register_m68k_insns (CPUM68KState *env) INSN(fbcc, f280, ffc0, CF_FPU); INSN(fpu, f200, ffc0, FPU); INSN(fscc, f240, ffc0, FPU); + INSN(ftrapcc, f278, ff80, FPU); INSN(fbcc, f280, ff80, FPU); #if defined(CONFIG_SOFTMMU) INSN(frestore, f340, ffc0, CF_FPU);