220 39378 <1957969.uOyN2Jk7ag@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Alternative proposal for mapping P0709
 Deterministic Exceptions into C
Date: Tue, 24 Jul 2018 12:27:57 -0700
Lines: 46
Approved: news@gmane.org
Message-ID: <1957969.uOyN2Jk7ag@tjmaciei-mobl1>
References: <6a65c934-5d2a-4e75-b88d-9eaaee338bd3@isocpp.org> <4e6835ac-6975-4c89-81c4-fc038d004cb7@isocpp.org> <pj78nm$loi$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1532460358 12120 195.159.176.226 (24 Jul 2018 19:25:58 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 24 Jul 2018 19:25:58 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBQX33XNAKGQE4FG5S6Q@isocpp.org Tue Jul 24 21:25:54 2018
Return-path: <std-proposals+bncBCB4TK757YBRBQX33XNAKGQE4FG5S6Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f197.google.com ([209.85.216.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBQX33XNAKGQE4FG5S6Q@isocpp.org>)
	id 1fi2wS-000319-L3
	for gclcip-std-proposals@m.gmane.org; Tue, 24 Jul 2018 21:25:52 +0200
Original-Received: by mail-qt0-f197.google.com with SMTP id o18-v6sf3986852qtm.11
        for <gclcip-std-proposals@m.gmane.org>; Tue, 24 Jul 2018 12:28:03 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1532460483; cv=pass;
        d=google.com; s=arc-20160816;
        b=UuRFIjVX37dpshU6MJb3CcDVng1QBxPlZpVlsMkU/JdRmL7pTqJLCJQwFwpwqzlmdR
         e8slpIW+90h+UbTYQD9Aujp4CMU7WcehQ3+16D6frNgifPePI1m75mOv0XtfEUcBbKCy
         ikTstfVTuQtcLJQCuuUFpfQVhoe/bXcwbvi9WvBrX7B3mOtvkSK6e+uFoPWph2aE41/T
         URQV0P42217aD+ySEh5Z826LifNLXsZe6d7bs9lklnfAVZCvmguIsSSG1vcVTUj3QfTf
         mMb6WNFs7tvZrOPdBR0SiLJcBxm9MQOr0LsUj+M13hDqcmLsIZLOnN26lo16vJ8DizmC
         fdtA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=UU9Fhv1yDAkPh/AN86mqhBf2VsINNRDmnoESLYJ3c4Q=;
        b=yN4thOGB9G6mWmB9HX53fbRWtfk9sqiFyr2ff19IcPjTwT0xNezHpnrY7bHdcfFe97
         ZeIsol/9nQksELpRPTTWeS/1ZNvO9RZYyN40IG5krJ9kGgVfcY3imhQq059bFjFMd2pC
         qD5Nd/Jh4J52wY0q/XWP+o/nrrzOAjcZ3NC9telubKF0O/zDbDLZqVX8w3bwnixqbEWm
         q1q6b4hQzD0hM3+w+Ky0UHzqE94TxfDv1bxcSVo8SOvt5AD8Tlb03E3Smh+v9bc6YmHu
         j8XPKyITm3YgTNvI5nK0U5jKpje7wVU2BLWeTuH4HUDOqqioRox/S024xEuPlVOUFtdN
         Oe9w==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=UU9Fhv1yDAkPh/AN86mqhBf2VsINNRDmnoESLYJ3c4Q=;
        b=a5BwwBIq3OgQ4wbcEuRIJIL95+X6pdq1GgdlWElyw7cNi1dM8C/sMC4gIajiwyxV0c
         oMr5x5Af4XdjVlMEIlQzGzNVRYGui37WUPmg7prO8bnYRaPd5evqq1E7OvqkiGykExqp
         xvU5qygsTYfm5OlLKT0OJn0IMRsmJ71UM4rOkQIj+qt8mW/gYddj1+4Y5XY5q5KbFsM8
         KAOZozFBwKoX6fHENzvIqtXK02tem5OTF6HKZwkOrKNqLoInyChdnJYfmP8mVRkJQQe1
         b8en4ziHOwKGq8p1QpUpf4CCdhE/9z0vENhWP9Qrv2oGjT1y7EaNxHNJnXuzEXxGVaGK
         krCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=UU9Fhv1yDAkPh/AN86mqhBf2VsINNRDmnoESLYJ3c4Q=;
        b=FKFCXR5gh0aWxJTv+f889In0p+zWi/i1am8IxpS5HqsWDuot9QyzPi2TltoZG3Bq03
         M4iHPeBImKQDq+vB0zDXTPkQwmFv8LcMzBmLLN8qgcpcscXkRltEbaAy+TO7Tf4GgtMS
         8Orou3+Yiwy6iQjUESqWTY2Lxaqz9DKB2Qs+8Ah/I6cosJSxrKkqpVR3F3T9y+n296AK
         9/Mln9ZhQsrcr2ZLC9crWG/FEILwuiXgrbpn+SeP8jlWxstNjhv7v4uDlWxwU+RbfCB+
         Kw9KN0q0dMfuvQZQRN0+wsfgsyzbPb3/lP41i0d/AUBH39+GTJQ2pJtg9Ar5f3xJJBAV
         xWlQ==
X-Gm-Message-State: AOUpUlFzkprvBsrCRZuyMxoZJ6o0Oa15dG5E0le5eXQ9EU8WXlEfiuZu
	eSziQBfgUYFuIUcnzg9EbWLJ6A==
X-Google-Smtp-Source: AAOMgpeFeF+BI6a9mjQAQb89nKsccvLOLuhRFkUFEqHsc8ok+fF7IFxELtmXSaiyaIpDU64ms/yQBQ==
X-Received: by 2002:a37:9a4c:: with SMTP id c73-v6mr10764165qke.33.1532460483316;
        Tue, 24 Jul 2018 12:28:03 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:ac8:7284:: with SMTP id v4-v6ls1321037qto.6.gmail; Tue, 24
 Jul 2018 12:28:02 -0700 (PDT)
X-Received: by 2002:ac8:12c8:: with SMTP id b8-v6mr17685357qtj.372.1532460482408;
        Tue, 24 Jul 2018 12:28:02 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1532460482; cv=none;
        d=google.com; s=arc-20160816;
        b=yOZmITf1pLqSgfAHpKjQ8B6mKsoTOlBRjzxf3FwzlzBzNpJhhgAIGGkz6N7u7r+8GD
         uD3QUalitBgEZYZS8vXaTtNQlgGWNON+M0vM0hs+AZuKLSE+N0HX64IOVH9UP5BNE8Dp
         zeurPV1iLOdDdbTLUH6bTvUSpyb3Zo3/l6P6CuUnCPwGJO7UEhjslUJu2HrlLuMBng57
         RDQV7emjvpe9ng412uBAWkLp3aUKs5eOKJhznpzQRtIeKJgqtkg9Jdzn0oW2XIXcoEJz
         BuBb2RNBReyyWzfKwDinwLsU4YUXvoSmpPS2UHh+vcAGkwGB6F2gH33whpCLLeSEoAgI
         1OIg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=7+OpAdy8V4fdEhhUP343OspUi2kDOoPP+Z3bQKUYOPQ=;
        b=UIhmUUnT9vCcdy/CxPGu3pX393uDtZxzNzr88GSD0Fx4BxR80ilcHC8Y7KgkffGnhM
         rXybrwIf31L1Czn7x9hv+r/X3EraNYAYO8V1TF+2bFxziS3o4pIhey3fAx1t6gWz3Nn9
         vIqazohIzcfB1ETpNkXOc+zOYGGEdgg9WtUeu2epxC7Y5aa7sAMPDcO/YRWVTI/EEyYl
         5R8FcYdmk27qhdThn1zKtPEH1IlNaGd2vW+9dUsggul6SOAvqsbGftwUZ+/W/8y59CH3
         ICZ3ierUXmroO7b66Nbll6mqz4GGudqdwpqVqg7phAigdB9b5U+9HPILjR67L/2D33Oa
         GEoQ==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from smtp.macieira.info (smtp.macieira.info. [2001:19f0:5:2221::1:3])
        by mx.google.com with ESMTPS id w43-v6si2957427qvj.262.2018.07.24.12.28.02
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 24 Jul 2018 12:28:02 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) client-ip=2001:19f0:5:2221::1:3;
Original-Received: from tjmaciei-mobl1.localnet (jfdmzpr04-ext.jf.intel.com [134.134.139.73])
	by smtp.macieira.info (Postfix) with ESMTPSA id AFB32143E7
	for <std-proposals@isocpp.org>; Tue, 24 Jul 2018 12:28:00 -0700 (PDT)
In-Reply-To: <pj78nm$loi$1@blaine.gmane.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted
 sender) smtp.mailfrom=thiago@macieira.org
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:39378
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39378>

On Tuesday, 24 July 2018 06:16:42 PDT David Brown wrote:
> I am reluctant to be so confident about the effects here - I really
> don't think you can generalise and say these stalls will never occur.  I
> think it will depend a lot on the cpu ISA, the details of its
> implementation (scheduling, out-of-order execution, register renaming,
> pipelining, speculative execution, etc.), and the type of code you are
> dealing with.  On many cpus, there are quite a lot of instructions that
> use or affect the carry flag (or any other flags) - these pose a
> challenge for scheduling.  They also pose a challenge for the compiler,
> if it would want to use such instructions between the call to "foo" and
> the check for "foo.error".
> 
> It may be fair to say that using the carry flag here would not cause
> much in the way of stalling or delays - but I would not say "never"
> without a lot more thorough analysis with a range of different processors.

That's entirely QoI. If the compiler that targets this particular system where 
setting or testing a particular flag is slow, the compiler can simply choose 
another way of returning the information.

Let's take another example of a CPU without flags: IA-64. Instead of having 
flags, the CPU has 1-bit predicate registers, which are set or unset depending 
on the comparison operation that was performed. So IA-64 could then use one of 
the scratch predicate registers as an extra return value. There are 10 of 
them.

Another example is MIPS: it has no carry flag and no predicate register. In 
that case, it would need to use an extra register (currently used for scratch) 
with either a zero or non-zero value, which would allow the caller to use the 
BNEZ instruction to jump to the failure path. Fortunately, MIPS has plenty of 
registers, so it can do that.

This is up to the ABI documents for each platform to determine.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



-- 
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/1957969.uOyN2Jk7ag%40tjmaciei-mobl1.

.
