summaryrefslogtreecommitdiff
path: root/src/thread/sh/atomics.s
AgeCommit message (Collapse)AuthorFilesLines
2017-06-08use hard-coded sh4a atomic opcodes to avoid linker errors on shRich Felker1-4/+4
when using the sh4a opcodes, the assembler tags the resulting object file as requiring sh4a. the linker then refuses to (static) link it with object files marked as requiring j2, since there is no isa level that includes both sh4a and j2 instructions.
2016-01-21overhaul sh atomics for new atomics framework, add j-core cas.l backendRich Felker1-0/+65
sh needs runtime-selected atomic backends since there are a number of supported models that use non-forwards-compatible (non-smp-compatible) atomic mechanisms. previously, the code paths for this were highly inefficient since they involved C function calls with multiple branches in the callee and heavy spills in the caller. the new code performs calls the runtime-selected asm fragment from inline asm with extremely minimal clobbers, rather than using a function call. for the sh4a case where the atomic mechanism is known and there is no forward-compatibility issue, the movli.l and movco.l instructions are provided as a_ll and a_sc, allowing the new shared atomic.h to generate efficient inline versions of all the basic atomic operations without needing a cas loop.