Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp786032pxk; Thu, 1 Oct 2020 13:53:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsa0c/6awenkU8Gh+xQC+iX/Q5y658q0JBNXJ8qscp9nwbx47f/JSdkzuTdci8S4JN+yXy X-Received: by 2002:a17:906:3e90:: with SMTP id a16mr9477733ejj.363.1601585592495; Thu, 01 Oct 2020 13:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601585592; cv=none; d=google.com; s=arc-20160816; b=KsiCmDE5ll11psUmpgwIiiv9Qv+uyGSxzcU/RhtowtFRDQ7QPWnCapzfLyjA7XSTpc kFCnAm6YCdO1/vpTop3QKgOTc8mYR43b5L4mev9zFl5/wwT1wG4DD4E28RhTeMw16rs6 QREJyrWMevgGU52rYyx0ejISg25aDWsc2IdHZlhps2pNqL2g0+Dfyx3LDkvQ9hLX2Iue Uq0PjWDMX9hUUy6yTJFSnSGCAgRyAtH77ZERKDW5NTf1rw/vJ2nBUGaRyYdnTZHVByMu uFY/3Ku1glwba23PNfuIulJRw8qFUjOCr5NUuXYzwgGYe+bAJ9vL6nCyx3CayZqSj00E i8vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7FXA/U48ACyc78ToAJnPPaVktNhkeTLfXfq4Zvy4VSE=; b=HzDo64C6ygD0UnLcvBxwDgYNhWqnOTMoz/KiPznYCHDONWVeYPsv8Je+hKmfgMKaRr /RppIFw5W3ipqpO/mrBVR3r39I1QB8VHACFB5NmyCo2XQ+hhHY+2ynS91xnm6TDsq+Tu ZHnIL/mOjSGDtgvhjtgOWOgUBJV02mVEkfMHDppGP74fQaDfUbm1Vsy8WSVR8gnf6cs5 AtkjeBwEKvSuTyY/VK6l2toiDufOJI0k4zS45AbZgpRyBuBeAQpjEMIEjVCnSaGRITEp zIUFmfHyoVaxFNJaKnutrZD8ZCKaYtt1QEn43cE8L7NXaYR1bMtNrnrJCQuAgJ+2gtN0 1HXw== 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 y101si4471075ede.543.2020.10.01.13.52.49; Thu, 01 Oct 2020 13:53:12 -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 S1726980AbgJAUtv (ORCPT + 99 others); Thu, 1 Oct 2020 16:49:51 -0400 Received: from gate.crashing.org ([63.228.1.57]:58748 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbgJAUtv (ORCPT ); Thu, 1 Oct 2020 16:49:51 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 091KiIqu017242; Thu, 1 Oct 2020 15:44:19 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 091KiHHX017241; Thu, 1 Oct 2020 15:44:17 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 1 Oct 2020 15:44:17 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] powerpc/time: Rename mftbl() to mftb() Message-ID: <20201001204417.GP28786@gate.crashing.org> References: <94dc68d3d9ef9eb549796d4b938b6ba0305a049b.1601556145.git.christophe.leroy@csgroup.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94dc68d3d9ef9eb549796d4b938b6ba0305a049b.1601556145.git.christophe.leroy@csgroup.eu> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2020 at 12:42:39PM +0000, Christophe Leroy wrote: > On PPC64, we have mftb(). > On PPC32, we have mftbl() and an #define mftb() mftbl(). > > mftb() and mftbl() are equivalent, their purpose is to read the > content of SPRN_TRBL, as returned by 'mftb' simplified instruction. > > binutils seems to define 'mftbl' instruction as an equivalent > of 'mftb'. > > However in both 32 bits and 64 bits documentation, only 'mftb' is > defined, and when performing a disassembly with objdump, the displayed > instruction is 'mftb' > > No need to have two ways to do the same thing with different > names, rename mftbl() to have only mftb(). There are mttbl and mttbu insns (and no mttb insn); they write a 32-bit half for the time base. There is an mftb, and an mftbu. mftbu reads the upper half, while mftb reads the *whole* register. SPR 269 is the TBU register, while SPR 268 is called both TB and TBL. Yes, it is confusing :-) The "mftb" name is much clearer than "mftbl" (on 64-bit), because it reads the whole 64-bit register. On 32-bit mftbl is clearer (but not defined in the architecture, not officially an insn or even an extended mnemonic). Segher