-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue
Milestone
Description
As per #64354 (comment)
For cases when we need to access a field using Store-Release semantic with an offset we can do that in a single instruction stlur/ldur.
Thanks to @neon-sunset for checking it on Apple M1 (arm64 v8.5), e.g.:
class MyClass
{
public:
std::atomic<int> x;
std::atomic<int> y;
};
void Foo(MyClass* cls)
{
cls->x = 42;
cls->y = 42;
}compiles down to:
Foo(MyClass*):
mov w1, 42
stlr w1, [x0]
stlur w1, [x0, 4]
retwhile we currently emit something like:
mov w1, 42
stlr w1, [x0]
add x0, x0, #4
stlr w1, [x0]
retcategory:cq
theme:basic-cq
skill-level:beginner
cost:small
impact:small
omariom
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue