From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9593C43460 for ; Thu, 29 Apr 2021 07:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6514761431 for ; Thu, 29 Apr 2021 07:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239066AbhD2HZz (ORCPT ); Thu, 29 Apr 2021 03:25:55 -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-Google-Smtp-Source: ABdhPJzWxXJHZHy/a/3azuE76fEyxLCedtlAO9sChfUUdpE3dbANNOgLoCyBS8aBE6LYvOYl+2jaqpKGLBJpBu4clNQ= 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