January 08

On Wednesday, 8 January 2025 at 11:37:48 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

Dmd will not inline functions with inline assembly, any function calls should prevent reordering cpu side.

So any concern for ordering you have shouldn't matter for dmd, its ldc and gdc that you need to be worried about.

Visible reordering can occur due to the asynchronous nature of inter-core communication, which is relevant for ARM and other architectures.

So it looks like we need macros that will insert inline opcodes for memory barriers:

writeToBuffer;
mixin(Store_Store);
writeToOffset;
readFromBuffer;
mixin(Load_Store);
writeToOffset;
January 09
On 09/01/2025 1:01 AM, Jin wrote:
> On Wednesday, 8 January 2025 at 11:37:48 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> Dmd will not inline functions with inline assembly, any function calls should prevent reordering cpu side.
>>
>> So any concern for ordering you have shouldn't matter for dmd, its ldc and gdc that you need to be worried about.
> 
> Visible reordering can occur due to the asynchronous nature of inter- core communication, which is relevant for ARM and other architectures.
> 
> So it looks like we need macros that will insert inline opcodes for memory barriers:
> 
> ```d
> writeToBuffer;
> mixin(Store_Store);
> writeToOffset;
> ```
> 
> ```d
> readFromBuffer;
> mixin(Load_Store);
> writeToOffset;
> ```

Not macros, what you want is intrinsics, this is how core.atomics works for ldc/gdc.

In this case ``atomicFence``.

https://dlang.org/phobos/core_atomic.html#.atomicFence

January 13

On Wednesday, 8 January 2025 at 12:10:19 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

Not macros, what you want is intrinsics, this is how core.atomics works for ldc/gdc.

In this case atomicFence.

https://dlang.org/phobos/core_atomic.html#.atomicFence

Unfortunately, support from all compilers to wait long. The library could be realized now.

1 2 3 4 5 6 7
Next ›   Last »