|
|
|
|
|
by dahart
1471 days ago
|
|
Math & logic are rarely the bottleneck over memory & allocation bottlenecks, right? Does Godbolt assume x86? Does the answer change depending on whether you’re using an AMD or NVIDIA GPU, or an Apple, ARM or Intel processor? Does it depend on which instruction pipelines are full or stalled from the surrounding code, e.g., logic vs math? Hard to say if one of these will always be better. There are also other alternatives, e.g. bitmasking, that might generate fewer instructions… maybe “abs(num) > x” will beat both of those examples? |
|
Godbolt uses whatever compilers, targets, and optimisations you ask it to.
It is, in fact, a very useful tool for comparing different compilers, architectures, and optimization settings.