From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E37BC1F8C6 for ; Wed, 25 Aug 2021 12:37:12 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A536385843F for ; Wed, 25 Aug 2021 12:37:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A536385843F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629895030; bh=kFRgW7O9UidDXeY0FN2CpIqA4jfQwd0651D/JWqOfDE=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=yJKGiWVeOn0YL2zc7Y/IG9B98d3np4OepAXiuOdUxo0KJVJefH/I8REqdl1CU+MKw keKjq3N7yZ6lIqhirtkEdIKr8yZWjDFCxFciwpyvHoC6For+kWEOEN5HPPOJ6KY3Fq 1vzqG5uXCs40kttkiGBxhInkgXbFx8ldcvBRH5RY= Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 918253858426 for ; Wed, 25 Aug 2021 12:36:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 918253858426 Received: by mail-pl1-x629.google.com with SMTP id q3so2415177plx.4 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=YHmoMv7QF4N6Xyxbm0SBTfoyNfwS6aGTHcAJKYLJgXpKFUlP6SNrXirCBJeDzXeXBW Ok8IG4TyBVCr488Rwc7JbPziZ8jn8f5PtbkWAXjrwBp3SB8gw36jE0i0IFu/OkbZNyfk GsX+Sgjz4pE5DZ+IxOArKGht/7r9mbRGgbRjNSFIWro6+1Ppt/7iKyHunRMaU5zXu3GP kbnd1BFaJdCB30izCXd89qtCmjkvUx63h7gFgX5zPhLMtjZhVHfKc5zAGyfCABn0FtrP KdZp4oagurTdQ0bBqH3/lOj9sxhXpDiVV+2CNgxc87o6zgpdSf71kpqxPr3rFKiC6jJZ dgaA== X-Gm-Message-State: AOAM530Y2pAxmEXKoPKEYL9dPsR+HvSIvuT1cupDuTRv5hHqFPr1Lvbu 7pyx8yW2/N8J5JW/hSF15R9qK6V7Mrw1W7+wQzU= 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: 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 Content-Type: text/plain; charset="UTF-8" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Cc: "Wang, Pengfei" , LLVM Dev , GNU C Library , GCC Patches Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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.