# US 2008/0307173 A1 · Efficient Encoding for Detecting Load Dependency on Store with Misalignment

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

- Number: US 2008/0307173 A1
- Document ID: US20080307173A1
- Status: Published application
- Kind: A1
- Application number: 11/758,193
- Filed: 2007-06-05
- Published: 2008-12-11
- Earliest claimed: 2007-06-05
- Assignees: Apple Inc.
- Inventors: Tse-yu Yeh; Daniel C. Murray; Po-Yung Chang; Anup S. Mehta
- Web page: https://patentgrep.com/patent/US20080307173A1

## CPC

- G06F 12/0607: {Interleaved addressing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one embodiment, an apparatus comprises a queue comprising a plurality of entries and a control unit coupled to the queue. The control unit is configured to allocate a first queue entry to a store memory operation, and is configured to write a first even offset, a first even mask, a first odd offset, and a first odd mask corresponding to the store memory operation to the first entry. A group of contiguous memory locations are logically divided into alternately-addressed even and odd byte ranges. A given store memory operation writes at most one even byte range and one adjacent odd byte range. The first even offset identifies a first even byte range that is potentially written by the store memory operation, and the first odd offset identifies a first odd byte range that is potentially written by the store memory operation. The first even mask identifies bytes within the first even byte range that are written by the store memory operation, and wherein the first odd mask identifies bytes within the first odd byte range that are written by the store memory operation.

## Claims

### Claim 1

An apparatus comprising:
a queue comprising a plurality of entries; and
a control unit coupled to the queue, wherein the control unit is configured to allocate a first entry of the plurality of entries to a store memory operation, wherein the control unit is configured to write a first even offset, a first even mask, a first odd offset, and a first odd mask corresponding to the store memory operation to the first entry;
wherein a group of contiguous memory locations are logically divided into alternately-addressed even and odd byte ranges, wherein a number of bytes in each byte range is an integer greater than one, and wherein a given store memory operation writes at most one even byte range and one adjacent odd byte range;
wherein the first even offset identifies a first even byte range in the group of contiguous memory locations that is potentially written by the store memory operation and the first odd offset identifies a first odd byte range in the group that is potentially written by the store memory operation; and
wherein the first even mask identifies bytes within the first even byte range that are written by the store memory operation, and wherein the first odd mask identifies bytes within the first odd byte range that are written by the store memory operation.

### Claim 2 (depends on 1)

The apparatus as recited in claim 1 wherein the control unit is coupled to receive an input even offset, an input even mask, an input odd offset, and an input odd mask that each correspond to a load memory operation, wherein the control unit is configured to determine if the store memory operation writes at least one byte read by the load memory operation responsive, at least in part, to the first even offset, the first even mask, the first odd offset, the first odd mask, the input even offset, the input even mask, the input odd offset, and the input odd mask.

### Claim 3 (depends on 2)

The apparatus as recited in claim 2 wherein, if the control unit determines that the store memory operation writes each byte read by the load memory operation, the control unit is configured to cause store data to be forwarded for the load memory operation, wherein the control unit is configured to determine that the store memory operation writes each byte responsive, at least in part, to the first even offset, the first even mask, the first odd offset, the first odd mask, the input even offset, the input even mask, the input odd offset, and the input odd mask

### Claim 4 (depends on 2)

The apparatus as recited in claim 2 wherein, if the control unit determines that the store memory operation writes at least one byte read by the load memory operation, the control unit is configured to signal a hit on the store memory operation.

### Claim 5 (depends on 4)

The apparatus as recited in claim 4 wherein the hit causes the load memory operation to be replayed if the store memory operation does not write each byte read by the load memory operation.

### Claim 6 (depends on 2)

The apparatus as recited in claim 2 wherein determining if the store memory operation writes the load includes: bitwise logically ANDing the first even mask with the input even mask, bitwise logically ANDing the first odd mask with the input odd mask, determining whether or not the first even offset matches the input even offset, and determining whether or not the first odd offset matches the input odd offset.

### Claim 7 (depends on 6)

The apparatus as recited in claim 6 wherein the store memory operation writes at least one byte read by the load if there is at least one set bit in a result of the bitwise logical ANDing of the first odd mask and the input odd mask, the input odd offset and the first odd offset match, and the load memory operation and store memory operation access the same group.

### Claim 8 (depends on 6)

The apparatus as recited in claim 6 wherein the store memory operation writes at least one byte read by the load if there is at least one set bit in a result of the bitwise logical ANDing of the first even mask and the input even mask, the input even offset and the first even offset match, and the load memory operation and store memory operation access the same group.

### Claim 9 (depends on 1)

The apparatus as recited in claim 1 wherein the group of contiguous memory locations is a cache block.

### Claim 10 (depends on 1)

The apparatus as recited in claim 1 wherein the number of bytes in each byte range is greater than or equal to a maximum store size of a misaligned store memory operation.

### Claim 11

A processor comprising:
a data cache configured to store data in units of cache blocks; and
a load/store unit coupled to the data cache and comprising a queue, wherein the load store unit is configured to allocate a first entry in the queue to a store memory operation, wherein the load/store unit is configured to write a first even offset, a first even mask, a first odd offset, and a first odd mask corresponding to the store memory operation to the first entry;
wherein a cache block is logically divided into alternately-addressed even and odd byte ranges, wherein a number of bytes in each byte range is an integer greater than one, and wherein a given store memory operation writes at most one even byte range and one adjacent odd byte range;
wherein the first even offset identifies a first even byte range in the cache block addressed by the store memory operation and the first odd offset identifies a first odd byte range in the cache block; and
wherein the first even mask identifies bytes within the first even byte range that are written by the store memory operation, and wherein the first odd mask identifies bytes within the first odd byte range that are written by the store memory operation.

### Claim 12 (depends on 11)

The processor as recited in claim 11 wherein the load/store unit is coupled to receive a load memory operation, and wherein the load/store unit is configured to determine if the store memory operation writes at least one byte read by the load memory operation responsive, at least in part, to the first even offset, the first even mask, the first odd offset, and the first odd mask, and further responsive to an input even offset, an input even mask, an input odd offset, and an input odd mask that each correspond to the load memory operation.

### Claim 13 (depends on 12)

The processor as recited in claim 12 wherein, if the load/store unit determines that the store memory operation writes each byte read by the load memory operation, the load/store unit is configured to forward store data for the load memory operation.

### Claim 14 (depends on 12)

The processor as recited in claim 12 wherein, if the load/store unit determines that the store memory operation writes at least one byte read by the load memory operation but not each byte read by the load memory operation, the load/store unit is configured to replay the load memory operation.

### Claim 15

A method comprising:
writing a first even offset, a first even mask, a first odd offset, and a first odd mask corresponding to a store memory operation to a first entry in a queue, wherein a cache block is logically divided into alternately-addressed even and odd byte ranges, wherein a number of bytes in each byte range is an integer greater than one, and wherein a given store memory operation writes at most one even byte range and one adjacent odd byte range; and wherein the first even offset identifies a first even byte range in the group of contiguous memory locations that is potentially written by the store memory operation and the first odd offset identifies a first odd byte range in the group that is potentially written by the store memory operation; and wherein the first even mask identifies bytes within the first even byte range that are written by the store memory operation, and wherein the first odd mask identifies bytes within the first odd byte range that are written by the store memory operation;
receiving an input even offset, an input even mask, an input odd offset, and an input odd mask that each correspond to a load memory operation;
determining if the store memory operation writes at least one byte read by the load memory operation responsive, at least in part, to the first even offset, the first even mask, the first odd offset, the first odd mask, the input even offset, the input even mask, the input odd offset, and the input odd mask.

### Claim 16 (depends on 15)

The method as recited in claim 15 wherein further comprising:
determining that the store memory operation writes each byte read by the load memory operation, wherein determining that the store memory operation writes each byte is responsive, at least in part, to the first even offset, the first even mask, the first odd offset, the first odd mask, the input even offset, the input even mask, the input odd offset, and the input odd mask; and
causing store data to be forwarded for the load memory operation responsive to determine that the store memory operation writes each byte.

### Claim 17 (depends on 15)

The method as recited in claim 15 further comprising:
determining that the store memory operation writes at least one byte read by the load memory operation; and
signalling a hit on the store memory operation responsive to determining that the store memory operation writes at least one byte but not each byte.

### Claim 18 (depends on 17)

The method as recited in claim 17 further comprising replaying the load memory operation responsive to the signalling and further responsive to the store memory operation not writing each byte read by the load memory operation.

### Claim 19 (depends on 15)

The method as recited in claim 15 wherein determining if the store memory operation writes the load comprises:
bitwise logically ANDing the first even mask with the input even mask;
bitwise logically ANDing the first odd mask with the input odd mask;
determining whether or not the first even offset matches the input even offset; and
determining whether or not the first odd offset matches the input odd offset.

### Claim 20 (depends on 19)

The method as recited in claim 19 wherein the store memory operation writes at least one byte read by the load if there is at least one set bit in a result of the bitwise logical ANDing of the first odd mask and the input odd mask, the input odd offset and the first odd offset match, and the load memory operation and store memory operation access the same cache block, and wherein the store memory operation writes at least one byte read by the load if there is at least one set bit in a result of the bitwise logical ANDing of the first even mask and the input even mask, the input even offset and the first even offset match, and the load memory operation and store memory operation access the same cache block.
