[OT] The Usual Arithmetic Confusions

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jan 31 16:42:32 UTC 2022


On Monday, 31 January 2022 at 16:09:33 UTC, Ola Fosheim Grøstad 
wrote:
> On Monday, 31 January 2022 at 11:00:26 UTC, Elronnd wrote:
>> Please show me a case where it matters.  I already asked for 
>> this: show me a case where a large-scale c or c++ application 
>> performs appreciably better because signed overflow is UB.  It 
>> is easy to test this: simply tell gcc or clang -fwrapv and 
>> they will stop treating overflow as UB.
>
> I've already answered this. You can say this about most 
> individual optimizations. That does not mean that they don't 
> have an impact when you didn't get them.

That sentence came out wrong.

What I meant is that missing an optimization is impactfull where 
it matters. In this case I pointed out that this is most 
impactfull in inner loops, but that current C/C++ codebases tend 
not to use high level programming in performance sensitive 
functions.

Meaning: the whole argument you are presenting is pointless. You 
will obviously not find conditionals that are always true/false 
in handt-tuned inner loops.

The crux is this: people don't want to hand tune inner loops if 
they can avoid it!



More information about the Digitalmars-d mailing list