220 39311 <5a247f18-6cf7-4b92-8572-877c6ffc8da4@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Russell Johnston <rpjohnst@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Alternative proposal for mapping P0709
 Deterministic Exceptions into C
Date: Mon, 23 Jul 2018 10:34:04 -0700 (PDT)
Lines: 74
Approved: news@gmane.org
Message-ID: <5a247f18-6cf7-4b92-8572-877c6ffc8da4@isocpp.org>
References: <6a65c934-5d2a-4e75-b88d-9eaaee338bd3@isocpp.org>
 <87240a3d-623f-4f7f-8e7c-fa8c9482fa72@isocpp.org>
 <5a449c86-b0f4-4b07-b5d6-21b7adbfd63b@isocpp.org>
 <c3b7a4c0-b76a-4b23-817c-abd445c270c1@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_8239_978675479.1532367244429"
X-Trace: blaine.gmane.org 1532367120 5556 195.159.176.226 (23 Jul 2018 17:32:00 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 23 Jul 2018 17:32:00 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCFPHMELQABRBDND3DNAKGQESBPZHJI@isocpp.org Mon Jul 23 19:31:56 2018
Return-path: <std-proposals+bncBCFPHMELQABRBDND3DNAKGQESBPZHJI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f200.google.com ([209.85.161.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCFPHMELQABRBDND3DNAKGQESBPZHJI@isocpp.org>)
	id 1fhegd-0001LP-FO
	for gclcip-std-proposals@m.gmane.org; Mon, 23 Jul 2018 19:31:55 +0200
Original-Received: by mail-yw0-f200.google.com with SMTP id 2-v6sf654685ywn.13
        for <gclcip-std-proposals@m.gmane.org>; Mon, 23 Jul 2018 10:34:06 -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=wGxIz2XJXyYSWILRq4hBziCwaDTzTM2XIi/MhO1li+s=;
        b=eX90G0X7ZfPUiRz+GP6o2G6UEgGEb+o2aZ9bUR61fhkiThJ8AjcGxa+9h4gY+7MToq
         p+aGNtQ0pS4vMvGiX77+4+vsa/vEpQjJfutgGjTwfwFqIVAY0BJ6FLchvM/sSAJmzLNH
         akynor3wXKbw7QuE59Te3Ya3JZj5LNN4HiUENe/P64LwxF1gf6LfeezfJqGvuxJaVpJp
         a1PgdF6hD5NjasL8RyBrsPPWUzyeWsYfkLrvkrqndds00MB11Ds2ZuwCsX6W1Ye918ET
         2JRd5PXytD7XXE6ZYg3/0HvBwbEZopmtJTdmfA/0SUpFdmqXQleR0OgmDzvVTmGCMaxg
         FNfw==
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=wGxIz2XJXyYSWILRq4hBziCwaDTzTM2XIi/MhO1li+s=;
        b=qs8eLYeNVdNLoWIQK5ierFqmhCSH4IoircSN1YxDzRQAPFQJ6Y/qxyRgiHsnAktbkx
         kKS/x3uY+prvpXBS1cOWUc1JN+6a7j+I5o66R1j/jGZHWUsaBm+Ict/w4rFdKQGLj9gR
         98WoygwGKJwt/f+HT6+Tu6vTFpLObiNqffXyjMoTPvPULVi6a7rF9wBdD50Fj04z00D/
         TcR2rIZGnMHZhqi3AlVRjuCCm/9F97fQJQ1y+bfObneTDsU9V+YZKwEp10LLM/myfIUJ
         VWMZ0v401sED13leBZtIB/5oJuiliEVYn1sZK8jlmIGXoYXAxju4pHiV4nmmCbp02gJS
         7T9Q==
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=wGxIz2XJXyYSWILRq4hBziCwaDTzTM2XIi/MhO1li+s=;
        b=d2qcNBLzPMkSoLpxVyTTqHWdrm4hazR5S8YV/klw8HepGaFs9Xu6MBC8VxLPPgEmDN
         nu6CIBS3FCoOKXvIl0VkTbs0+CZQqBel0LTMlzXQurIQR3Umgv+VkA19wFPYoIs2GvLl
         f+PphVtRwTwqC2gM0nQ54V81Q4821YFdLw4Ee2dy1AAoScRp6MDT2ZnGnQTLBQ4dB7SQ
         cchk90/xHVZ41fVy/Kri4heBeewsnXo85mPtUEmejOf9ioUVqvumOX6HDhzbV4dF1isy
         53U9Vj0Ky1HUOo4WOg9rL4a5WWM9lFUd7tjiMtnPWILxNzbsMG3KMq1KKrP6sF7ZGiiB
         S0OA==
X-Gm-Message-State: AOUpUlE6ToYs12ZLNImSgfvlbRJ1CFEVtRS5FOE/VICq5JQ8VNNR3EM/
	TLgW4huQqxfvO1wjkfpMMnYWVQ==
X-Google-Smtp-Source: AAOMgpcHi4nwS2UxcDDe9sB57ZHKMpyXDPtJ5Pbnlc18GU0urBHimHrs5U2iTyDE1KbEuQZu3vVY4w==
X-Received: by 2002:a25:2e02:: with SMTP id u2-v6mr3963526ybu.55.1532367246042;
        Mon, 23 Jul 2018 10:34:06 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a0d:cc46:: with SMTP id o67-v6ls1099861ywd.8.gmail; Mon, 23
 Jul 2018 10:34:05 -0700 (PDT)
X-Received: by 2002:a81:78c6:: with SMTP id t189-v6mr265452ywc.7.1532367244930;
        Mon, 23 Jul 2018 10:34:04 -0700 (PDT)
In-Reply-To: <c3b7a4c0-b76a-4b23-817c-abd445c270c1@isocpp.org>
X-Original-Sender: rpjohnst@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:39311
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39311>

------=_Part_8239_978675479.1532367244429
Content-Type: multipart/alternative; 
	boundary="----=_Part_8240_53264138.1532367244429"

------=_Part_8240_53264138.1532367244429
Content-Type: text/plain; charset="UTF-8"



On Monday, July 23, 2018 at 10:30:13 AM UTC-7, Marcin Jaczewski wrote:

>
> On RISC-V then cost will be same to `bool foo(void* ret)`. This will be 
> still "zero overhead", simply for other architectures it will be "negative 
> overhead" compared to equivalent manual checks in code.
>
> Another way could be use RVO-like calling convention. Place for return 
> union with discriminant will be pass as one pointer to function, this 
> storage could even be reused by next function if it return same error type.
>

A third option is to match the behavior of other platforms, and store the 
discriminant in an extra register. There should already be plenty of 
caller-saved registers in the ABI, used primarily for passing arguments- 
their use could be extended to the return value's discriminant. This would 
also be "negative overhead" compared to passing a pointer.

-- 
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/5a247f18-6cf7-4b92-8572-877c6ffc8da4%40isocpp.org.

------=_Part_8240_53264138.1532367244429
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, July 23, 2018 at 10:30:13 AM UTC-7, Mar=
cin Jaczewski wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div d=
ir=3D"ltr"><div><br></div><div>On RISC-V then cost will be same to `bool fo=
o(void* ret)`. This will be still &quot;zero overhead&quot;, simply for oth=
er architectures it will be &quot;negative overhead&quot; compared to equiv=
alent manual checks in code.</div><div><br></div><div>Another way could be =
use RVO-like calling convention. Place for return union with discriminant w=
ill be pass as one pointer to function, this storage could even be reused b=
y next function if it return same error type.</div></div></blockquote><div>=
<br></div><div>A third option is to match the behavior of other platforms, =
and store the discriminant in an extra register. There should already be pl=
enty of caller-saved registers in the ABI, used primarily for passing argum=
ents- their use could be extended to the return value&#39;s discriminant. T=
his would also be &quot;negative overhead&quot; compared to passing a point=
er.<br></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/5a247f18-6cf7-4b92-8572-877c6ffc8da4%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5a247f18-6cf7-4b92-8572-877c6ffc8da4=
%40isocpp.org</a>.<br />

------=_Part_8240_53264138.1532367244429--

------=_Part_8239_978675479.1532367244429--

.
