Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1152123pxy; Thu, 29 Apr 2021 00:25:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPgZSWBfqmhV2Uf5++PZeDsx9Gb44z9vgEMZEDK/vVcWMFgNAYhnBD4Gek1H8EM7nA56gC X-Received: by 2002:a63:1921:: with SMTP id z33mr31403423pgl.211.1619681158557; Thu, 29 Apr 2021 00:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619681158; cv=none; d=google.com; s=arc-20160816; b=YXG/2qFmoBmjeOsuG3lkBcZ/r4+akyr1JzPLoOo46iBr4d0mDaBWHUiam8NDueUnMs d9kgYPH6aE5yAnMh/Y38mTt11TWaaU0UNKncAf/4vGY5KyaB9b5jV5KUoB8+FYfBNH+O PUDzlLWek44k3ZMMNHsNEZQo1O3hPiTB80TSxQTPoQMUnAxhcCgeudOBxlDita+UzvgU v4riZHH5a2Fcz1LOrqTSNDWkdSAkbT1NkSQbqEkZ30ORd7QSBYvmnkdJKht4VcdWxd3I aXyThW3veNwOhS2ITyzSJwjtNlFebmmboeKthAaJBU52OI72gJa6Rwn7rmNFZjxWX8nI Oevg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=BR+Zb6bXtQ8BGY8mZumeMhUwBbZF2jGOR3njZwlxxUo=; b=lrPVRf57czWJCZokyfVrK1PVyutRY24T6gY/GG2BIYarlAUu7K1yhoE+1BPvHmVPL0 pbWC7yTV6VmycqleQldMsRr4PPQKv7siRUrjI+C4aJkzQI8GCFLOw//FMwBo/ddDI8uy Acp5KE7+prv1W9NpZ90WRGzFTonmq8uqpKg8gvQdoReY9OPhi/n3yKP5ooy7Lxla1hsb 30IIlF1eQYU0LGw0VeNDyQqGO/4tMyDeDlOIt7zjTIoER5BtDpBeHzRPflaiQiBH1dMk 6PniM5vKV/2+wULrhNaRXJWm5xEyGhMX+UEgP+2FbzNzQDxGJnfz0JDZnzmJvxA5KARs nl7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si2629115pgi.22.2021.04.29.00.25.42; Thu, 29 Apr 2021 00:25:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238991AbhD2HZx (ORCPT + 99 others); Thu, 29 Apr 2021 03:25:53 -0400 Received: from mail-vk1-f169.google.com ([209.85.221.169]:34622 "EHLO mail-vk1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232511AbhD2HZu (ORCPT ); Thu, 29 Apr 2021 03:25:50 -0400 Received: by mail-vk1-f169.google.com with SMTP id q192so3306949vke.1; Thu, 29 Apr 2021 00:25:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BR+Zb6bXtQ8BGY8mZumeMhUwBbZF2jGOR3njZwlxxUo=; b=pSQl/F6GHiWWSyjZNPEnp6B0D8lZB0Rg3QVAQ5xd7NYXsPINZNp+BWID7jwnIXAKDX LKx6kVjqzjbb4Snt5dpMpBHojVo+3v0LUpPvMfmQmUYrqJog5VSPiT0uwhym/mphEyox osEl+xDc7ybfLr60hdXdflKWCn72Uy4xRsqIOwasXuSaSY3DgpsI7OQeoN4uJHiLtgf7 gOF/vhXq5r8RoahJNnPwRbTH+MRnGYOvtLycF19OOxxYJwQKVQzwzfLPZFN6EGEgATH3 4U86xWumKWaFGhNth14QUi5OHAsdU5a0g6iQB2X8cqBXoqGy0354QuTlQOfBfY+p/s9w EKWA== X-Gm-Message-State: AOAM5324RBrF5AztyqW1qGeHnb/EVBYVhQGGd6y3KiwZe3FgPo+8+VaT xrWr5fs8NI3vqudnMbqxVSixa0nQs3BASgT+qgrYAFLRzd0= X-Received: by 2002:a1f:5682:: with SMTP id k124mr28961242vkb.2.1619681006490; Thu, 29 Apr 2021 00:23:26 -0700 (PDT) MIME-Version: 1.0 References: <20210323221430.3735147-1-laurent@vivier.eu> <20210323221430.3735147-3-laurent@vivier.eu> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 29 Apr 2021 09:23:15 +0200 Message-ID: Subject: Re: [PATCH 2/2] m68k: introduce a virtual m68k machine To: Josh Juran Cc: Laurent Vivier , Linux Kernel Mailing List , linux-m68k , linux-rtc@vger.kernel.org, Alessandro Zummo , Alexandre Belloni Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Josh, On Thu, Apr 29, 2021 at 1:06 AM Josh Juran wrote: > On Apr 28, 2021, at 8:04 AM, Geert Uytterhoeven wrote: > > This can be simplified by shifting irq_pending instead of irq_bit: > > > > do { > > if (irq_pending & 1) > > generic_handle_irq(irq_num); > > > > ++irq_num; > > irq_pending >>= 1; > > } while (irq_pending); > > > > Unfortunately m68k doesn't have a single-instruction __ffs(). > > The 68000 and 68010 don't, but couldn't the 68020's BFFFO do the job? I looked at the code generated by gcc for __builtin_ffs(), and while it did use BFFFO, it needs several other instructions. The same can be seen in arch/m68k/include/asm/bitops.h: static inline int ffs(int x) { int cnt; __asm__ ("bfffo %1{#0:#0},%0" : "=d" (cnt) : "dm" (x & -x)); return 32 - cnt; } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds