Earlier quoted context omitted.
Yep, some constants are better to be generated than loaded, see the docs from Mr. Agner. On a more global scale, all assembly "optimisations"/tricks are hidden deep into compilers, which are reasonably "transparent" to their devs only, that due to their abysmal complexity and size. We would need some sort of online library for those assembly (boolean/branchless calculus...) tricks. A job for wikipedia? Maybe linked t…
I think the compiler tricks are reasonably transparent to any developer who knows both C and assembly, thanks to godbolt.org. Couple times I even back-ported these tricks from clang-generated assembly back into C++ intrinsics.
godbolt is not really noscript/basic (x)html friendly... or I missed such www portal.