From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) by mx.groups.io with SMTP id smtpd.web09.13874.1647364146756449820 for ; Tue, 15 Mar 2022 10:09:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cs1Aj4hr; spf=pass (domain: gmail.com, ip: 209.85.217.42, mailfrom: pedro.falcato@gmail.com) Received: by mail-vs1-f42.google.com with SMTP id b190so21524896vsc.4 for ; Tue, 15 Mar 2022 10:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3q4rMOkADweVeVFAu6NFJHe072iDEQY/KAA1vwjzyvs=; b=cs1Aj4hrKn2rVnCt6ZbptKBgTvx3WYUqVaMhwmF2A20JXYIrcarilWYi3cCjYO9rq6 p7IAU7vBW22sOAAF8Z7TanpTeTL37is2YvpLzVm0CGFOZFbrilHm3oqB2MjmtjjiGjvf 8mkNuiubxj8sIJy9J8vuXQwCMyUAws6Cx6svlEzL9/UxNpNoInZBGCVIlSj2QwuiQkBN MLlyp07Yt1Ke0hlPxrmJMOINQjgQuKZVOlmXJyLE9XPYWr8zPN6ggZJ0QYQ9WHdLu+Gp nZgg/UAgRNXeMsaqiA2kd0ieR1Mlr3srCLAStohFsyfFzPFfjGuTu5V65in6qWQsLOuH JE+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3q4rMOkADweVeVFAu6NFJHe072iDEQY/KAA1vwjzyvs=; b=xIJHBPsEgNvm1Q251zyMB/QpuUfl6BNt+k/Ogbu8uS5s9+GjoWIJ+5j447U17YJuDp FeuuXrMetLN5lc7ux1DTJT34D9DrARYpRcDp0yYviPZUdjs9jiv068UcPsiiuZ2L/2ig rhrwdE5IMH+ZCS52mRpsmhjSmMnIwZJ0ovEbP0d0wBXRAY2MaDT+ln/Q5K6Saj5w0GQY M3bFQEQpEGDmdGxRlWy6wFRufzq8DpSXG9nHgQPw8HHy5cjaD/0yLhZUxV+YQtebNNIl Eyl6smp3HXAUl/MUaNQvaHjYDdlx9VGgdE+m8pukxsyg3IKep7CLb71umaF4aww86t+b ybzA== X-Gm-Message-State: AOAM533W0T+PQ2helrtA/+K+jtTTyRctGBbEvZbicucG7spdkkSBFRym STTzxL26RqKTmVE74LiBHbalxiobYBTj7EEDkLukKGGC0S39NPC/ X-Google-Smtp-Source: ABdhPJxQTAleg5B4QTDZWqf4ggeRcSHq7azNI6nQhdbQfX6tXgNSOL7uZP/rw6deNvopJnBQbo9kl7ovk8OkJ73PyfA= X-Received: by 2002:a67:e3bb:0:b0:320:c5f7:9647 with SMTP id j27-20020a67e3bb000000b00320c5f79647mr11468652vsm.7.1647364145549; Tue, 15 Mar 2022 10:09:05 -0700 (PDT) MIME-Version: 1.0 References: <20220301071820.3135133-1-kraxel@redhat.com> <20220315122242.xwi2xckfos2c3cff@sirius.home.kraxel.org> In-Reply-To: <20220315122242.xwi2xckfos2c3cff@sirius.home.kraxel.org> From: "Pedro Falcato" Date: Tue, 15 Mar 2022 17:08:55 +0000 Message-ID: Subject: Re: [edk2-devel] [PATCH 0/3] [RFC] consolidate compiler intrinsics To: edk2-devel-groups-io , kraxel@redhat.com Cc: Xiaoyu Lu , Bob Feng , Rebecca Cran , James Bottomley , Sami Mujawar , Jordan Justen , Erdem Aktas , Jiewen Yao , Supreeth Venkatesh , Sebastien Boeuf , Zhichao Gao , Zhiguang Liu , Maciej Rabeda , Maurice Ma , Andrew Fish , Ard Biesheuvel , Tom Lendacky , Peter Grehan , Sean Brogan , Guomin Jiang , Bret Barkelew , Yuwei Chen , Benjamin You , Daniel Schaefer , Liming Gao , Michael D Kinney , Wei6 Xu , Jian J Wang , Jiaxin Wu , Siyuan Fu , Guo Dong , kilian_kegel@hotmail.com, Abner Chang , Oliver Steffen , Leif Lindholm , Brijesh Singh , Min Xu , Ray Ni , Alexei Fedorov , Julien Grall , Nickle Wang , Pawel Polawski , Anthony Perard Content-Type: multipart/alternative; boundary="000000000000b6170905da44da63" --000000000000b6170905da44da63 Content-Type: text/plain; charset="UTF-8" Gerd, Have you considered just pulling in LLVM's compiler-rt builtins? It implements essentially everything we'll ever need for a GNU-like toolchain, for all the architectures we support, and also has unit tests ( https://github.com/llvm/llvm-project/tree/main/compiler-rt/test/builtins/Unit ). I think it would be a good idea considering it's guaranteed to be correct and always implements whatever clang requires (and AFAIK clang always requires what gcc requires). Best regards, Pedro On Tue, Mar 15, 2022 at 12:23 PM Gerd Hoffmann wrote: > On Tue, Mar 01, 2022 at 08:18:17AM +0100, Gerd Hoffmann wrote: > > This is an attept to start cleaning up the messy compiler intrinsics > > situation. Today we don't have a core intrinsics library, resulting > > in everybody creating their own. ArmPkg has one, CryptoPkg has one. > > I'm sure there are many more. > > > > This doesn't make sense. Given we can't avoid compiler intrinsics (as > > proven by the existence of those libraries) we should better have them > > as core library so we have to maintain a single version only. > > > > Given we already have BaseIoLibIntrinsic in MdePkg we can place the > > compiler intrinsics there too. This little patch series does just that: > > It moves over the existing ArmPkg intrinsics, fixes them to build on > > non-arm too, and adds additional bits from the CryptoPkg intrinsics. > > Ping. How go forward with this? I've posted it as RFC because > I expected a more controversial discussion. But seems everybody > agrees this is a step into the right direction. > > So just merge this as-is? > > Yes, it passed CI (https://github.com/tianocore/edk2/pull/2542). > > take care, > Gerd > > > > > > > -- Pedro Falcato --000000000000b6170905da44da63 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Gerd,

Have you considered just pulling = in LLVM's compiler-rt builtins? It implements essentially everything we= 'll ever need for a GNU-like toolchain, for all the architectures we su= pport, and also has unit tests (https://github.com/llvm/llvm= -project/tree/main/compiler-rt/test/builtins/Unit).

I think it would be a good idea considering it's guaranteed to be= correct and always implements whatever clang requires (and AFAIK clang alw= ays requires what gcc requires).
=C2=A0
Best regards,
Pedro

On Tue, Mar 15, 2022 at 12:23 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
=
On Tue, Mar 01, 2022 at 0= 8:18:17AM +0100, Gerd Hoffmann wrote:
> This is an attept to start cleaning up the messy compiler intrinsics > situation.=C2=A0 Today we don't have a core intrinsics library, re= sulting
> in everybody creating their own.=C2=A0 ArmPkg has one, CryptoPkg has o= ne.
> I'm sure there are many more.
>
> This doesn't make sense.=C2=A0 Given we can't avoid compiler i= ntrinsics (as
> proven by the existence of those libraries) we should better have them=
> as core library so we have to maintain a single version only.
>
> Given we already have BaseIoLibIntrinsic in MdePkg we can place the > compiler intrinsics there too.=C2=A0 This little patch series does jus= t that:
> It moves over the existing ArmPkg intrinsics, fixes them to build on > non-arm too, and adds additional bits from the CryptoPkg intrinsics.
Ping.=C2=A0 How go forward with this?=C2=A0 I've posted it as RFC becau= se
I expected a more controversial discussion.=C2=A0 But seems everybody
agrees this is a step into the right direction.

So just merge this as-is?

Yes, it passed CI (https://github.com/tianocore/edk2/pull= /2542).

take care,
=C2=A0 Gerd








--
Pedro Falcato
--000000000000b6170905da44da63--