From patchwork Thu Jun 2 11:58:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 578102 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp486429max; Thu, 2 Jun 2022 05:20:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy78x8ijHEnKtz9wdclcM4srCqahf4fvDgg9ech2WmSHnevDHwiviI0UgeMEbuwffHi2GrT X-Received: by 2002:a05:6214:2aab:b0:461:bb29:6f2 with SMTP id js11-20020a0562142aab00b00461bb2906f2mr58257855qvb.38.1654172446500; Thu, 02 Jun 2022 05:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654172446; cv=none; d=google.com; s=arc-20160816; b=oSYDhEWfPRN0b3hRPXkFtmGkWkbUvrOHygtDaRghmRQevXOI03rpQU9+sqhiiu1YXb H7oQuyMMzK4kcZvoSRlXHzbbgZwpamh7CBqAuZFi7+ARiHFy71I+6nUdu4kmTCKygh94 xBWPck/EdS2ItoKk9k7diXTXJDccloV8qsXNlMEB1X7wN74oFSfpWPRAMLNu0kgyeaQi 9bNTtD/QdbyuYmwcpBqRAvvNC38lj5qw+wMmZGmTIY+yomX9kjsfl5tW49DJ6JSTjASA pfLwMtXct2oRKeyhmi6JlxPf9T0zn3XKW/q1VbjFbC7kV5Ur17wiuFqYTj6doQtVzUqd D55A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=oh2/01Tig4gjEvGWpiyEINXAVP6Ly+okDBxXjhsaLdQ=; b=CyTDZFmTwykxov6KdYyzpD5MYgjCYUConMiVtmrmZOKc0gCppJrcShPDntD4ETbVDm OLe/8H1a/nXyNaH6VGNQVmdUo1uW7R5MftwkMCh3OGw/UpX2d738P5laj5bGpBqoG/G/ a2Ulbu2nv8XhJASLDVnz7LVdhveVUtqcwfPijVwmf0V79toX20rrVLvXvzLI7oVphWFL wqsvTD7UyK9HmIPJNdEhifbefgBx7k7w5vrQslyD1haf8N7LAscS/VEUjo95jhkv9WRB 4H0hImGS/GKWsmN+r8rKAgNpaCnOieWUioB2/tES8+MKdE98RNegTzQAGchoruIbKtAw ML9Q== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i82-20020a379f55000000b006a36014c46asi1838477qke.737.2022.06.02.05.20.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jun 2022 05:20:46 -0700 (PDT) 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; 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" Received: from localhost ([::1]:50390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwjok-0007S9-2e for patch@linaro.org; Thu, 02 Jun 2022 08:20:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwjTV-0000gD-UE for qemu-devel@nongnu.org; Thu, 02 Jun 2022 07:58:49 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:36841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwjTU-0001F5-8R for qemu-devel@nongnu.org; Thu, 02 Jun 2022 07:58:49 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M1Hi8-1nv5qe0jxC-002oA6; Thu, 02 Jun 2022 13:58:46 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson Subject: [PULL 15/19] target/m68k: Implement FTRAPcc Date: Thu, 2 Jun 2022 13:58:33 +0200 Message-Id: <20220602115837.2013918-16-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220602115837.2013918-1-laurent@vivier.eu> References: <20220602115837.2013918-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:BsQvszhiMunhfUGS9kl7E5WtpL9uCiUN+7E2JTwK7APFKVOqxqs uXITMBrg8VOWM232q7CMZdo2L8hEUM9AEu8TsYBDGFGYjiqQ3NfWuNw3gJp1TPvw20Jo0GD Z94tVjk+0ZpnInJTa0F/ol50Obpz2AaYTazhDDIHJ8t2vKXPmXi5r0XethonHOTPRKKeM3+ 9+7K4fhh8qxPNtXhSEYug== X-UI-Out-Filterresults: notjunk:1;V03:K0:mOYMHOGQ4B4=:TQZWJWYOVJ+uglpJZ3XQWl 9tiahQdcB3cIf9xPRcA7ABUgTReaWzD60Pit+F/JcQIo6ZqW7m6VGZLqRFlcjtF2nx06cZOnL Mx+UYB53ytgS+cT/XPpqZUGUKJK9sper2CPxQQDkfCUojtslWvYfuciupvULCLu/Ohv/xRSaJ beFczOhZQA/CR8k4YXaU6IfzEEy1vqsGmgOP8XtwqJkOmGWIYnh4s6Q/sgPmtbVoJHJL2oQu9 k9scptl5YMIABbSrK86A27MVT701KFPCXHntWrPWXk1h+cSkkVEX6k/Htno85KGjaX60fPRe4 KHHdJw3fl5pyENNx8AHaIT3lCO2KNBF4f/aTG3sjaYIL8C1LHCk5IwWfSqu59AR+DEb9iJRur glxRFUt3WYU4OvAv183SCzL+ZhNbgFkOGMAPgao7NRAhAqR0y13vMWIBHTYYK8fY8iCPGFZF7 /xTf0NibLoy0n4Xvqq2iorksYWs2tt15BfboDHVWyZwY2bdnLL3ycqnYdIPWHTRb8fBFJY8D1 u+kwOCYKwD+aobgnR1txuXLuIhsDDvnBkG49I+zMSD4rhCKgp1s/Y//mCZr6xJaCDdh2idCny 2ELHHUpw7f59QXWliUPMgzgW1/olNHyM/9orikTZdQk1hb29ejzKfqv8GWDfPOKtU61fxoH/N a4ovGoGLUvLrxK3PLca+R4NoLk3dypsoKhyZHB2fFhf+psfsk9LYA+TJ8IZfjEmANhDzHHYhr q2nOQ1oxfUy1eEDqpDp4KADess/TEAHxmcUiUw== Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Message-Id: <20220602013401.303699-14-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 0dfddaa05628..8f3c298ad04f 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -5566,6 +5566,34 @@ DISAS_INSN(fscc) tcg_temp_free(tmp); } +DISAS_INSN(ftrapcc) +{ + DisasCompare c; + 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: + /* ftrapcc registered with only valid opmodes */ + g_assert_not_reached(); + } + + gen_fcc_cond(&c, s, cond); + do_trapcc(s, &c); +} + #if defined(CONFIG_SOFTMMU) DISAS_INSN(frestore) { @@ -6192,6 +6220,8 @@ void register_m68k_insns (CPUM68KState *env) INSN(fbcc, f280, ffc0, CF_FPU); INSN(fpu, f200, ffc0, FPU); INSN(fscc, f240, ffc0, FPU); + INSN(ftrapcc, f27a, fffe, FPU); /* opmode 010, 011 */ + INSN(ftrapcc, f27c, ffff, FPU); /* opmode 100 */ INSN(fbcc, f280, ff80, FPU); #if defined(CONFIG_SOFTMMU) INSN(frestore, f340, ffc0, CF_FPU);