Skip to content

Commit 78ae2de

Browse files
authored
[NVPTX] Load/Store/Fence syncscope support (#106101)
Adds "initial" support for `syncscope` to the NVPTX backend `load`/`store`/`fence` instructions. Atomic Read-Modify-Write operations intentionally not supported as part of this initial PR.
1 parent 8e8a072 commit 78ae2de

15 files changed

+5444
-868
lines changed

llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp

Lines changed: 160 additions & 125 deletions
Large diffs are not rendered by default.

llvm/lib/Target/NVPTX/NVPTX.h

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,37 @@ enum Ordering : OrderingUnderlyingType {
117117
// Consume = 3, // Unimplemented in LLVM; NVPTX would map to "Acquire"
118118
Acquire = (OrderingUnderlyingType)AtomicOrdering::Acquire,
119119
Release = (OrderingUnderlyingType)AtomicOrdering::Release,
120-
// AcquireRelease = 6, // TODO
120+
AcquireRelease = (OrderingUnderlyingType)AtomicOrdering::AcquireRelease,
121121
SequentiallyConsistent =
122122
(OrderingUnderlyingType)AtomicOrdering::SequentiallyConsistent,
123123
Volatile = SequentiallyConsistent + 1,
124124
RelaxedMMIO = Volatile + 1,
125-
LAST = RelaxedMMIO
125+
LASTORDERING = RelaxedMMIO
126126
};
127127

128-
namespace PTXLdStInstCode {
129-
enum AddressSpace {
130-
GENERIC = 0,
131-
GLOBAL = 1,
132-
CONSTANT = 2,
133-
SHARED = 3,
134-
PARAM = 4,
135-
LOCAL = 5
128+
using ScopeUnderlyingType = unsigned int;
129+
enum Scope : ScopeUnderlyingType {
130+
Thread = 0,
131+
Block = 1,
132+
Cluster = 2,
133+
Device = 3,
134+
System = 4,
135+
LASTSCOPE = System
136+
};
137+
138+
using AddressSpaceUnderlyingType = unsigned int;
139+
enum AddressSpace : AddressSpaceUnderlyingType {
140+
Generic = 0,
141+
Global = 1,
142+
Shared = 3,
143+
Const = 4,
144+
Local = 5,
145+
146+
// NVPTX Backend Private:
147+
Param = 101
136148
};
149+
150+
namespace PTXLdStInstCode {
137151
enum FromType {
138152
Unsigned = 0,
139153
Signed,

0 commit comments

Comments
 (0)