×

Instructions for efficiently accessing unaligned vectors

  • US 7,620,797 B2
  • Filed: 11/01/2006
  • Issued: 11/17/2009
  • Est. Priority Date: 11/01/2006
  • Status: Active Grant
First Claim
Patent Images

1. A method for executing a load-swapped instruction, comprising:

  • receiving the load-swapped instruction to be executed, wherein the load-swapped instruction specifies a source address in memory, which is arbitrarily aligned; and

    executing the load-swapped instruction, which involves loading a vector from a naturally-aligned memory region encompassing the source address into a register, and in doing so, if the source address is unaligned, rotating the bytes of the vector by swapping a set of bytes residing at addresses lower than the source address with a set of bytes residing at addresses greater than or equal to the source address;

    wherein rotating the bytes of the vector involves rotating the bytes N positions, where N is equivalent to either the source address specified by the instruction modulo the vector length in bytes or the source address specified by the instruction modulo the vector length in bytes subtracted from the vector length in bytes;

    wherein rotating the bytes of the vector occurs before the vector reaches the register; and

    wherein rotating the bytes of the vector involves using an alignment circuit which is located along a load-store path between the memory and the register to cause the byte at the specified source address to reside at the least-significant byte position within the vector for a little-endian memory transaction, or causing said byte to be positioned at the most-significant byte position within the vector for a big-endian memory transaction.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×