# US 2026/0093636 A1 · Read modify write optimization using new bitfield compare and update instructions

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

- Number: US 2026/0093636 A1
- Document ID: US20260093636A1
- Status: Published application
- Kind: A1
- Application number: 18/899,088
- Filed: 2024-09-27
- Published: 2026-04-02
- Earliest claimed: 2024-09-27
- Assignees: Advanced Micro Devices, Inc.
- Applicants: Advanced Micro Devices, Inc.
- Inventors: Neeraj Upadhyay; Ranjal Gautham Shenoy
- Web page: https://patentgrep.com/patent/US20260093636A1

## CPC

- G06F 12/0857: {by multiple requestors}
- G06F 12/12: Replacement control
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 9/526: {Mutual exclusion algorithms}
- G06F 12/084: with a shared cache
- G06F 12/0842: for multiprocessing or multitasking
- G06F 2209/521: Atomic
- G06F 2212/1008: Correctness of operation, e.g. memory ordering
- G06F 2212/1024: Latency reduction
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A bitfield compare-and-update instruction separates compare and exchange operations on the same lock state variable. When executing the bitfield compare and update instruction, the processing system compares a portion of the lock state variable to a previously-loaded value and, in response to a match, updates a different portion of the lock state variable.

## Claims

### Claim 1

A method, comprising:
determining, at a processor, that a first processor core is to access shared data; and
in response to the determining:
comparing a first portion of a first cache line to a first local copy at the first processor core; and
modifying a second portion of the first cache line in response to the comparing indicating a match.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first cache line stores a semaphore associated with the shared data.

### Claim 3 (depends on 1)

The method of claim 1, wherein the first portion comprises data indicating whether a second processor core is waiting to write to the shared data.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
executing a read operation for the shared data in response to the comparing indicating a match.

### Claim 5 (depends on 1)

The method of claim 1, wherein updating the second portion comprises:
adjusting the second portion of the first cache line to indicate an additional reader of the shared data.

### Claim 6 (depends on 4)

The method of claim 4, wherein the second portion of the first cache line indicates a number of processor cores that are concurrently reading the shared data.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
determining, that a second processor core is to access shared data; and
in response to the determining:
comparing a first portion of a second cache line to a second local copy at the second processor core; and
modifying a second portion of the second cache line in response to the comparing indicating a match.

### Claim 8

A processing system, comprising:
at least one processor comprising a first processor core, the processor configured to:
in response to determining that the first processor core is to access shared data:
compare a first portion of a first cache line to a first local copy at the first processor core; and
modify a second portion of the first cache line in response to the comparing indicating a match.

### Claim 9 (depends on 8)

The processing system of claim 8, wherein the first cache line stores a semaphore associated with the shared data.

### Claim 10 (depends on 9)

The processing system of claim 9, wherein the first portion comprises data indicating whether a second processor core is waiting to write to the shared.

### Claim 11 (depends on 8)

The processing system of claim 8, wherein the first processor core is to execute a read operation for the shared data in response to the comparing indicating a match.

### Claim 12 (depends on 11)

The processing system of claim 11, wherein the processor is to adjust the second portion of the first cache line to indicate an additional reader of the shared data.

### Claim 13 (depends on 11)

The processing system of claim 11, wherein the second portion of the first cache line indicates a number of processor cores that are concurrently reading the shared data.

### Claim 14 (depends on 8)

The processing system of claim 8, further comprising a second processor core, and wherein the processor is to:
in response to determining that the second processor core is to the access shared data:
compare a first portion of a second cache line to a second local copy at the second processor core; and
modify a second portion of the first cache line in response to the comparing indicating a match.

### Claim 15

A method, comprising:
comparing, at a first processor core, a first portion of a semaphore to a local count that corresponds to the first portion semaphore; and
obtaining access to shared data based on the comparing.

### Claim 16 (depends on 15)

The method of claim 15, wherein the first portion of the semaphore indicates whether a second processor core is to write to the shared data.

### Claim 17 (depends on 15)

The method of claim 15, further comprising updating a second portion of the semaphore based on the comparing.

### Claim 18 (depends on 17)

The method of claim 17, wherein the second portion indicates a number of processor cores that are to read the shared data.

### Claim 19 (depends on 15)

The method of claim 15, wherein comparing comprises comparing the first portion of the semaphore stored at a cache associated with the processor core.

### Claim 20 (depends on 15)

The method of claim 15, wherein obtaining access comprises obtaining access in response to the comparing indicating a match.
