Bug 20020 – Compiler should offer atomic intrinsics

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-07-02T02:11:46Z
Last change time
2024-12-13T19:04:30Z
Assigned to
No Owner
Creator
Manu
Moved to GitHub: dmd#19598 →

Comments

Comment #0 by turkeyman — 2019-07-02T02:11:46Z
It would be classy if DMD offered a suite of intrinsic functions for the primitive atomic operations like other compilers. It would make it much easier to develop quality atomic support libraries. For reference, this is the quite of intrinsics exposed my the MSVC compiler: __MACHINE(long _InterlockedAnd(long volatile * _Value, long _Mask)) __MACHINE(short _InterlockedAnd16(short volatile * _Value, short _Mask)) __MACHINE(char _InterlockedAnd8(char volatile * _Value, char _Mask)) __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedCompareExchange(long volatile * _Destination, long _Exchange, long _Comparand)) __MACHINEWVMPURE(long _InterlockedCompareExchange(long volatile * _Destination, long _Exchange, long _Comparand)) __MACHINE(short _InterlockedCompareExchange16(short volatile * _Destination, short _Exchange, short _Comparand)) __MACHINE(__int64 _InterlockedCompareExchange64(__int64 volatile * _Destination, __int64 _Exchange, __int64 _Comparand)) __MACHINE(char _InterlockedCompareExchange8(char volatile * _Destination, char _Exchange, char _Comparand)) __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedDecrement(long volatile * _Addend)) __MACHINEWVMPURE(long _InterlockedDecrement(long volatile * _Addend)) __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedExchange(long volatile * _Target, long _Value)) __MACHINEWVMPURE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedExchange(long volatile * _Target, long _Value)) __MACHINE(short _InterlockedExchange16(short volatile * _Target, short _Value)) __MACHINE(char _InterlockedExchange8(char volatile * _Target, char _Value)) __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedExchangeAdd(long volatile * _Addend, long _Value)) __MACHINE(short _InterlockedExchangeAdd16(short volatile * _Addend, short _Value)) __MACHINE(char _InterlockedExchangeAdd8(char volatile * _Addend, char _Value)) __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedIncrement(long volatile * _Addend)) __MACHINEWVMPURE(long _InterlockedIncrement(long volatile * _Addend)) __MACHINE(long _InterlockedOr(long volatile * _Value, long _Mask)) __MACHINE(short _InterlockedOr16(short volatile * _Value, short _Mask)) __MACHINE(char _InterlockedOr8(char volatile * _Value, char _Mask)) __MACHINE(long _InterlockedXor(long volatile * _Value, long _Mask)) __MACHINE(short _InterlockedXor16(short volatile * _Value, short _Mask)) __MACHINE(char _InterlockedXor8(char volatile * _Value, char _Mask)) __MACHINE(void _ReadWriteBarrier(void)) __MACHINE(unsigned char _interlockedbittestandset(long volatile *, long))
Comment #1 by robert.schadek — 2024-12-13T19:04:30Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19598 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB