Skip to content

Struct copy using movs rather than SSE on x64 #7469

Open
@benaadams

Description

@benaadams

Assigning a struct to another static variable struct (Memory<T> below)

public struct Memory<T> : IEquatable<Memory<T>>, IEquatable<ReadOnlyMemory<T>>
{
    readonly OwnedMemory<T> _owner;
    readonly int _id;
    readonly int _index;
    readonly int _length;
}

Can generate a movs copy

movs        qword ptr [rdi],qword ptr [rsi]  
movs        qword ptr [rdi],qword ptr [rsi]

Would this be better as a SSE copy?

movdqu      xmm0,xmmword ptr [rsi]  
movdqu      xmmword ptr [rdi],xmm0

As seen in dotnet/corefxlab#1227 (comment)

/cc @mikedn
category:cq
theme:block-opts
skill-level:intermediate
cost:small
impact:medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions