Transmeta Speculative Execution Mechanisms -- SummaryMechanismsWorking and Shadow RegistersSlide 4Programmable store bufferSlide 6Store under Alias MaskSlide 8Select instruction for if-conversionSlide 10Compiler Techniques for Dynamic OptimizationSlide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Transmeta Speculative Execution Mechanisms -- SummaryLuddy HarrisonCS433GMechanisms•Working + Shadow register files•Programmable store buffer•Speculative load (ldp) and store under alias mask (stam) instructions•Select instruction for if-conversionWorking and Shadow Registers•48 of the GPRs are duplicated–“working” version is temporary – operand destinations of VLIW instructions go here–Any instruction with “commit” bit turned on causes all 48 working regs to be copied to shadow regs•The meaning is “speculation was correct; we are certain that we want the result of this trace”–Rollback simply means copying the shadow registers back to the working registers•This restores the register state prior to beginning the traceProgrammable store buffer•Stores similarly go into a store buffer•They are written to memory on a “commit” instruction (any instruction with the commit bit set)•Rollback simply means discarding store buffer contents•Loads are serviced by referring to this buffer like a cache (for the case of load after store in a single trace)•Memory-mapped I/O and other addressing anomolies are detected and a rollback occursStore under Alias Mask•When a load is hoisted above a store, it becomes a speculated load (ldp)–When it is executed, the data address is entered into a special associative memory•The store it was hoisted over becomes a store under alias mask (stam)–When it is executed, its address is looked up in the associative memory–If it matches (overlaps), an exception occurs – causes rollbackSelect instruction for if-conversionIf (condition) x = a + belse x = c + dBecomesT = a + bS = c + dx = select (condition) S else TSelect is like a 2-input muxCompiler Techniques for Dynamic Optimization•Register Renaming•Copy Propagation•Static Single Assignment form•If-Conversion•Dead Code Elimination•Algebraic Simplification and Expression Optimization•Code Motion and Dataflow
View Full Document