Claims
- 1. A microprocessor comprising:
a register fle congured to store data to be used for operations; a first register configured to store a first register value related to unaligned data and read
out of the register file; a second register configured to store a second register value related to the unaligned
data and read out of the register file; an execution unit configred to calculate a shin amount applied to the unaligned data; a shift amount register configured to store the calculated shift amount; and a shift unit configured to concatenate the first and second register values and shift the
concatenated result by the shift amount stored in the shift amount register.
- 2. The microprocessor of claim 1, wherein:
the execution unit multiplies lower bits of an address specified by an instruction
operand by eight to provide a product and determines the product as the shift amount applied to the unaligned data.
- 3. The mnicroprocessor of claim 1, wherein:
if the microprocessor employs a 32-bit data bus, the execution unit multiplies lower two
bits of an address specified by an instruction operand by eight to provide a product and determines the product as the shift amount applied to the unaligned data.
- 4. The microprocessor of claim 1, wherein: the execution unit multiplies lower bits of an address specified by an instruction
operand by eight to provide a product, subtracts the product from the bit width of a data bus to provide a difference, and determines the difference as the shift amount applied to the unaligned data.
- 5. The microprocessor of claim 1, wherein;
if the microprocessor employs a 32 bit data bus, the execution unit multiplies lower two
bits of an address specified by an instruction operand by eight to provide a product, subtracts the product from 32 to provide a difference, and determines the difference as the shift amount applied to the unaligned data.
- 6. The microprocessor of claim 1, wherein:
if the microprocessor employs a big endian memory system, the execution unit
multiplies lower bits of an address specified by an instruction operand by eight to provide a product and determines the product as the shift amount applied to the unaligned data.
- 7. The microprocessor of claim 1, wherein:
if the microprocessor employs a little endian memory system, the execution unit
multiplies lower bits of an address specified by an instruction operand by eight to provide a product, subtracts the product from the bit width of a data bus to provide a difference, and determines the difference as the shift amount applied to the unaligned data.
- 8. A method of processing unaligned data in a microprocessor, comprising:
storing a first part of the unaligned data in a first register, storing a second part of the unaligned data in a second register; calculating a shift amount applied to the unaligned data; concatenating the data stored in the fimt and second registers; shifning the concatenated data by the calculated shift amount; and storing the shifted result in one of the first and second registers.
- 9. The microprocessor of claim 1, wherein:
the calculating a shift amount applied to the unaligned data to multiply lower bits of an
address specified by an instruction operand by eight to provide the shift amount.
- 10. The microprocessor of claim 1, wherein:
the calculating a shift amount applied to the unaligned data to multiply lower two bits
of an address specified by an instruction operand by eight to provide the shift if the microprocessor employs a 32-bit data bus.
- 11. The microprocessor of claim 1, wherein:
the calculating a shift amount applied to the unaligned data to multiply lower bits of an
address specified by an instruction operand by eight to provide a product, subtract the product from the bit width of a data bus to provide the shift amount.
- 12. The microprocessor of claim 1, wherein:
the calculating a shift amount applied to the unaligned data to multiply lower two bits of
an address specified by an instruction operand by eight to provide a product and then to subtract the product from 32 to provide the shift amount if the microprocessor employs a 32 bit data bus.
- 13. The microprocessor of claim 1, wherein:
the calculating a shift amount applied to the unaligned data to multiply lower bits of an
address specified by an instruction operand by eight to provide the shift amount if the microprocessor employs a big endian memory system.
- 14. The microprocessor of claim 1, wherein:
the calculating a shift amount applied to the unaligned data to multiply lower bit- of an
address specified by an instruction operand by eight to provide a product and then to subtract the product from the bit width of a data bus to provide the shift amount applied if the microprocessor employs a little endian memory system.
Priority Claims (1)
Number |
Date |
Country |
Kind |
2001-27066 |
Feb 2001 |
JP |
|
CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application is based upon and claims benefit of priority from the prior Japanese Patent Application No. P2001-27066 filed on Feb. 2nd 2001, the entire contents of which are incorporated by reference herein.