Open hypeartist opened 8 months ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
Author: | hypeartist |
---|---|
Assignees: | - |
Labels: | `area-CodeGen-coreclr`, `untriaged` |
Milestone: | - |
Hardcoded constants work fine, but static
getters don't.
class Test
{
static Vector<uint> Method(Vector<uint> v)
{
return v << 8;
}
[JitGeneric(typeof(Struct))]
static Vector<uint> Method<TStruct>(Vector<uint> v) where TStruct : IInterface
{
return v << TStruct.Shift;
}
}
Test.Method(System.Numerics.Vector`1<UInt32>)
L0000: vzeroupper
L0003: vmovups ymm0, [rdx]
L0007: vpslld ymm0, ymm0, 8
L000c: vmovups [rcx], ymm0
L0010: mov rax, rcx
L0013: vzeroupper
L0016: ret
Test.Method[[Struct, _]](System.Numerics.Vector`1<UInt32>)
L0000: vzeroupper
L0003: vmovups ymm0, [rdx]
L0007: mov eax, 8
L000c: vmovd xmm1, eax
L0010: vpslld ymm0, ymm0, xmm1
L0014: vmovups [rcx], ymm0
L0018: mov rax, rcx
L001b: vzeroupper
L001e: ret
Actual codegen:
Expected codegen: