Re: Optimization techniques

Hans Aberg <haberg-news@telia.com>
Sat, 27 Apr 2019 23:01:10 +0200

          From comp.compilers

Related articles
[21 earlier articles]
Re: Optimization techniques alexfrunews@gmail.com (2019-04-26)
Re: Optimization techniques derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2019-04-26)
Re: Optimization techniques martin@gkc.org.uk (Martin Ward) (2019-04-26)
Re: Optimization techniques martin@gkc.org.uk (Martin Ward) (2019-04-26)
Re: Optimization techniques 847-115-0292@kylheku.com (Kaz Kylheku) (2019-04-26)
Re: Optimization techniques 0xe2.0x9a.0x9b@gmail.com (2019-04-27)
Re: Optimization techniques haberg-news@telia.com (Hans Aberg) (2019-04-27)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-28)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-28)
Re: Optimization techniques, C++ numeric representations david.brown@hesbynett.no (David Brown) (2019-04-29)
Re: Optimization techniques, C++ numeric representations haberg-news@telia.com (Hans Aberg) (2019-04-30)
Re: Optimization techniques genew@telus.net (Gene Wirchenko) (2019-04-30)
Re: Optimization techniques genew@telus.net (Gene Wirchenko) (2019-04-30)
[8 later articles]
| List of all articles for this month |

From: Hans Aberg <haberg-news@telia.com>
Newsgroups: comp.compilers
Date: Sat, 27 Apr 2019 23:01:10 +0200
Organization: A noiseless patient Spider
References: <72d208c9-169f-155c-5e73-9ca74f78e390@gkc.org.uk> 19-04-020
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="6232"; mail-complaints-to="abuse@iecc.com"
Keywords: C, C++, arithmetic, comment
Posted-Date: 27 Apr 2019 17:13:19 EDT
Content-Language: en-US

On 2019-04-25 17:46, Martin Ward wrote:
> If signed overflow was given a defined
> behaviour (such as the two's complement result), then compilers for
> CPUs which do not implement two's complement operations would have to
> generate less efficient code (but does anyone still make such a CPU?).


All C++ compilers use two's complement, and as of C++20, that is
required, cf. [1], "Range of values". It is required for int32_t etc in
C++11 [2] and C99 [3].


1. https://en.cppreference.com/w/cpp/language/types
2. https://en.cppreference.com/w/cpp/types/integer
3. https://en.cppreference.com/w/c/types/integer
[I realize that if you look very hard, you can still find a few legacy
machines that are not pure two's complement and do not have 8-bit byte
addressing. But these days, so what. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.