Stack Computers: the new wave
© Copyright 1989,
Philip Koopman,
All Rights Reserved.
Chapter 6. Understanding Stack Machines
There are three components to the performance of processing interrupts. The first component is the amount of time that elapses between the time that an interrupt request is received by the processor and the time that the processor takes action to begin processing the interrupt service routine. This delay is called interrupt latency.
The second component of interrupt service performance is interrupt processing time. This is the amount of time that the processor spends actually saving the machine state of the interrupted job and diverting execution to the interrupt service routine. Usually the amount of machine state saved is minimal, on the presumption that the interrupt service routine can minimize costs by saving only those additional registers that it plans to use. Sometimes, one sees the term "interrupt latency" used to describe the sum of these first two components.
The third component of interrupt service performance is what we shall call state saving overhead. This is the amount of time taken to save machine registers that are not automatically saved by the interrupt processing logic, but which must be saved in order for the interrupt service routine to do its job. The state saving overhead can vary considerably, depending upon the complexity of the interrupt service routine. In the extreme case, state saving overhead can involve a complete context switch between multi-tasking jobs.
Of course, the costs of restoring all the machine state and returning to the interrupted routine are a consideration in determining overall system performance. We shall not consider them explicitly here, since they tend to be roughly equal to the state saving time (since everything that is saved must be restored), and are not as important in meeting a time-critical deadline for responding to an interrupt.
CISC machines may have instructions which take a very long time to execute, degrading interrupt response latency performance. Stack machines, like RISC machines, can have a very quick interrupt response latency. This is because most stack machine instructions are only a single cycle long, so at worst only a few clock cycles elapse before an interrupt request is acknowledged and the interrupt is processed.
Once the interrupt is processed, however, the difference between RISC and stack machines becomes apparent. RISC machines must go through a tricky pipeline saving procedure upon recognizing an interrupt, as well as a pipeline restoring procedure when returning from the interrupt, in order to avoid losing information about partially processed instructions. Stack machines, on the other hand, have no instruction execution pipeline, so only the address of the next instruction to be executed needs to be saved. This means that stack machines can treat an interrupt as a hardware generated procedure call. Of course, since procedure calls are very fast, interrupt processing time is very low.
There is one possible problem with stack machine interrupt response latency. That is the issue of streamed instructions and microcoded loops.
Streamed instructions are used to repguitmvelq"execwdg af operation sus( as writ)ngdhe top dtq`wuack element |o meiory Ph%{e4iNstrctions aRm ymxlmened`usinG an(instrution rdp%cp feeture on tha S00!6 and PTX :4p0( !n ijsruct)n0wffgs on(te(M17!and!microcodd loop{ on phu CTU/16 and TX 9:P. Txese tramatHtEc yre0vEry usefuL singa thEy can bm 5ed"to(buil`0egficIed *strig manipuLctioj primitiDes and stakkw~ efkw.overflo sevice"pmuvijes. M Tepo"lem /s tat, in most cass,0uhg{e mnstvuctons"cpe alwo non-in|errpti"le. =%p>
Oz% so]tionis$to mKe vHgsm i3tbuctinns inverr}`ibLe With eptra qntr_l
hardward,(shich mEy kokrease rrocessor cMMpnxity quite E (byt, A"popunti`lly
hard prnble- thed non-{4eck2processrs"have sIth thc solutiof`is uhm isswa o
savhng i.verm%da`tu rtsults.!$W)t a`spack prOCesqor tHis Is)not a"p2k"em,
cica ij4ermelia}e results qe alreaD; r5shent gn q 3task, vhich0ir"the$admal
mechanism for ravcn(st`te0durilg an i&tesr4pt.(
,/X<
P