3 ms·
Math & logic are rarely the bottleneck over memory & allocation bottlenecks, right? Does Godbolt assume x86? Does the answer change depending on whether you’re
by dahart 4y 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?
- masklinn 4y ago> Does Godbolt assume x86? 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.
- dahart 4y agoAh, yes, thank you, it looks awesome! It doesn't have GPU options (which is fair, since this is standard C++). But I see now I could have figured out the answer to my question in just a few seconds. :)
- slavik81 4y agoCompiler Explorer does have GPU options, actually. It has well-established CUDA support and I have been meaning to help add HIP support.