tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] [PATCH] stdatomic: ld/st/xchg/cmpxchg on simple types


From: Michael Matz
Subject: Re: [Tinycc-devel] [PATCH] stdatomic: ld/st/xchg/cmpxchg on simple types
Date: Mon, 22 Mar 2021 16:14:00 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Sat, 20 Mar 2021, Dmitry Selyutin wrote:

This needs casts, both sign- and type-wise, e.g. signed long long to
unsigned char, and has no way to enforce type safety, even in the minimal
form. A minimally suitable form would require a statement expression, plus
typeof, and even then it would have to be tuned to work with types that are
binary compatible (at least casts are needed). I don't see that many
benefits there. This is a deceptive simplicity which doesn't buy you much
after all. Per-type functions, on the other hand, are known to be generated
by other compilers, so you can be compatible with the code they produce,
whilst keeping other pros, like type deduction and using zero non-portable
extensions.

Within the implementation of compiler provided facilities itself we can make use of any non-portable extensions we like.

Type safety already goes out the window with type generic functions.
Dispatching to per-type functions (instead of per-size ones) is mere busy work; all that code is generated and implementation specific, not user visible.


Ciao,
Michael.

reply via email to

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