TRANSPORTUIP - Microcode Subroutine Call Setup
Purpose
TRANSPORTUIP prepares for microcode subroutine execution by saving a return address. It does NOT perform the actual jump - a subsequent U_JCC, U_JMP, or other jump instruction does that.
There appear to be multiple mechanisms for handling microcode subroutine calls and returns, depending on the CPU generation and microcode implementation. In particular, the mechanism described in the older notes is valid for Pentium Pro (see TRANSPORTUIP at 0619h). Newer CPUs may use different mechanisms, including an EOM return flag. The exact differences between generations require further investigation.
TRANSPORTUIP itself does not perform the actual jump; control transfer is handled by a subsequent jump instruction. These mechanisms allow code reuse and conditional path selection in microcode.
result = TRANSPORTUIP(CONST, target_label, IA.11, U3.01)
- Saves the current microcode position as a return address.
- Returns some value in the result register (internal state, not necessarily the address itself).
- The target_label is used by the following jump instruction.
- The subsequent jump instruction performs the actual transfer of control.
- The return mechanism depends on the CPU generation / implementation. Two mechanisms are described below.
Subroutine Call and Return Mechanisms
Mechanism 1: Return via EOM flag (newer mechanism, details to be investigated)
In this mechanism:
- Subroutines end with EOM that has a special flag bit set.
- This flag indicates "return to saved address" instead of "end of macro-operation".
- The return address comes from what TRANSPORTUIP saved internally.
- Normal EOM (without flag) means end of entire instruction.
Example from FXSAVE:
// Main path: TMP8 = TRANSPORTUIP(CONST, part_macro_fxsave_alt, IA.11, U3.01) [... store FP registers ...] // At part_macro_fxsave_alt: [... alternate FP register stores ...] EOM + ???FL2??? // With return flag - goes back to main path
Cpuid in some cache CRBUS handling subroutine also uses U_JMP_INDIR to return back from subroutine.
This mechanism is described in the newer notes, but its exact implementation and applicability across CPU generations still need to be investigated.
Mechanism 2: Return via U_JMP_INDIR (Pentium Pro / older mechanism)
The Pentium Pro microcode uses the value returned by TRANSPORTUIP as an explicit indirect jump target. The return address is stored in a temporary register and subsequently used by U_JMP_INDIR to return from the subroutine.
Example with TMP5 used as return address from subroutine:
... TMP5 = TRANSPORTUIP (CONST , loc_ret , IA_11, U3_01) ... U_JMP_NT (CONST , sub_xyz , IA_11, U3_1B) loc_ret: ... # microcode subroutine sub_xyz: ... U_JMP_INDIR_N (CONST_0 , TMP5 , U3_40)
In this mechanism:
- TRANSPORTUIP saves/prepares the return address associated with loc_ret.
- Its returned value (TMP5) is used directly as the operand of U_JMP_INDIR_N.
- U_JMP_NT transfers execution to the subroutine.
- The subroutine explicitly returns using U_JMP_INDIR_N with the saved return address in TMP5.
This is the accurate behavior for Pentium Pro (in particular, TRANSPORTUIP at 0619h). The older notes should therefore be considered valid for this implementation, rather than treated as an obsolete or incorrect description.
- The value returned by TRANSPORTUIP has a role in subroutine control flow. Its use differs between the mechanisms described above.
- For Pentium Pro, the returned value is explicitly used as the indirect jump target (TMPx = TRANSPORTUIP(...) -> U_JMP_INDIR(..., TMPx)).
- For newer CPUs, the EOM return-flag mechanism is also described, but its exact relationship to the Pentium Pro mechanism is not yet established.
- The internal implementation may involve a microcode call stack (within a register?), a register chain, or other internal state; this remains to be clarified.
- Further investigation is needed to establish which return mechanisms are used by which CPU generations and interoperability