KEMBAR78
[arm64] JIT: Volatile.Write emits full memory barrier for floats · Issue #67254 · dotnet/runtime · GitHub
Skip to content

[arm64] JIT: Volatile.Write emits full memory barrier for floats #67254

@EgorBo

Description

@EgorBo
double _location = 0;
double _newValue = 1;

void Write_double() => 
    Volatile.Write(ref _location, _newValue);

Currently emits a full memory barrier on arm64:

        A9BF7BFD          stp     fp, lr, [sp,#-16]!
        910003FD          mov     fp, sp
G_M10964_IG02:
        91002001          add     x1, x0, #8
        FD400810          ldr     d16, [x0,#16]
        D5033BBF          dmb     ish  ;;  <--- 
        FD000030          str     d16, [x1]
G_M10964_IG03:
        A8C17BFD          ldp     fp, lr, [sp],#16
        D65F03C0          ret     lr

Expected - use stlr + fmov

category:cq
theme:volatile

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIin-prThere is an active PR which will close this issue when it is mergedmemory modelissues associated with memory modeltenet-performancePerformance related issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions