220 40408 <04fe952f-e38b-4982-b5cc-3b5002261d50@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Niall Douglas <nialldouglas14@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: 128 bit integers
Date: Tue, 9 Oct 2018 01:51:02 -0700 (PDT)
Lines: 121
Approved: news@gmane.org
Message-ID: <04fe952f-e38b-4982-b5cc-3b5002261d50@isocpp.org>
References: <4111d349-b11d-45a4-aa06-d871d8efb20e@isocpp.org>
 <b6c21320-0aa7-4b3f-9572-71946338979c@isocpp.org> <c979210f-264b-4148-b966-f2313f38002a@isocpp.org>
 <618c6701-abd5-4caa-8917-c1a15a5840d5@isocpp.org> <869310a4-67f1-4594-8157-e33ae7d7e0f3@isocpp.org>
 <CABPJVnT=t-PL4BRU4viPp5Es63JZ=2AO52Cmc1AWBv5QyYd0RQ@mail.gmail.com> <b5d854b4-c24e-4a3f-8fcc-3c793527b791@isocpp.org>
 <CABPJVnSQWm52fKDQQuH1B3skP3O2tO_5N2gtfJYpZ_P3bMMseQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_892_1103273674.1539075063061"
X-Trace: blaine.gmane.org 1539074943 18668 195.159.176.226 (9 Oct 2018 08:49:03 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 9 Oct 2018 08:49:03 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDGKFT5YZADRB6GX6HOQKGQEIU75CDY@isocpp.org Tue Oct 09 10:48:59 2018
Return-path: <std-proposals+bncBDGKFT5YZADRB6GX6HOQKGQEIU75CDY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb1-f200.google.com ([209.85.219.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDGKFT5YZADRB6GX6HOQKGQEIU75CDY@isocpp.org>)
	id 1g9nhG-0004c2-NP
	for gclcip-std-proposals@m.gmane.org; Tue, 09 Oct 2018 10:48:54 +0200
Original-Received: by mail-yb1-f200.google.com with SMTP id z8-v6sf217923ybo.17
        for <gclcip-std-proposals@m.gmane.org>; Tue, 09 Oct 2018 01:51:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=q5pwHFTF7gV0vt2PmY+zamQxMln1UxelmWg9/FVGnpE=;
        b=NjbJeLiX1ZR0rvZCu3mab+e+tNKXSyR+VmnQAwP5ct/RPB5W4dlyiKqovYBa1UME0Y
         TIxDMvOAHdDNEvHC1vmwH/edIg5VR2+mELKwi14p/tKghkFU0Yido7kKrB+LU3Ys0jBn
         MHT/ox4Nal4WVGwsaJjfVaZZ3t+1ZbEkfu4H8k7YbxjJ0tyhYc0bFUV8qpm7bw0d2kHh
         9owwaY4OO+0OP3nggerx7beWUnBo4oglT2vTYNG5PWrBHacBxwuCDoMajlflxxtnj0R+
         /T3rBEiVQCdpdAHtUSusX7+oqNrKVs1UCNCzcAdhLB0C230M2z6mJ8BfYcLzvaSl43KS
         sFsA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=q5pwHFTF7gV0vt2PmY+zamQxMln1UxelmWg9/FVGnpE=;
        b=AMjvITcGb8WmoY+Rw4AKDgSbJhQKxVNc1zEHSvcPHmFPHD2qRPBqNZnP75O3uY7sB1
         p9CO3GwUcKUUgxmx3LxfmIUw1F7oniJbC9Us0iW43InBB8QOw/Wmphg4W3/I4gGOc1n6
         LmiVfoW9myJfZ1reRX05rp/8seiAum6LVZXPDVYsNuZDvAxEJSak0V5LRjxxUT1++pPt
         HSF52oR2Jp9qazMs4Vxav5iI2AlD56Tw5/T7VHbfk5FKTycUKzNgmpG0YYuGRgQfw01d
         mftMMuhS1zFmawFe/5MCY8MQgcPXQE+aD7rjMnJW4XVcRB9/fY3TQFdQTd6sQ+HWdLE1
         0jrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=q5pwHFTF7gV0vt2PmY+zamQxMln1UxelmWg9/FVGnpE=;
        b=CfR3TtZf4eN91VuvYTmELjpj1c3Lh8YsrhR9QPo90KukHbbgowkTmegWw7ns1kV0Od
         q22iPJy2MC4S/87cRPcYAex1tQYmKgQQqNHLgIBxRSv7KgwxBEqtdjZrN+hWRyZbd0Tz
         5iUS+JFnGeoc0OrXY+SL0HeruLFFeSMw4Ob5EO2PXcsS6ZHedAzQ9L9Eoth5eRe/xeSk
         aHkBRKpe7ki0xmeWjUaeVoJxrJ4sDrNeAY+wD5Gt0NjaxNII9sKkocORWWJiM1l9G2xj
         T57S3+HOiJFbHzjzs4CtRgSzeCoK6BbqeTcNuUJ364XNvPJk86J4YPeaTMh4yh4oRdbB
         JFNA==
X-Gm-Message-State: ABuFfojEQVk5foMRFiFRN3HvPtfly+ppHtleNXl3aJwU3tKLCb3ZiZs8
	eO4FEuhQ04W57n/KkO08nWwMyQ==
X-Google-Smtp-Source: ACcGV61zDcC+k/lIoMw2mZzTrKDyiogT63txXwqkDhFEH6/3voBiY4hK85tD1HtguQnCI0MA0bD1vw==
X-Received: by 2002:a25:495:: with SMTP id 143-v6mr13431125ybe.44.1539075064939;
        Tue, 09 Oct 2018 01:51:04 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:9b82:: with SMTP id v2-v6ls720640ybo.6.gmail; Tue, 09
 Oct 2018 01:51:04 -0700 (PDT)
X-Received: by 2002:a25:50c7:: with SMTP id e190-v6mr325089ybb.1.1539075063800;
        Tue, 09 Oct 2018 01:51:03 -0700 (PDT)
In-Reply-To: <CABPJVnSQWm52fKDQQuH1B3skP3O2tO_5N2gtfJYpZ_P3bMMseQ@mail.gmail.com>
X-Original-Sender: nialldouglas14@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:40408
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40408>

------=_Part_892_1103273674.1539075063061
Content-Type: multipart/alternative; 
	boundary="----=_Part_893_1896959956.1539075063061"

------=_Part_893_1896959956.1539075063061
Content-Type: text/plain; charset="UTF-8"


>
> I'm not sure why you think that implementers are restricted to supplying 
> pure-library solutions or why using something like the free functions in 
> P0103 would not solve this. Do you go into any more detail about the 
> reasons you don't think a library solution is practical for C++?
>

I do go into more detail, but the crux of it is that to get efficient 
codegen, you're going to either have to (a) hint to the compiler using 
intrinsics what you're doing or (b) have the compiler special case how it 
interprets wide_integer<>. I would argue in that case, just bite the bullet 
and add it to the core C language.
 

> That would seem to imply they have 4 sign bits but presumably they don't, 
>> right?
>>
>
They do not.
 

>
>> 5. My current feeling is that these wide arithmetic types should have the 
>> alignment of their integral type but doubled as necessary. This enables 
>> them to "stand in" for types hardware available on bigger CPUs. It also 
>> enables SIMD vectorisation by optimisers - AVX-512 CPUs can do 8x 128-bit 
>> integer adds four times faster than with the scalar instructions for 
>> example.
>>
>
> Are you only aiming for powers of two? That's another way in which this 
> would differ from P0539.
>
> There are many more C compiler implementations than C++ compilers. WG14 
feels it is important that a C compiler can be easily implemented by a 
single person in a reasonable period of time. Using powers of two covers 
the majority use case at minimum implementation expense, indeed such 
implementation for arbitrary fixed length extended precision integers could 
be done within a day or two.

Niall

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04fe952f-e38b-4982-b5cc-3b5002261d50%40isocpp.org.

------=_Part_893_1896959956.1539075063061
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div class=3D"gmail_quote"><div>I&#39;m not sure why you think that imp=
lementers are restricted to supplying pure-library solutions or why using s=
omething like the free functions in P0103 would not solve this. Do you go i=
nto any more detail about the reasons you don&#39;t think a library solutio=
n is practical for C++?<br></div></div></div></blockquote><div><br></div><d=
iv>I do go into more detail, but the crux of it is that to get efficient co=
degen, you&#39;re going to either have to (a) hint to the compiler using in=
trinsics what you&#39;re doing or (b) have the compiler special case how it=
 interprets wide_integer&lt;&gt;. I would argue in that case, just bite the=
 bullet and add it to the core C language.</div><div>=C2=A0</div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div class=3D"gmail_quo=
te"><div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>That wo=
uld seem to imply they have 4 sign bits but presumably they don&#39;t, righ=
t?<br></div></div></blockquote></div></div></blockquote><div><br></div><div=
>They do not.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr"><div></div></div></blockquote><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr"><div><div><br></div><div>5. My current feeling is=
 that these wide arithmetic types should have
the alignment of their integral type but doubled as necessary. This
enables them to &quot;stand in&quot; for types hardware available on bigger=
 CPUs.
It also enables SIMD vectorisation by optimisers - AVX-512 CPUs can do
8x 128-bit integer adds four times faster than with the scalar
instructions for example.</div></div></div></blockquote><div><br></div><div=
>Are you only aiming for powers of two? That&#39;s another way in which thi=
s would differ from P0539.<br></div><br></div></div></blockquote><div>There=
 are many more C compiler implementations than C++ compilers. WG14 feels it=
 is important that a C compiler can be easily implemented by a single perso=
n in a reasonable period of time. Using powers of two covers the majority u=
se case at minimum implementation expense, indeed such implementation for a=
rbitrary fixed length extended precision integers could be done within a da=
y or two.</div><div><br></div><div>Niall</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/04fe952f-e38b-4982-b5cc-3b5002261d50%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/04fe952f-e38b-4982-b5cc-3b5002261d50=
%40isocpp.org</a>.<br />

------=_Part_893_1896959956.1539075063061--

------=_Part_892_1103273674.1539075063061--

.
