tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [PATCH 1/3] stdatomic: atomic builtins parsing suppor


From: Elijah Stone
Subject: Re: [Tinycc-devel] [PATCH 1/3] stdatomic: atomic builtins parsing support
Date: Tue, 26 Jan 2021 15:45:42 -0800 (PST)

On Tue, 26 Jan 2021, Dmitry Selyutin wrote:
+/* memory models */
+     DEF(TOK___ATOMIC_RELAXED, "__ATOMIC_RELAXED")
+     DEF(TOK___ATOMIC_CONSUME, "__ATOMIC_CONSUME")
+     DEF(TOK___ATOMIC_ACQUIRE, "__ATOMIC_ACQUIRE")
+     DEF(TOK___ATOMIC_RELEASE, "__ATOMIC_RELEASE")
+     DEF(TOK___ATOMIC_ACQ_REL, "__ATOMIC_ACQ_REL")
+     DEF(TOK___ATOMIC_SEQ_CST, "__ATOMIC_SEQ_CST")

Should these be tokens? I think it makes more sense for them to be preprocessor macros, as in gcc/clang.


+     DEF(TOK___atomic_store, "__atomic_store")
+     DEF(TOK___atomic_load, "__atomic_load")
+     DEF(TOK___atomic_exchange, "__atomic_exchange")
*snip*

GCC uses those same names for intrinsics with different semantics. (https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html)

I think supporting the GCC intrinsics would be cool, but that failing that we shouldn't collide with their names.

 -E



reply via email to

[Prev in Thread] Current Thread [Next in Thread]