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=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HK_RANDOM_REPLYTO, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,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 400231F8C6 for ; Wed, 25 Aug 2021 20:33:36 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 75CF6385803D for ; Wed, 25 Aug 2021 20:33:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75CF6385803D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629923614; bh=wUwrA/rlS+Y6+1Ajoj3EWk2RQLPH2m0wQxxjxFPpSSs=; 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=I70khmEl3c5qpUuJLyxawEojZbyS3b92v6a737yfsV8KPY/bmGtKVfj3KMMZekvir AzwrYgpuW8elQJsMR345I9qpcOeHoud7Fb9Llx0TGO6np9aInfBy4End5VuH484Fmf ChcgBHdscXQ2YQ9w2Mmnwu2EBnBuvDdkboOX97h4= Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 0897E3858400 for ; Wed, 25 Aug 2021 20:33:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0897E3858400 Received: by mail-ej1-x636.google.com with SMTP id me10so1012258ejb.11 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=KwVn1TGLNTPzwDA1zzylWJxkYMQsLHvIWpT9pttbZ7X/kVaAGtVJXdeNpOFXAwLwxI JU9niUU6ZAgSz0q+rNZvdp3o8o6rfCw786wYfhpliM3/y59sI/Qjamp9VVPcksHugiAc Ar+txNEtryOOJEKnK6iM3NBBZTzx+nlC1pjGnNV51gHoLMUfN9eIsUrCbBxRK4mY7IdT FUSOoMISYs5VdU8Cs9fJac55E6AOsSdQ9vRMyU7+SWnDxkp4smdSeBMLn8V+QeaV7BuT UxBk+eoIh5+V3msZoOEqqvZneVYnExHUP99w2rXs6OxFb0dsfL7Urc9fXpC/ao3XnKCG t+kw== X-Gm-Message-State: AOAM531rpKvp1sckkmpksChg6/y+AoVQhcDtO6SGQsPB8fVujtiIsVBb Ki5x1a694aA0BvTYnIwk8U0mv9qHOYPj1q+G6Xs= 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: 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: John McCall via Libc-alpha Reply-To: John McCall Cc: "Wang, Pengfei" , LLVM Dev , GNU C Library , GCC Patches Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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.