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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46829C77B75 for ; Fri, 21 Apr 2023 12:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231537AbjDUMVl (ORCPT ); Fri, 21 Apr 2023 08:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbjDUMVl (ORCPT ); Fri, 21 Apr 2023 08:21:41 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB62D5FEB for ; Fri, 21 Apr 2023 05:21:39 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1ppplh-00073N-00; Fri, 21 Apr 2023 14:21:37 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 5539EC012E; Fri, 21 Apr 2023 14:21:25 +0200 (CEST) Date: Fri, 21 Apr 2023 14:21:25 +0200 From: Thomas Bogendoerfer To: Jiaxun Yang Cc: "linux-mips@vger.kernel.org" , llvm@lists.linux.dev, Nick Desaulniers , Nathan Chancellor Subject: Re: [PATCH 5/8] MIPS: mipsregs: Parse fp and sp register by name in parse_r Message-ID: <20230421122125.GA10237@alpha.franken.de> References: <20230409104309.13887-1-jiaxun.yang@flygoat.com> <20230409104309.13887-6-jiaxun.yang@flygoat.com> <20230421104832.GA9238@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Fri, Apr 21, 2023 at 12:38:07PM +0100, Jiaxun Yang wrote: > > > > 2023年4月21日 11:48,Thomas Bogendoerfer 写道: > > > > On Sun, Apr 09, 2023 at 11:43:06AM +0100, Jiaxun Yang wrote: > >> parse_r helper is used to parse register number from oprand, > >> it only handles oprand which use number to refer register before. > >> > >> However compiler may use $gp and $sp to reference register 29 and > >> 30. Handle this situation by adding relevant match name. > > > > are you sure the compiler is doing that ? Which compiler is this ? > > To me this feels more like missing #defines from asm/regdef.h for > > some inline assembly stuff... > > Yes, clang is doing that, see[1]. > > There is no inline assembly mentioning $fp for cfcmsa but clang is still generating $fp for > cfcmsa. > > I was able to reproduce this by dumping assembly generated by clang, but I’m > unable to reproduce it for now, it seems like clang will only allocate $fp in rare cases. so is this clang miss-behaviour ? If yes fix should be done there. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]