toying with the design of my toy virtual machine. .

i have a wild idea. what if i got rid of all the conditional jp instructions and replace them with conditional MOV?

the idea would be to eliminate branches so that pipelines get perfect prediction with no backtracking- instead, both branches run straight through, assign their outcomes to TRUE register, and FALSE register, then do the conditional math code; and MOVZ copies the true value to destination register if zero flag set; copies false value to destination if not- mov takes 3 registers and a flag

is this a terrible idea? am i gonna miss conditional jump?

Follow

@bri7

What about side effects?

· Librem Social · 1 · 0 · 0

@bri7

Interrupts, faults, illegal instruction?

@ekg done exclusively with unconditional jmp to entrypoint index

@bri7

Register pressure, and code complexity would probably scale exponentially with the number of conditions/jumps. But I don't know enough to say anything definitively...

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml