Method and apparatus for manipulating a carry/borrow bit to numerically adjust and immediate value of an instruction during execution
AssigneeMotorola, Inc.
InventorsBrian G. Lucas, William C. Moyer
Life of this patent
Estimating the term…
Abstract
Method and apparatus for adjusting the range of a data processor instruction field for a data processor (10). The present invention allows the range of a data processor instruction field to be adjusted without requiring decode of the instruction field and without requiring the instruction field value to be modified. In one embodiment, a data processor (10) uses the value of the carry-in/borrow bit (60) provided to an arithmetic unit (30) to selectively adjust the range of the immediate data operand for certain instructions, such as, for example, add immediate (ADDI) and subtract immediate (SUBI).
Claims30
A method of performing a function encoded as a processor instruction containing an opcode field, an biased immediate value field, and a nonimmediate operand field, said method comprising the steps of:
- identifying the processor instruction, and an initial immediate value;
- altering the initial immediate value to a biased immediate value that is not equal to the initial immediate value;
- placing the processor instruction and the biased immediate value into memory for execution;
- beginning execution of the processor instruction by decoding the processor instruction, the decoding comprising the steps of:
- identifying the processor instruction based on the opcode field,
- providing the biased immediate value from the immediate value field of the processor instruction, and
- providing a nonimmediate operand specifier from the nonimmediate operand field;
- providing a carry-in/borrow signal based on the processor instruction identified, the carry in/borrow signal being set to a value that adjusts the biased immediate value to a correct immediate value;
- retrieving a nonimmediate operand in response to providing the nonimmediate operand specifier;
- and
- performing the function in response to decoding of the processor instruction utilizing the nonimmediate operand, the corrected immediate value, and the carry-in/borrow signal as inputs and generating an output data, wherein:
- the carry-in/borrow signal is used to perform a first adjustment to obtain the corrected immediate value from the biased immediate value and the corrected immediate value is used to perform a second adjustment to obtain a final result from the nonimmediate operand and the corrected immediate value.
A data processing system responsive to a processor instruction containing an immediate value field that represents an effective immediate value differing by a predetermined nonzero integer from a binary value encoded in the immediate value field, said data processing system comprising:
- means for accepting the effective immediate value and altering the effective immediate value to the binary value that is to be encoded in the immediate value field;
- an instruction decode circuitry for identifying the processor instruction from an opcode field in the processor instruction and decoding the processor instruction to identify the immediate value field and a nonimmediate operand field when the processor instruction has been selected for execution by the data processing system,
- an immediate value provision circuitry that provides the binary value encoded in the immediate value field;
- a plurality of registers that provides contents of a selected one of the plurality of registers as a set of nonimmediate operand signals in response to a register select signal generated from the nonimmediate operand field;
- a carry-in/borrow generation circuitry that generates a carry-in/borrow signal based on which instruction is identified;
- and
- an arithmetic unit operating responsively to the binary value encoded in the immediate value field, the set of nonimmediate operand signals, and the carry-in/borrow signal, wherein the effective immediate value is generated from the binary value encoded in the immediate value field and the carry-in/borrow signal and wherein this effective immediate value is processed with the nonimmediate value to provide a set of output data signals.
A data processing system responsive to a first processor instruction containing an immediate value field that represents an effective immediate value differing by a predetermined nonzero integer from a binary value encoded in the immediate value field, and a second processor instruction containing a first operand field and a second operand field, wherein the first processor instruction and the second processor instruction implement a same function, said data processing system comprising:
- an instruction decode circuitry for identifying and decoding the first processor instruction into the immediate value field and a nonimmediate operand field when the first processor instruction has been selected for execution by the data processing system, and for identifying and decoding the second processor instruction into the first operand field and the second operand field when the second processor instruction has been selected for execution by the data processing system,
- an immediate value provision circuitry that provides a set of immediate value signals from the immediate value field;
- a plurality of registers that provides a value of a selected one of the plurality of registers as a set of nonimmediate operand signals in response to a register select signal generated from either the nonimmediate operand field or the first operand field;
- a carry-in/borrow generation circuitry that generates a carry-in/borrow signal based on which processor instruction is identified;
- a multiplexer selecting as a set of multiplexer signals one of a set of signals comprising:
- the set of immediate value signals, and
- a set of signals generated in response to decoding the second operand field;
- and
- an arithmetic unit operating responsively to the set of multiplexer signals, the set of nonimmediate operand signals, and the carry-in/borrow signal to generate a set of output data signals, wherein:
- the carry-in/borrow signal is utilized to effectively adjust a value represented by the set of multiplexer signals by the predetermined nonzero integer to form the effective immediate value when the first processor instruction is identified, and
- the value of the carry-in/borrow signal differs between execution of the first processor instruction and execution of the second processor instruction.
A data processing system responsive to an add immediate instruction containing an immediate value field that represents an effective immediate value one larger than a binary value encoded in the immediate value field, said data processing system comprising:
- an instruction decode circuitry for identifying the add immediate instruction from an opcode field in the add immediate instruction and decoding the add immediate instruction into an immediate value field and a nonimmediate operand field when the add immediate instruction has been selected for execution by the data processing system,
- an immediate value provision circuitry that provides a set of immediate value signals from the immediate value field;
- a plurality of registers that provides contents of a selected one of the plurality of registers as a set of nonimmediate operand signals in response to a register select signal generated from the nonimmediate operand field;
- a carry-in/borrow generation circuitry that asserts a carry-in/borrow signal when the add immediate instruction is identified;
- and
- an arithmetic unit operating to effectively add the effective immediate value to a value formed from the set of nonimmediate operand signals, and generating a sum as a set of output data signals, wherein:
- asserting the carry-in/borrow signal effectively adds one to a value represented by the set of immediate value signals to form an effective immediate operand.
A data processing system responsive to an subtract immediate instruction containing an immediate value field that represents an effective immediate value one larger than a binary value encoded in the immediate value field, said data processing system comprising:
- an instruction decode circuitry for identifying the subtract immediate instruction from an opcode field in the subtract immediate instruction and decoding the subtract immediate instruction into an immediate value field and a nonimmediate operand field when the subtract immediate instruction has been selected for execution by the data processing system,
- an immediate value provision circuitry that provides a set of immediate value signals from the immediate value field;
- a plurality of registers that provides contents of a selected one of the plurality of registers as a set of nonimmediate operand signals in response to a register select signal generated from the nonimmediate operand field;
- a carry-in/borrow generation circuitry that negates a carry-in/borrow signal when the subtract immediate instruction is identified;
- and
- an arithmetic unit operating to effectively subtract the effective immediate value from a value formed from the set of nonimmediate operand signals, and generating a difference as a set of output data signals, wherein:
- negating the carry-in/borrow signal effectively adds one to a value represented by the set of immediate value signals to form an effective immediate operand.
A data processing system for performing a function encoded as a processor instruction containing an opcode field, an immediate value field, and a nonimmediate operand field, said data processing system comprising:
- means for decoding the processor instruction, comprising:
- means for identifying the processor instruction based on the opcode field,
- means for providing an immediate value from the immediate value field of the processor instruction, and
- means for providing a nonimmediate operand specifier from the nonimmediate operand field;
- means for providing a carry-in/borrow signal based on the processor instruction identified;
- means for retrieving a nonimmediate operand in response to providing the nonimmediate operand specifier;
- and
- means for performing the function in response to decoding of the processor instruction utilizing the nonimmediate operand, the immediate value, and the carry-in/borrow signal as inputs and generating an output data, wherein:
- the carry-in/borrow signal is used to adjust the immediate value by a predetermined nonzero integer to form an effective immediate value different from the immediate value.
Dependencies are inferred from the claim text.