On 22 May 2017 at 22:51, Johan Engelen via Digitalmars-d-announce <email@example.com> wrote: > On Monday, 22 May 2017 at 15:05:24 UTC, Andrei Alexandrescu wrote: >> >> http://dlang.org/blog/2017/05/22/introspection-introspection-everywhere/ >> -- Andrei > > > A fun read! > > "(Late at night, I double checked. Mozilla’s CheckedInt is just as bad as I > remembered. They do a division to test for multiplication overflow. Come on, > put a line of assembler in there! Portability is worth a price, just not any > price.)" > > Shocked: do you use assembly in Checked and cripple the optimizer?!?! > Luckily, no. But LDC and GDC do create the `seto` instruction I think you > were hinting at: > https://godbolt.org/g/0jUhgs >
So for LDC to be as good as GDC, you need to need to compile with -enable-ldc-amazing-feature-cross-module-inlining? > (LDC doesn't do as good as it could, > https://github.com/ldc-developers/ldc/issues/2131) > If you want a hint (though it's not my place to say), LLVM I'm told is a reasonably OK compiler, and any reasonably OK compiler should come with overflow intrinsics - try using them directly. (Turning off mild morning sarcasm). Iain.