3 ms·
Interesting thought. I wonder if LLVM IR has a semaphore primitive? In which case it could map to the HSEM in STM32 or an instruction sequence for other machi
by dbcurtis 7y ago
Interesting thought. I wonder if LLVM IR has a semaphore primitive? In which case it could map to the HSEM in STM32 or an instruction sequence for other machines. IR seems like the natural place to put this kind of functionality, especially since you need to guard either the HSEM or the equivalent sequence from being disrupted by over-eager code motion. (Which historically was a problem with gcc -- on the AVR architecture, at least, gcc liked to move SEI and CLI to the top of the function instead of leaving them in place, because there was no way to specify the idea that the interrupt mask bit was an absolute fence to code motion. Not sure if that is still true.)