# US 6,725,361 B1 · Method and apparatus for emulating a floating point stack in a translation process

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 6,725,361 B1
- Document ID: US6725361B1
- Status: Granted
- Kind: B1
- Application number: 09/595,199
- Filed: 2000-06-16
- Granted: 2004-04-20
- Earliest claimed: 2000-06-16
- Assignees: Transmeta Corporation
- Inventors: Guillermo Rozas; David Dunn; David Dobrikin; Alex Klaiber; Daniel H. Nelsen
- Web page: https://patentgrep.com/patent/US6725361B1

## CPC

- G06F 9/30134: {Register stacks; shift registers}
- G06F 9/3004: {to perform operations on memory}
- G06F 9/30076: {to perform miscellaneous control operations, e.g. NOP}
- G06F 9/3017: {Runtime instruction translation, e.g. macros}
- G06F 9/384: {Register renaming}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A floating point processor including a plurality of explicitly-addressable processor registers, an emulation register capable of storing a value used to logically rename the explicitly-addressable registers to emulate registers of a floating point stack, a computer-executable software process for calculating and changing a value in the emulation register to a value indicating a change in addresses of registers of a floating point stack when executing a floating point stack operation, and adder circuitry combining a register address and the value in the emulation register in response to the computer-executable process to rename the plurality of explicitly-addressable processor registers.

## Claims

### Claim 1

A floating point processor comprising a plurality of explicitly-addressable processor registers, an emulation register capable of storing a value used to logically rename the explicitly-addressable registers to emulate registers of a floating point stack, a computer-executable software process for calculating and changing a value in the emulation register to a value indicating a change in addresses of registers of a floating point stack when executing a floating point stack operation, and adder circuitry for combining a register address and the value in the emulation register in response to the computer-executable process to rename the plurality of explicitly-addressable processor registers, and for comparing a top-of-stack with a predicted top-of-stack and selecting a translation of a next stack instruction for execution based upon the comparison.

### Claim 2 (depends on 1)

A floating point processor as claimed in claim 1 in which the adder circuitry includes a number of adders sufficient to add the value and register addresses for each register involved in carrying out an instruction.

### Claim 3

In a processor which dynamically translates instructions programmed in a target instruction set to instructions in a host instruction set, a process for executing stack operations utilizing a plurality of explicitly-addressed registers comprising the steps of:
executing a stack instruction utilizing selected ones of the explicitly-addressed registers,
detecting any change in top-of-stack caused by the executed stack instruction,
explicitly instructing a rotation of addresses of the selected ones of the plurality of explicitly-addressed registers by an amount depending on the change in top-of-stack, and
comparing the top-of-stack with a predicted top-of-stack and selecting a translation of a next stack instruction for execution based upon the comparison.

### Claim 4 (depends on 3)

A process as claimed in claim 3 in which the step of executing a stack instruction utilizing selected ones of the explicitly-addressed registers includes executing each of a sequence of-stack instructions,
the step of detecting any change in top-of-stack caused by the executed stack instruction includes accruing changes in top-of-stack caused by the executed instructions during the sequence, and
the step of explicitly instructing a rotation of addresses of the selected ones of the plurality of explicitly-addressed registers is by an amount depending on the accrued changes in top-of-stack.

### Claim 5 (depends on 4)

A process as claimed in claim 4 in which the stack operations are floating point stack operations.

### Claim 6

Apparatus which dynamically translates instructions programmed in a target instruction set to instructions in a host instruction set and for executing instructions programmed for execution by a relatively-addressed stack comprising:
a plurality of explicitly-addressed registers,
a storage device capable of storing a top-of-stack address assigned to one of the explicitly-addressed registers with respect to which others of the plurality of explicitly-addressed registers are addressed,
a computer-implemented software process for accruing changes in a top-of-stack address over a selected interval of instructions and generating an instruction to change a top-of-stack address held by the storage device, and for comparing a top-of-stack with a predicted top-of-stack and selecting a translation of a next stack instruction for execution based upon the comparison, and
renaming circuitry responding to the instruction to combine a top-of-stack address held by the storage device and addresses relative to the top-of-stack of the explicitly-addressed registers.

### Claim 7 (depends on 6)

Apparatus as claimed in claim 6 in which the renaming circuitry comprises adder circuitry for combining an address relative to the top-of-stack of the explicitly-addressed registers and a top-of-stack address held by the storage device.

### Claim 8 (depends on 7)

Apparatus as claimed in claim 7 in which in the adder circuitry comprises a plurality of adders sufficient to add the top-of-stack address and addresses relative to the top-of-stack of the explicitly-addressed registers for each register involved in carrying out an instruction.

### Claim 9 (depends on 7)

Apparatus as claimed in claim 7 in which in the relatively-addressed stack is a floating point stack.

### Claim 10

A process for executing stack operations utilizing a plurality of explicitly-addressed registers in a host processor which dynamically translates instructions programmed in a target instruction set to instructions in a host instruction set comprising the steps of:
executing a stack instruction utilizing selected ones of the explicitly-addressed registers,
detecting any change in top-of-stack caused by the executed stack instruction,
translating a next stack instruction assuming a top-of-stack at a predicted one of the explicitly-addressed registers without waiting to determine if top-of-stack is at the predicted one of the explicitly-addressed registers,
comparing top-of-stack with predicted top-of-stack after rotation and before execution of the next stack instruction,
executing the next stack instruction if top-of-stack and predicted top-of-stack compare, and
selecting a different translation of the next stack instruction for execution if top-of-stack and predicted top-of-stack do not compare.

### Claim 11 (depends on 10)

A process as claimed in claim 10 further comprising the further step of correcting the explicitly-addressed registers used in the translation of the next stack instruction to reflect the one of the explicitly-addressed registers determined to be top-of-stack, and executing the next stack instruction using the corrected explicitly-addressed registers.

### Claim 12 (depends on 11)

A process as claimed in claim 11 in which the step of correcting the explicitly-addressed registers used in the translation of the next stack instruction comprises adjusting host top-of-stack by the accrued changes in predicted top-of-stack.
