News for hackers. Stuff that matters.
Re:EABitTricks.h by AdmiralAsshat on Monday December 19, 2022 @11:39AM (#34054145)
Are any of these still needed, though? I kinda assumed they would be like Duff's Device and be a nifty historical relic, but firmly in the "Let the compiler do this for you" category in modern C.
Re:EABitTricks.h by TonyTrapp on Monday December 19, 2022 @12:08PM (#34054530)
Many of those are not standard functions (or were not, until very recently). You have to implement it somehow, so having a ready-made collection that also performs well is very nice to have.
Re:EABitTricks.h by jesse__ on Monday December 19, 2022 @12:11PM (#34054579)
When you're working on Frostbite you definitely need these.

Optimizers are smart, but aren't smart enough yet

Re:EABitTricks.h by anonymoushn on Monday December 19, 2022 @02:10PM (#34056240)
How do you let the compiler do these things for you?
Re:EABitTricks.h by saagarjha on Monday December 19, 2022 @05:22PM (#34058600)
By having someone write the optimization passes to detect these :)
Re:EABitTricks.h by KMnO4 on Monday December 19, 2022 @08:16PM (#34060278)
Compile with optimizations enabled.
Re:EABitTricks.h by anonymoushn on Monday December 19, 2022 @08:25PM (#34060339)
What code specifically do you write instead of the code in TFA, in order to have the optimizer generate the code in TFA? In general compiling with optimizations enabled has not produced particularly good code in my experience.