From: "Jeff Brasen via groups.io" <jbrasen=nvidia.com@groups.io>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"ardb+tianocore@kernel.org" <ardb+tianocore@kernel.org>,
"quic_llindhol@quicinc.com" <quic_llindhol@quicinc.com>,
"sami.mujawar@arm.com" <sami.mujawar@arm.com>
Subject: Re: [edk2-devel] [PATCH 1/1] ArmPkg/CompilerIntrinsicsLib: provide __ashlti3
Date: Fri, 2 Feb 2024 17:44:14 +0000 [thread overview]
Message-ID: <LV2PR12MB58008BE09BDE21BD5655229FCB422@LV2PR12MB5800.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CAMj1kXF8UJ84b4Lof55Ax8X6iVc7JSiKzRG9S7KexP7sqHCmCw@mail.gmail.com>
I needed this when I updated the OpenSSL on our builds to 3.0.12 to resolve some CVEs.
> -----Original Message-----
> From: Ard Biesheuvel <ardb@kernel.org>
> Sent: Friday, February 2, 2024 10:27 AM
> To: Jeff Brasen <jbrasen@nvidia.com>
> Cc: devel@edk2.groups.io; ardb+tianocore@kernel.org;
> quic_llindhol@quicinc.com; sami.mujawar@arm.com
> Subject: Re: [PATCH 1/1] ArmPkg/CompilerIntrinsicsLib: provide __ashlti3
>
> External email: Use caution opening links or attachments
>
>
> On Thu, 1 Feb 2024 at 03:05, Jeff Brasen <jbrasen@nvidia.com> wrote:
> >
> > The compiler will use this function if it is left shifting a 128 bit
> > value.
> >
> > Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
>
> UEFI does not define any 128 bit types, right? How do you end up needing
> this?
>
>
> > ---
> > .../CompilerIntrinsicsLib.inf | 1 +
> > .../CompilerIntrinsicsLib/AArch64/ashlti3.S | 33 +++++++++++++++++++
> > 2 files changed, 34 insertions(+)
> > create mode 100644
> > ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S
> >
> > diff --git
> > a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> > b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> > index 7e22e6f67bff..054e68130730 100644
> > --- a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> > +++ b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> > @@ -66,6 +66,7 @@ [Sources.ARM]
> >
> > [Sources.AARCH64]
> > AArch64/Atomics.S | GCC
> > + AArch64/ashlti3.S | GCC
> >
> > [Packages]
> > MdePkg/MdePkg.dec
> > diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S
> > b/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S
> > new file mode 100644
> > index 000000000000..79a7b3514c57
> > --- /dev/null
> > +++ b/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S
> > @@ -0,0 +1,33 @@
> > +#--------------------------------------------------------------------
> > +----------
> > +#
> > +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> > +#
> > +# SPDX-License-Identifier: BSD-2-Clause-Patent #
> > +#--------------------------------------------------------------------
> > +----------
> > +
> > +#include <AsmMacroIoLib.h>
> > +
> > +ASM_FUNC(__ashlti3)
> > + # return if shift is 0
> > + cbz x2, 1f
> > +
> > + mov x3, #64
> > + sub x3, x3, x2
> > + cmp x3, #0
> > + b.le 2f
> > +
> > + # shift is <= 64 bits
> > + lsr x3, x0, x3
> > + lsl x1, x1, x2
> > + orr x1, x1, x3
> > + lsl x0, x0, x2
> > +1:
> > + ret
> > +
> > +2:
> > + # shift is > 64
> > + neg w3, w3
> > + lsl x1, x0, x3
> > + mov x0, #0
> > + ret
> > --
> > 2.34.1
> >
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115065): https://edk2.groups.io/g/devel/message/115065
Mute This Topic: https://groups.io/mt/104088827/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2024-02-02 17:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 2:05 [edk2-devel] [PATCH 1/1] ArmPkg/CompilerIntrinsicsLib: provide __ashlti3 Jeff Brasen via groups.io
2024-02-02 17:26 ` Ard Biesheuvel
2024-02-02 17:44 ` Jeff Brasen via groups.io [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=LV2PR12MB58008BE09BDE21BD5655229FCB422@LV2PR12MB5800.namprd12.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox