Closed
Description
Update After #99011 Mono now uses the slower managed fallback implementations of these methods from src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs
:
public static byte CompareExchange(ref byte location1, byte value, byte comparand);
public static sbyte CompareExchange(ref sbyte location1, sbyte value, sbyte comparand);
public static short CompareExchange(ref short location1, short value, short comparand);
public static ushort CompareExchange(ref ushort location1, ushort value, ushort comparand);
and
public static byte Exchange(ref byte location1, byte value);
public static sbyte Exchange(ref sbyte location1, sbyte value);
public static short Exchange(ref short location1, short value);
public static ushort Exchange(ref ushort location1, ushort value);
We should implement intrinsics for them in the JIT and interpreter, instead.
Original issue
After #92974 is merged, we will have icalls for CompareExchange
and Exchange
for byte,
sbyte,
shortand
ushort`
We should also implement these intrinsics directly in the JIT/AOT and interpreter
Part of #64658