Conversation
Notices
-
Embed this notice
iced depresso (icedquinn@blob.cat)'s status on Monday, 08-Apr-2024 14:43:14 JST iced depresso @Jes the dynamic recompiler probably makes better code than whats on the cart. -
Embed this notice
iced depresso (icedquinn@blob.cat)'s status on Monday, 08-Apr-2024 15:55:53 JST iced depresso @moshibar @Jes you can get a surprising amount of performance out of nothing more than a tracing JIT. :blobcatshrug2: those interpret code once to build up a tape of what actually happened to the machine, then the tape has a mini optimizer in it, and outputs machine code for the PC.
if there was a lot of checking code or small loops, often times the trace eliminates all of that. they have to insert guards to make sure the assumptions are still true, but it can work.
there are other techniques, i don't know them super well. -
Embed this notice
moshibar@fedi.catboy.agency's status on Monday, 08-Apr-2024 15:55:55 JST moshibar @icedquinn@blob.cat @Jes@labyrinth.zone how does that even happen though? :inuhuh:
-
Embed this notice
iced depresso (icedquinn@blob.cat)'s status on Monday, 08-Apr-2024 16:00:41 JST iced depresso @moshibar @Jes for example you might have a loop that goes over 12 objects, but the trace has unrolled the loop to tape which now just has those operations 12 times, and the optimizer might look at this and decide it can rearrange and pack some of the math code to NEON instructions (arm's version of simd), thus vectorizing some math heavy loops that the C compiler couldn't exploit.
of course traces are brittle and take up space, so when one of those objects is destroyed or a new one gets made it has to start inserting forks or throwing out tapes.
i'm mostly just speculating here based on what i've researched of JITs though i've never worked on an emulator for complex chips
-
Embed this notice