3 ms·
My understanding of how some of this works is that to handle jmps, the program uses nojmp to become its own signal handler and inserts a faulty mov to raise a S
by banachtarski 9y ago
My understanding of how some of this works is that to handle jmps, the program uses nojmp to become its own signal handler and inserts a faulty mov to raise a SIGSEGV, mov addresses around, and continue as though it was a successful jmp.
And it looks like float and int math is handled with lookup tables. yikes! but impressive!
- monocasa 9y agoIt's cooler than that, IMO. It uses the SIGSEGV to jump back to the start, once per global iteration. Bit most of the normal 'jumps' are encoded by doing both sides of the work, but using a scratch base address for the storage of the 'not taken' side that ends up not contributing to the actual result.
- euyyn 9y agoSo it prevents speculative execution of branches, by speculatively executing them itself? lol
- banachtarski 9y agoIt went full circle! The irony is that CPUs already do a ton of speculative branching
- dfox 9y agoStructuring code like this actually has it's purpose. Instruction stream executed by massively parallel SIMD systems (prototypically for 80's supercomputers like Connection Machine, but also for GPUs few generations back) actually works in exactly same way.