tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] [PATCH 0/4] stdatomic: code generators


From: Dmitry Selyutin
Subject: Re: [Tinycc-devel] [PATCH 0/4] stdatomic: code generators
Date: Mon, 15 Feb 2021 13:08:17 +0300

I've posted already a WIP version of atomics-as-support library for amd64.
Attached it again.
This can be implemented for all architectures without writing assembly by hand for each platform. I actually had such script by the time I started implementing std atomics; this is basically bunch on Python statements which generate C wrappers for each function and for each size (8, 16, 32, 64). Then, these wrappers can be converted into assembly with the help of some compiler which already supports atomics. I can try to find the script, or re-implement it from scratch. But I still think per-platform code generation is a better option.

Implementing them as functions does harm performance, but maybe that's not
a very big problem since the atomic itself incurs a decent performance
hit?
I'm not sure of which performance hit do you speak; lock impose some performance degradation, but not all instructions require this (load/store don't, xchng is locked by design; other architectures do it differently). Calling a function from another TU involves more overhead, at least for the first-time call.

reply via email to

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