From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id A8E783858006 for ; Wed, 25 Aug 2021 12:36:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A8E783858006 Received: by mail-pl1-x632.google.com with SMTP id w6so14241689plg.9 for ; Wed, 25 Aug 2021 05:36:20 -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=kFRgW7O9UidDXeY0FN2CpIqA4jfQwd0651D/JWqOfDE=; b=LLMTUqBRY1xvxDpMiwCcv/TrZe/AbKS43hSxQZ+HmoD7d/TwvTZMCkb2a49XmTYIeg NppNnxnWJMv2adA1xAHKt9mH1vBJvrx1nI2FDejV+USLUzQzo7g2lxZP+3oZWlKN028E DVnQ2TPv57+0C6vzocUPsg3TqBzxZusj7d88za8zn4u9JFyHOyq/PxtUkok+wRd2kbnJ gMIAQfJeBHIRdd4EyZzw/tUVrIYnaiz1E4SafGqjMemBfHaUQUPHfYKwwgUBsDh7DgpC ZRQQFjye9lGPcXv1jSe13mQt7hOpi54juV6/ds38C47JL8b9za59A7x2yciDmexhRvUN lRCQ== X-Gm-Message-State: AOAM532E+2BDjfGllXt8xcYjdNTe5wpWqNjZcYp+nPDGbeduxMuiXGLy viHSTLrJ6Vblhw+paOXFVYi1jymnYH0uSSRHTP8= X-Google-Smtp-Source: ABdhPJzuNwoKmwAAliq1rsN5Gm0W6pdYKN+MSoYCEUxM2jr73u+D9xGVWMCPK3MBVj3bjLh5vknS2yPEi/p8IcgC8mo= X-Received: by 2002:a17:902:d3d2:b0:133:aef2:8bc4 with SMTP id w18-20020a170902d3d200b00133aef28bc4mr15843643plb.79.1629894979663; Wed, 25 Aug 2021 05:36:19 -0700 (PDT) MIME-Version: 1.0 References: <20210701210537.51272-1-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 25 Aug 2021 05:35:43 -0700 Message-ID: Subject: Re: [llvm-dev] [PATCH] Add optional _Float16 support To: IA32 System V Application Binary Interface Cc: "Wang, Pengfei" , LLVM Dev , GCC Patches , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3029.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 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 12:36:31 -0000 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 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. > > John. 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 -- H.J.