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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71214C76196 for ; Sun, 2 Apr 2023 10:17:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50AAE859DE; Sun, 2 Apr 2023 12:17:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Y1Ob7wgc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E051D859DE; Sun, 2 Apr 2023 12:17:27 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8CC528582A for ; Sun, 2 Apr 2023 12:17:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A6F4C6116F; Sun, 2 Apr 2023 10:17:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D155AC433EF; Sun, 2 Apr 2023 10:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680430641; bh=LT/okzyhg7jeVt61Q4oEf/bITGFRt6oE1TDc7B2VwVo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y1Ob7wgczFFjRbW84fo2DT1SVxMl9wK+3YDopkcvVZfJN8exxOE6szdCjClb22+IV 1suestKrhswg9TjFb72mtS0xX/Oa2ivFc1d69Ltwyikk5LCIuC1Ov8TLEPf7mwjCek Lis/gJSQdVyH4xvJX2NOytb/U3XZpYlMtY8jDyho3HT5sLIFuZEr6yLu2CGiTDzaTh DLQMaBDmOniiD4XzvFxuC2lWdMv9tGm5ne3roPq9hrpr69Iydw6IH2M2uRItlj4ojI zHwA57ZMK+v8y6zkMl2C2E2cuaCTF9o/9jLpl7ezvJ89rVShNHKFjxyo9RjtQsHyiw jWBzTTUyKDqtg== Received: by pali.im (Postfix) id 9FB59A18; Sun, 2 Apr 2023 12:17:17 +0200 (CEST) Date: Sun, 2 Apr 2023 12:17:17 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Tony Dinh Cc: Francis Laniel , Tom Rini , Stefan Roese , u-boot@lists.denx.de, Michael Nazzareno Trimarchi , Sergei Antonov Subject: Re: [RFC PATCH v1] arm: lib: add __gnu_thumb1_case_si Message-ID: <20230402101717.xyn4vckgyo5ddgu2@pali> References: <20230401215439.9107-1-francis.laniel@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Saturday 01 April 2023 15:17:59 Tony Dinh wrote: > Hi Francis, > > On Sat, Apr 1, 2023 at 2:55 PM Francis Laniel > wrote: > > > > The assembly for __gnu_thumb1_case_si was taken from upstream gcc and adapted > > as width suffix was removed for the add instruction [1]. > > > > Signed-off-by: Francis Laniel > > Tested-by: Tony Dinh > > [1] https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156 > > Thanks for the patch! I've added Tom, Pali, and Stefan. Looks good, Acked-by: Pali Rohár > I think we need to do some more testing for other boards that have > CONFIG_HAS_THUMB2 and CONFIG_SPL_SYS_THUMB_BUILD. My test target > (Marvell Armada 385 SoC) is somewhat broken right now. So it will take > some time for me to get that back running to run this test. > > All the best, > Tony > > > --- > > arch/arm/lib/lib1funcs.S | 17 +++++++++++++++++ > > 1 file changed, 17 insertions(+) > > > > diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S > > index 7ff4446dd6..79cedc0aad 100644 > > --- a/arch/arm/lib/lib1funcs.S > > +++ b/arch/arm/lib/lib1funcs.S > > @@ -424,4 +424,21 @@ ENTRY(__gnu_thumb1_case_uhi) > > ret lr > > ENDPROC(__gnu_thumb1_case_uhi) > > .popsection > > + > > +/* Taken and adapted from: https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156 */ > > +.pushsection .text.__gnu_thumb1_case_si, "ax" > > +ENTRY(__gnu_thumb1_case_si) > > + push {r0, r1} > > + mov r1, lr > > + adds r1, r1, #2 /* Align to word. */ > > + lsrs r1, r1, #2 > > + lsls r0, r0, #2 > > + lsls r1, r1, #2 > > + ldr r0, [r1, r0] > > + adds r0, r0, r1 > > + mov lr, r0 > > + pop {r0, r1} > > + mov pc, lr /* We know we were called from thumb code. */ > > +ENDPROC(__gnu_thumb1_case_si) > > +.popsection > > #endif > > -- > > 2.34.1 > >