From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 0DA7A3858405 for ; Wed, 25 Aug 2021 20:33:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0DA7A3858405 Received: by mail-ej1-x629.google.com with SMTP id i21so1115384ejd.2 for ; Wed, 25 Aug 2021 13:33:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b801Rc4VliEX1bqUdZd8ottcFEljt99Qxv33XmfFrL4=; b=DBGiBNj6oQnCIR4d5H2rIQi3rLeJMc2coR/oXBTfMbsx0tzxssyscwsI/uh4xlWOlG mVWnrvs4OB5/jk9U1ozPkGefexgVesCjyY++EE7O4mDOGgpBbKy8T5bN09nenFnibGkB AhroVrms1vDaQB6yeqDpu3Ap4SX/wWa9tBY/g7nLkuAs5Tj9qqjkAYRy3j4PER9PmMdK bBcl8h1CXfrbUoIrhqISr6bMpforCN3pxv20yv9m+R7oqW6EtSbm33UYOvckjoMreCLG cbFbFf103hDA79tw04khV4bqZ/OtJcXO973KegTxk7ZsR3nQ9Wy1khrQnqbXjfxBnJJV GrDA== X-Gm-Message-State: AOAM531IXmbqeiBSjPuUPuRjCCESW9QfHiCbd/R3w4bTSfISRESY9izb NyNRQbbq6RtfGlbwRFFdvYCA7RkCZZP1X0pG5Sg= X-Google-Smtp-Source: ABdhPJxMcYkrp3TTkTTx43V4wwSfkG1cvpmu1TturQF/KheBd3YFfOpclXTBqgnAc8Sg9+SUTLugxzixlpdYAluTRuc= X-Received: by 2002:a17:906:158f:: with SMTP id k15mr467600ejd.241.1629923582998; Wed, 25 Aug 2021 13:33:02 -0700 (PDT) MIME-Version: 1.0 References: <20210701210537.51272-1-hjl.tools@gmail.com> In-Reply-To: From: John McCall Date: Wed, 25 Aug 2021 16:32:52 -0400 Message-ID: Subject: Re: [llvm-dev] [PATCH] Add optional _Float16 support To: ia32-abi@googlegroups.com Cc: "Wang, Pengfei" , LLVM Dev , GCC Patches , GNU C Library X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2021 20:33:14 -0000 On Wed, Aug 25, 2021 at 8:36 AM H.J. Lu wrote: > On Mon, Aug 23, 2021 at 10:55 PM John McCall wrote: > > On Thu, Jul 29, 2021 at 9:40 AM H.J. Lu wrote: > >> On Tue, Jul 13, 2021 at 9:24 AM H.J. Lu wrote: > >> > On Tue, Jul 13, 2021 at 8:41 AM Joseph Myers > wrote: > >> > > On Tue, 13 Jul 2021, H.J. Lu wrote: > >> > > > On Mon, Jul 12, 2021 at 8:59 PM Wang, Pengfei < > pengfei.wang@intel.com> wrote: > >> > > > > > >> > > > > > Return _Float16 and _Complex _Float16 values in %xmm0/%xmm1 > registers. > >> > > > > > >> > > > > Can you please explain the behavior here? Is there difference > between _Float16 and _Complex _Float16 when return? I.e., > >> > > > > 1, In which case will _Float16 values return in both %xmm0 and > %xmm1? > >> > > > > 2, For a single _Float16 value, are both real part and > imaginary part returned in %xmm0? Or returned in %xmm0 and %xmm1 > respectively? > >> > > > > >> > > > Here is the v2 patch to add the missing _Float16 bits. The PDF > file is at > >> > > > > >> > > > https://gitlab.com/x86-psABIs/i386-ABI/-/wikis/Intel386-psABI > >> > > > >> > > This PDF shows _Complex _Float16 as having a size of 2 bytes > (should be > >> > > 4-byte size, 2-byte alignment). > >> > > > >> > > It also seems to change double from 4-byte to 8-byte alignment, > which is > >> > > wrong. And it's inconsistent about whether it covers the long > double = > >> > > double (Android) case - it shows that case for _Complex long double > but > >> > > not for long double itself. > >> > > >> > Here is the v3 patch with the fixes. I also updated the PDF file. > >> > >> Here is the final patch I checked in. _Complex _Float16 is changed to > return > >> in XMM0 register. The new PDF file is at > >> > >> https://gitlab.com/x86-psABIs/i386-ABI/-/wikis/Intel386-psABI > > > > > > This should be explicit that the real part is returned in bits 0..15 and > the imaginary part is returned in bits 16..31, or however we conventionally > designate subcomponents of a vector. > > How about this? > > diff --git a/low-level-sys-info.tex b/low-level-sys-info.tex > index 860ff66..8f527c1 100644 > --- a/low-level-sys-info.tex > +++ b/low-level-sys-info.tex > @@ -457,6 +457,9 @@ and \texttt{unions}) are always returned in memory. > & \texttt{__float128} & memory \\ > \hline > & \texttt{_Complex _Float16} & \reg{xmm0} \\ > + & & The real part is returned in bits 0..15. The imaginary part is > + returned \\ > + & & in bits 16..31.\\ > \cline{2-3} > Complex & \texttt{_Complex float} & \EDX:\EAX \\ > floating- & & The real part is returned in \EAX. The imaginary part is > > > https://gitlab.com/x86-psABIs/i386-ABI/-/wikis/uploads/89eb3e52c7e5eadd58f7597508e13f34/intel386-psABI-2021-08-25.pdf Looks good to me, thanks. John.