is used in a few places in the code But this is "core" functions, that called from every where. Just because it has no affect for the compiler you are using, doesn't mean that it's not necessary for other compilers In my link to https://godbolt.org in the first post you can check almost all modern compilers via switching it in the web GUI. gcc, icc, clang, msvc. All of them has similar behavior - "volatile" changes nothing (in terms of calculated result). After all there is C++ standard that prevent...
Hi, I see that in case of real == double volatile is used in many places of code. As downside it adds extra save and load to/from main memory, but what is upside? I look at assembler for clang, icc and mcvs for "Math::AngRound", without -ffast-math (/fp:fast in case of msvc) compiler do not simplify 'z - (z - y)' to 'y', but with -ffast-math volatile doesn't prevent simplification, see result of clang as example: https://godbolt.org/z/7sbeq9bKE so volatile do not prevent compiler optimization plus...
Hi, I see that in case of real == double volatile is used in many places of code. As downside it add extra save and load from main memory, but what is upside? I look at assembler for clang, icc and mcvs for "Math::AngRound", without -ffast-math (/fp:fast in case of msvc) compiler do not simplify 'z - (z - y)' to 'y', but with -ffast-math volatile doesn't prevent simplification, see result of clang as example: https://godbolt.org/z/7sbeq9bKE so volatile do not prevent compiler optimization plus it...