New C++ papers available
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/2018-02-pre-Jacksonville.htm …
What'll make it to C+20? 
-
Show this thread
-
I'm especially looking forward to "Signed Integers are Two’s Complement" for C++20. I know it'll be controversial
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r0.html …pic.twitter.com/pJSwUTStyk
17 replies 43 retweets 124 likesShow this thread -
While we're at it, should C++ also specify:
10 replies 1 retweet 18 likesShow this thread -
I just presented “signed integers are two’s complement” http://wg21.link/p0907r0 to a joint session of C++ numerics and undefined behavior groups! Broad support, but they want to keep UB on overflow (and have separate type or operator for wrap). I’ll update the paper
10 replies 9 retweets 44 likesShow this thread -
Replying to @jfbastien
What's the reasoning behind wanting to keep UB on overflow? Better optimization?
1 reply 0 retweets 1 like -
Replying to @AndresFreundTec
Multiple. Look for details in the updated paper.
1 reply 0 retweets 2 likes -
Replying to @jfbastien @AndresFreundTec
Looking forward for the updated paper... can't think on one reason to keep UB and not assume two's complement everywhere. If someone really needs a different behavior, why not create a different type for *that*? (like a `weird_int`)
3 replies 0 retweets 0 likes -
There are three main reasons imo: optimization, optimization, and optimization. ;) Overflow UB allows compilers to use larger integer registers with simpler code. Quite common for eg 32 bit arithmetic on x86_64.
2 replies 0 retweets 1 like -
Does the optimization really pay for the error-proneness in this case? Unsigned overflow is already well-defined, so it's inconsistent to have UB for signed. There are a lot of intentional overflow out there, waiting to be broken because of these UB-dependent optimizations.
1 reply 0 retweets 0 likes -
That's why you should use unsigned integers when you need wrap around overflow behavior. Is the better performance worth the complications? Idk.. depends on what you are doing. But I have seen 10-20% improvements in performance critical code just from changing uint to int.
1 reply 0 retweets 1 like
To be fair, you get the same performance improvement from changing a uint smaller than the machine regs to the machine reg size in the right spots. But then your C code isn't as portable anymore and usually you don't find the right spots without reading the compilers asm output.
-
-
Performance isn’t a static value which never changes. Here we have to ask: is the better performance a fundamental property of particular hardware and semantics? Can we reach parity, and if not why? The answer in this context is quite complex.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.