# US 2012/0260068 A1 · Apparatus and method for handling of modified immediate constant during instruction translation

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

- Number: US 2012/0260068 A1
- Document ID: US20120260068A1
- Status: Published application
- Kind: A1
- Application number: 13/416,879
- Filed: 2012-03-09
- Published: 2012-10-11
- Earliest claimed: 2011-04-07
- Assignees: VIA Technologies, Inc.
- Inventors: G. Glenn Henry; Terry Parks; Rodney E. Hooker
- Web page: https://patentgrep.com/patent/US20120260068A1

## CPC

- G06F 9/30167: {of immediate specifier, e.g. constants}
- G06F 9/30072: {to perform conditional operations, e.g. using predicates or guards}
- G06F 9/30094: {Condition code generation, e.g. Carry, Zero flag}
- G06F 9/30112: {comprising data of variable length}
- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F 9/3017: {Runtime instruction translation, e.g. macros}
- G06F 9/30174: {for non-native instruction set, e.g. Javabyte, legacy code}
- G06F 9/30189: {according to execution mode, e.g. mode flag}
- G06F 9/30196: {using decoder, e.g. decoder per instruction set, adaptable or programmable decoders}
- G06F 9/3806: {using address prediction, e.g. return stack, branch history buffer}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An ISA-defined instruction includes an immediate field having a first and second portions specifying first and second values, which instructs the microprocessor to perform an operation using a constant value as one of its source operands. The constant value is the first value rotated/shifted by a number of bits based on the second value. An instruction translator translates the instruction into one or more microinstructions. An execution pipeline executes the microinstructions generated by the instruction translator. The instruction translator, rather than the execution pipeline, generates the constant value for the execution pipeline as a source operand of at least one of the microinstructions for execution by the execution pipeline. Alternatively, if the immediate field value is not within a predetermined subset of values known by the instruction translator, the instruction translator generates, rather than the constant, a second microinstruction for execution by the execution pipeline to generate the constant.

## Claims

### Claim 1

A microprocessor having an instruction set architecture that defines at least one instruction comprising an immediate field, wherein the immediate field has a first portion specifying a first value and a second portion specifying a second value, wherein the instruction instructs the microprocessor to perform an operation which uses a constant value as one of its source operands, wherein the constant value is the first value rotated/shifted by a number of bits based on the second value, the microprocessor comprising:
an instruction translator, that translates the at least one instruction into one or more microinstructions, wherein the microinstructions are encoded in a distinct manner from the manner in which instructions defined by the instruction set architecture are encoded; and
an execution pipeline, that executes the microinstructions generated by the instruction translator to generate a result defined by the instruction set architecture;
wherein the instruction translator, rather than the execution pipeline, generates the constant value from the first and second values for provision to the execution pipeline as a source operand of at least one of the microinstructions for execution by the execution pipeline.

### Claim 2 (depends on 1)

The microprocessor of claim 1, wherein the instruction translator translates the instruction into different microinstructions depending upon whether a value of the immediate field is in a predetermined subset of values.

### Claim 3 (depends on 1)

The microprocessor of claim 1, wherein the execution pipeline comprises:
a plurality of execution units, that execute the microinstructions to generate results; and
an issue unit, that issues to at least one of the execution units the constant value generated by the instruction translator as the source operand of the at least one of the microinstructions for execution by the at least one of the execution units.

### Claim 4 (depends on 1)

The microprocessor of claim 1, wherein the execution pipeline comprises:
a plurality of execution units, that execute the microinstructions to generate results;
wherein the microprocessor further comprises:
a first one or more buses, that forward execution results of the microinstructions from the execution units back to the execution units as source operands of other microinstructions; and
a second bus, that provides the constant value generated by the instruction translator to the execution pipeline, wherein the second bus is distinct from the first one or more buses.

### Claim 5 (depends on 4)

The microprocessor of claim 4, further comprising:
registers, that receive the execution results of the microinstructions from the execution units, wherein the constant value generated by the instruction translator is not written to the registers by the microprocessor.

### Claim 6 (depends on 1)

The microprocessor of claim 1, wherein the constant value is the first value rotated/shifted by a number of bits that is twice the second value.

### Claim 7 (depends on 1)

The microprocessor of claim 1, wherein the at least one instruction includes data processing instructions of the Advanced RISC Machines (ARM) instruction set architecture (ISA) that specify a modified immediate constant.

### Claim 8 (depends on 10)

The microprocessor of claim 10, wherein the data processing instructions of the ARM ISA that specify a modified immediate constant include conditional ALU instructions that specify a modified immediate constant.

### Claim 9

A method performed by a microprocessor having an instruction set architecture that defines at least one instruction comprising an immediate field, wherein the immediate field has a first portion specifying a first value and a second portion specifying a second value, wherein the instruction instructs the microprocessor to perform an operation which uses a constant value as one of its source operands, wherein the constant value is the first value rotated/shifted by a number of bits based on the second value, the method comprising:
translating the at least one instruction into one or more microinstructions, wherein the microinstructions are encoded in a distinct manner from the manner in which instructions defined by the instruction set architecture are encoded, wherein said translating is performed by an instruction translator of the microprocessor; and
executing the microinstructions generated by the instruction translator to generate a result defined by the instruction set architecture, wherein said executing is performed by an execution pipeline of the microprocessor;
generating, by the instruction translator rather than the execution pipeline, the constant value from the first and second values for provision to the execution pipeline as a source operand of at least one of the microinstructions for execution by the execution pipeline.

### Claim 10 (depends on 9)

The method of claim 9, wherein said translating comprises translating the instruction into different microinstructions depending upon whether a value of the immediate field is in a predetermined subset of values.

### Claim 11 (depends on 9)

The method of claim 9, wherein the constant value is the first value rotated/shifted by a number of bits that is twice the second value.

### Claim 12 (depends on 9)

The method of claim 9, wherein the at least one instruction includes data processing instructions of the Advanced RISC Machines (ARM) instruction set architecture (ISA) that specify a modified immediate constant.

### Claim 13 (depends on 12)

The method of claim 12, wherein the data processing instructions of the ARM ISA that specify a modified immediate constant include conditional ALU instructions that specify a modified immediate constant.

### Claim 14

A microprocessor having an instruction set architecture that defines at least one instruction comprising an immediate field, wherein the immediate field has a first portion specifying a first value and a second portion specifying a second value, wherein the instruction instructs the microprocessor to perform an operation which uses a constant value as one of its source operands, wherein the constant value is the first value rotated/shifted by a number of bits based on the second value, the microprocessor comprising:
an instruction translator, that translates the at least one instruction into one or more microinstructions; and
an execution pipeline, that executes the microinstructions generated by the instruction translator to generate a result defined by the instruction set architecture;
wherein, when a value of the immediate field is in a predetermined subset of values:
the instruction translator translates the instruction into at least one microinstruction;
the instruction translator, rather than the execution pipeline, generates the constant value from the first and second values; and
the execution pipeline executes the at least one microinstruction using the constant value generated by the instruction translator as one of its source operands; and
wherein, when the value of the immediate field is not in the predetermined subset of values:
the instruction translator translates the instruction into at least first and second microinstructions;
the execution pipeline, rather than the instruction translator, generates the constant value by execution of the first microinstruction; and
the execution pipeline executes the second microinstruction by performance of the operation using the constant value generated by the execution of the first microinstruction as one of its source operands.

### Claim 15 (depends on 14)

The microprocessor of claim 14, wherein the execution pipeline comprises:
a register allocation table, that generates a dependency of the second microinstruction upon the constant value generated by the execution of the first microinstruction.

### Claim 16 (depends on 14)

The microprocessor of claim 14, wherein the microinstructions are defined by a microarchitecture of the microprocessor and are encoded in a distinct manner from the manner in which instructions defined by the instruction set architecture are encoded.

### Claim 17 (depends on 14)

The microprocessor of claim 14, wherein the first microinstruction is a shift/rotate microinstruction.

### Claim 18

A method performed by a microprocessor having an instruction set architecture that defines at least one instruction comprising an immediate field, wherein the immediate field has a first portion specifying a first value and a second portion specifying a second value, wherein the instruction instructs the microprocessor to perform an operation which uses a constant value as one of its source operands, wherein the constant value is the first value rotated/shifted by a number of bits based on the second value, the microprocessor also having an instruction translator and an execution pipeline, the method comprising:
determining whether a value of the immediate field is in a predetermined subset of values, by the instruction translator;
when the value of the immediate field is in the predetermined subset of values:
translating the instruction into at least one microinstruction, by the instruction translator;
generating, by the instruction translator rather than the execution pipeline, the constant value from the first and second values; and
executing the at least one microinstruction using the constant value generated by the instruction translator as one of its source operands, by the execution pipeline; and
wherein, when the value of the immediate field is not in the predetermined subset of values:
translating the instruction into at least first and second microinstructions, by the instruction translator;
generating, by the execution pipeline rather than the instruction translator, the constant value by execution of the first microinstruction; and
executing the second microinstruction by performance of the operation using the constant value generated by the execution of the first microinstruction as one of its source operands, by the execution pipeline.

### Claim 19 (depends on 18)

The method of claim 18, further comprising:
generating a dependency of the second microinstruction upon the constant value generated by the execution of the first microinstruction, wherein said generating a dependency is performed by a register allocation table of the microprocessor.

### Claim 20 (depends on 18)

The method of claim 18, wherein the microinstructions are defined by a microarchitecture of the microprocessor and are encoded in a distinct manner from the manner in which instructions defined by the instruction set architecture are encoded.

### Claim 21

A computer program product encoded in at least one computer readable storage medium for use with a computing device, the computer program product comprising:
computer readable program code embodied in said medium, for specifying a microprocessor having an instruction set architecture that defines at least one instruction comprising an immediate field, wherein the immediate field has a first portion specifying a first value and a second portion specifying a second value, wherein the instruction instructs the microprocessor to perform an operation which uses a constant value as one of its source operands, wherein the constant value is the first value rotated/shifted by a number of bits based on the second value, the computer readable program code comprising:
first program code for specifying an instruction translator, that translates the at least one instruction into one or more microinstructions, wherein the microinstructions are encoded in a distinct manner from the manner in which instructions defined by the instruction set architecture are encoded; and
second program code for specifying an execution pipeline, that executes the microinstructions generated by the instruction translator to generate a result defined by the instruction set architecture;
wherein the instruction translator, rather than the execution pipeline, generates the constant value from the first and second values for provision to the execution pipeline as a source operand of at least one of the microinstructions for execution by the execution pipeline.

### Claim 22 (depends on 21)

The computer program product of claim 21, wherein the at least one computer readable storage medium is selected from the set of a disk, tape, or other magnetic, optical, or electronic storage medium and a network, wire line, wireless or other communications medium.
