From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: IA32 System V Application Binary Interface <ia32-abi@googlegroups.com>
Cc: "Wang, Pengfei" <pengfei.wang@intel.com>,
LLVM Dev <llvm-dev@lists.llvm.org>,
GNU C Library <libc-alpha@sourceware.org>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [llvm-dev] [PATCH] Add optional _Float16 support
Date: Wed, 25 Aug 2021 05:35:43 -0700 [thread overview]
Message-ID: <CAMe9rOqBO2MPfHiC6Uw2MpECo5PmtWyF=_zaeSAa7hOE3Yxasw@mail.gmail.com> (raw)
In-Reply-To: <CAOq2Nw=GKywwNS8vLYt09x4E5Ls1hwa-jBCaawVx38i=hLeC8Q@mail.gmail.com>
On Mon, Aug 23, 2021 at 10:55 PM John McCall <rjmccall@gmail.com> wrote:
>
> On Thu, Jul 29, 2021 at 9:40 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> On Tue, Jul 13, 2021 at 9:24 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>> >
>> > On Tue, Jul 13, 2021 at 8:41 AM Joseph Myers <joseph@codesourcery.com> 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.
>
> 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.
next prev parent reply other threads:[~2021-08-25 12:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 21:05 [PATCH] Add optional _Float16 support H.J. Lu via Libc-alpha
2021-07-01 22:10 ` Joseph Myers
2021-07-01 22:27 ` H.J. Lu via Libc-alpha
2021-07-01 22:40 ` Joseph Myers
2021-07-01 23:01 ` H.J. Lu via Libc-alpha
2021-07-01 23:05 ` [llvm-dev] " Craig Topper via Libc-alpha
2021-07-01 23:33 ` Jacob Lifshay via Libc-alpha
2021-07-02 7:45 ` Richard Biener via Libc-alpha
2021-07-02 8:03 ` Hongtao Liu via Libc-alpha
2021-07-02 9:21 ` Jakub Jelinek via Libc-alpha
2021-07-13 3:59 ` Wang, Pengfei via Libc-alpha
2021-07-13 14:26 ` H.J. Lu via Libc-alpha
2021-07-13 14:48 ` Wang, Pengfei via Libc-alpha
2021-07-13 15:04 ` H.J. Lu via Libc-alpha
2021-07-13 15:41 ` Joseph Myers
2021-07-13 16:24 ` H.J. Lu via Libc-alpha
2021-07-29 13:39 ` H.J. Lu via Libc-alpha
2021-08-24 5:55 ` John McCall via Libc-alpha
2021-08-25 12:35 ` H.J. Lu via Libc-alpha [this message]
2021-08-25 20:32 ` John McCall via Libc-alpha
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-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMe9rOqBO2MPfHiC6Uw2MpECo5PmtWyF=_zaeSAa7hOE3Yxasw@mail.gmail.com' \
--to=libc-alpha@sourceware.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
--cc=ia32-abi@googlegroups.com \
--cc=llvm-dev@lists.llvm.org \
--cc=pengfei.wang@intel.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).