@@ -5403,6 +5403,50 @@ def AtomicCmpXchg : CIR_Op<"atomic.cmp_xchg",
5403
5403
let hasVerifier = 0;
5404
5404
}
5405
5405
5406
+ def MemScopeEnum : EnumAttr<"Memory scope enumeration"> {
5407
+ let underlying_type = "uint32_t";
5408
+ let enumerants = [
5409
+ Enumerant<"single_thread", "Applies to the calling thread only", 0>
5410
+ Enumerant<"system", "Spans the entire system", 1>
5411
+ ];
5412
+ }
5413
+
5414
+ def AtomicOrderingEnum : EnumAttr<"Atomic memory ordering enumeration"> {
5415
+ let underlying_type = "uint32_t";
5416
+ let enumerants = [
5417
+ Enumerant<"relaxed", "No ordering constraints", 0>,
5418
+ Enumerant<"acquire", "All subsequent memory operations occur after this fence", 1>,
5419
+ Enumerant<"release", "All prior memory operations occur before this fence", 2>,
5420
+ Enumerant<"acq_rel", "Combines acquire and release semantics", 3>,
5421
+ Enumerant<"seq_cst", "Enforces sequential consistency", 4>
5422
+ ];
5423
+ };
5424
+
5425
+ def AtomicFenceOp : CIR_Op<"atomic.thread_fence"> {
5426
+ let summary = "Atomic thread fence";
5427
+ let description = [{
5428
+ C/C++ Atomic thread fence synchronization primitive. Implements the builtin
5429
+ `__atomic_thread_fence` which enforces memory ordering constraints across
5430
+ threads within the specified synchronization scope.
5431
+
5432
+ Example:
5433
+
5434
+
5435
+ }];
5436
+ let results = (outs);
5437
+ let arguments = (ins Attr<EnumAttr<["single_thread", "system"]>,
5438
+ "synchronization scope":$sync_scope,
5439
+ Attr<EnumAttr<["relaxed", "acquire", "release", "acq_rel", "seq_cst"]>,
5440
+ "atomic memory ordering":$ordering);
5441
+
5442
+ let assemblyFormat = [{
5443
+ `(` `sync_scope` `=` $sync_scope `,`
5444
+ `ordering` `=` $ordering `)` attr-dict
5445
+ }];
5446
+
5447
+ let hasVerifier = 1;
5448
+ }
5449
+
5406
5450
def SignBitOp : CIR_Op<"signbit", [Pure]> {
5407
5451
let summary = "Checks the sign of a floating-point number";
5408
5452
let description = [{
0 commit comments