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 2E5EAC761A6 for ; Tue, 4 Apr 2023 19:52:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 529AC85837; Tue, 4 Apr 2023 21:52:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="jMtyFDM5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD71F85723; Tue, 4 Apr 2023 21:52:47 +0200 (CEST) Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7D29485C6D for ; Tue, 4 Apr 2023 21:52:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mibodhi@gmail.com Received: by mail-ua1-x92b.google.com with SMTP id ay14so24060878uab.13 for ; Tue, 04 Apr 2023 12:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680637961; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eWSJM9gy0OX06/Eriz5VkF7AHvMkQ6kyO+js5mNBOCU=; b=jMtyFDM5M5ksGJ1z5M0bRAXfmYy3+9G8h+smvX1LGRoD3YkOXygb+pMCYJDGfDpDHS AGPTUTC0U3tHbn5ZdKjAH/qraTGAOVKFgqFXa/I81AnHbYzF6CAtudBX1AM+JcKyILZ2 WCdR2OFYQ+KxLjj7kYVK/RM+gHCDdyCvQ3o30EqTFpnQd2JEPvG4305N6LPbcRnnBVFd hTngl1cQyl1kctXW2d9Nwe3amUJKw6/MPDkLUvsH46AzXj/PhYSzFgaZWH7KJhUb3Ooj izvnnlCjvsqLr4FfWwC7kUffOYOjuEMDLR/TY9G2eukFWvAcE6D2lrVxsikW2HBNM52W CYgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680637961; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eWSJM9gy0OX06/Eriz5VkF7AHvMkQ6kyO+js5mNBOCU=; b=u5ghEZ3ElVnHBKkqXpVinu0CicIdN2tj6mBjy77I689hvTU0rBYbTk9jYUO3CJ5VAz v2vz0gFTyMT1YhSA0iFfAKpNqcfVNdS8o4050Mxvc2fRQv4FZiJQgsP9l4DpE+Ij8TNE VPQ806VX1qp9dngXpY1wv3FiniGcxiNncQAHWx90Ew8tTHy+C11J4ALKBvsUOu8TC4ks HbAftn6HZSxFxzSkbdC8L53KakOk6lFGj3teewseqcA9DD15/uS4ac4InSW3ipnLNhLd Rr84NcR63uixGxhFg6tJKnK94RZsEqOoct0yTWKfhMhG3HGvZK5RAQc5P7qqu3w7mZHe 8F9g== X-Gm-Message-State: AAQBX9cwdQAghxHJlfBTyuf+wQGxcnO/e9eGSCFMprvet6tPDqmRVoAR L0kxllKsLqiDnx7ABeluiJNv6ggQHMd4PzblRaQ= X-Google-Smtp-Source: AKy350ZwxRF+SWVQO/Wi9Vj3kGGG82AWLGrAtgA35Y8dJzIrMLnKThzd+7sh5uLWUgfJh6QzG4hwoyRjDNsF9fDSfJQ= X-Received: by 2002:a9f:305c:0:b0:68a:5c52:7f2b with SMTP id i28-20020a9f305c000000b0068a5c527f2bmr2432650uab.1.1680637961059; Tue, 04 Apr 2023 12:52:41 -0700 (PDT) MIME-Version: 1.0 References: <20230401215439.9107-1-francis.laniel@amarulasolutions.com> <20230402101717.xyn4vckgyo5ddgu2@pali> In-Reply-To: <20230402101717.xyn4vckgyo5ddgu2@pali> From: Tony Dinh Date: Tue, 4 Apr 2023 12:52:29 -0700 Message-ID: Subject: Re: [RFC PATCH v1] arm: lib: add __gnu_thumb1_case_si To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: Francis Laniel , Tom Rini , Stefan Roese , u-boot@lists.denx.de, Michael Nazzareno Trimarchi , Sergei Antonov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi Francis, On Sun, Apr 2, 2023 at 3:17=E2=80=AFAM Pali Roh=C3=A1r wr= ote: > > On Saturday 01 April 2023 15:17:59 Tony Dinh wrote: > > Hi Francis, > > > > On Sat, Apr 1, 2023 at 2:55=E2=80=AFPM 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/4f181f9c7ee3efc509d185fdfd= a33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156 > > > > Thanks for the patch! I've added Tom, Pali, and Stefan. > > Looks good, > > Acked-by: Pali Roh=C3=A1r > > > 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. I've done some more testing with other boards. I'm seeing some problems with LTO in gcc-12, but it is not related to this patch. Acked-by: Tony Dinh Thanks, Tony > > > > 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/4f= 181f9c7ee3efc509d185fdfda33be9018f1611/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 > > >