LMM Phil Pilgrim (PhiPi)
Title:LMM Phil Pilgrim (PhiPi)
Author:thehappyhippy
Published:Sun, 13 Jan 2008 19:33:27 GMT

LMM Kernel Specification - Phil Pilgrim (PhiPi) version


Phil Pilgrim (PhiPi) examined how the main LMM loop is usually written and determined a way to overcome that loop's failure to hit 'hub access sweet spots' which requires the LMM loop to be un-rolled to achieve maximum throughput and lowest speed degredation when compared to native PASM execution.

The mechanism used rests upon reversing the LMM code so addresses of LMM Code reduce sequentially rather than increment and use a clever sequence of PASM instructions to maximise LMM throughput.


The original discussion thread on this Reversed LMM concept can be found here

The main LMM loop of most LMM interpreters had previously used the following code -
              mov     pc,PAR
 
Loop          rdlong  Instr,pc
              add     pc,#4
Instr         nop
              jmp     #Loop
 

The LMM Loop for the Reversed LMM interpreter is -
              mov       pc,PAR
              jmp       #Start
 
Instr1        nop
              rdlong    Instr2,pc
              sub       pc,#7
Instr2        nop
Start         rdlong    Instr1,pc
              djnz      pc,#Instr1