46
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: December 19, 2023, 04:34:37 pm »
That's really interesting and probably has some convoluted cause deep in the AST in clang that they figured was good enough if it gets optimized away for normal builds.
On that note, I'm curious how you found this / why you were inspecting the generated ASM from a non-optimized build. Inspecting the ASM of an optimized build would be challenging if you're trying to hand optimize it, but I'd expect you'd be compiling anything performance sensitive with compiler optimizations so I'm not sure how useful an unoptimized build is to even look at.
That said, I've never actually used inline ASM in C or C++, so is it possible to reliably infer the registers used so you can hand code it? I'd be afraid even that might change when optimizing the code.
On that note, I'm curious how you found this / why you were inspecting the generated ASM from a non-optimized build. Inspecting the ASM of an optimized build would be challenging if you're trying to hand optimize it, but I'd expect you'd be compiling anything performance sensitive with compiler optimizations so I'm not sure how useful an unoptimized build is to even look at.
That said, I've never actually used inline ASM in C or C++, so is it possible to reliably infer the registers used so you can hand code it? I'd be afraid even that might change when optimizing the code.