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: Dmitry Selyutin
Subject: Re: [Tinycc-devel] [PATCH] stdatomic: ld/st/xchg/cmpxchg on simple types
Date: Mon, 22 Mar 2021 20:38:41 +0300

> But the atomic functions don't do that.
This is wrong. It's not mentioned where they do it or not, because
it's out of scope of atomics how the function passes arguments and how
it returns them.
All that is mentioned is that for naturally-aligned type N there might
be a call generated to routine __atomic_X_N, and that's all.
And this routine, indeed, will return the result as other routines
generally do. But it has nothing to do with the "is it really the same
type?" debates.
An implementation can even inline the code of these "optimized
routines", and most implementations do, indeed.
Other uses, which don't fall into "optimized" category, indeed can
cause the compiler to generate __atomic_X call instead of __atomic_X_N
call.



reply via email to

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