2 ms·
I wonder if compilers should have pragmas to control the exact code generation, e.g. #pragma avoid_speculation #pragma constant_time Feels like it might
by IshKebab 4y ago
I wonder if compilers should have pragmas to control the exact code generation, e.g.
#pragma avoid_speculation
#pragma constant_time
Feels like it might be more reliable that writing C and hoping the compiler does what you expect.
- Asooka 4y agoIt might be better to expose said instructions as special functions, like how SIMD instructions are exposed. Or write part of the code in assembly - choosing cmov over branch is already architecture dependent.
- mhh__ 4y agoI haven't seen any pragmas but GCC has builtins for injecting serialising instructions.