Operator declaration
Dom Disc
dominikus at scherkl.de
Fri Apr 24 22:11:07 UTC 2026
On Friday, 24 April 2026 at 21:00:52 UTC, Meta wrote:
> The arguments from that section are:
> - 32-bit integer operations are often faster than smaller
> integer types for single variables on modern architectures.
>
> I'm not an expert in modern CPU architecture, but I'm extremely
> skeptical of this claim. I doubt the difference is even
> noticeable with modern compiler optimization techniques.
Even without optimization: nothing prevents the compiler from
calculating in the machine-words size, but the result should be
truncated to the the largest of the operands sizes.
>> What if you want to port the C code to D so you can refactor
>> and develop it using D features?
Then you should take the (more sane) rules of D into account.
I think if you plan to develop the code further, you should be
well aware of where strange C edge-cases are used and fix this.
More information about the Digitalmars-d-learn
mailing list