given the type will always be there since "no breaking changes"*, theres no reason at this point
given the type will always be there since "no breaking changes"*, theres no reason at this point
vsmovsd and it has a few less instructionsvzeroupper indicates SSE or something

C.Test(System.Numerics.Vector2, System.Numerics.Vector2)
L0000: vzeroupper
L0003: vmovsd xmm0, [esp+0xc]
L0009: vmovsd xmm1, [esp+4]
L000f: vaddps xmm0, xmm0, xmm1
L0013: vmovsd [edx], xmm0
L0017: ret 0x10
C.Test(Vec2, Vec2)
L0000: vzeroupper
L0003: vmovss xmm0, [esp+0xc]
L0009: vmovss xmm1, [esp+0x10]
L000f: vmovss xmm2, [esp+4]
L0015: vmovss xmm3, [esp+8]
L001b: vaddss xmm0, xmm0, xmm2
L001f: vaddss xmm1, xmm1, xmm3
L0023: vmovss [edx], xmm0
L0027: vmovss [edx+4], xmm1
L002c: ret 0x10vsmovsdC.Test(Vec2, Vec2)
L0000: sub esp, 0x30
L0003: vzeroupper
L0006: mov dword ptr [esp+0x2c], 0x3dbb9aab
L000e: mov eax, [esp+0x34]
L0012: mov [esp], eax
L0015: mov eax, [esp+0x38]
L0019: mov [esp+4], eax
L001d: mov eax, [esp+0x3c]
L0021: mov [esp+8], eax
L0025: mov eax, [esp+0x40]
L0029: mov [esp+0xc], eax
L002d: mov eax, [esp+8]
L0031: mov [esp+0x18], eax
L0035: mov eax, [esp+0xc]
L0039: mov [esp+0x1c], eax
L003d: mov eax, [esp]
L0040: mov [esp+0x10], eax
L0044: mov eax, [esp+4]
L0048: mov [esp+0x14], eax
L004c: xor eax, eax
L004e: mov [esp+0x20], eax
L0052: mov [esp+0x24], eax
L0056: vmovss xmm0, [esp+0x18]
L005c: vaddss xmm0, xmm0, [esp+0x10]
L0062: vmovss [esp+0x20], xmm0
L0068: vmovss xmm0, [esp+0x1c]
L006e: vaddss xmm0, xmm0, [esp+0x14]
L0074: vmovss [esp+0x24], xmm0
L007a: mov eax, [esp+0x20]
L007e: mov [edx], eax
L0080: mov eax, [esp+0x24]
L0084: mov [edx+4], eax
L0087: cmp dword ptr [esp+0x2c], 0x3dbb9aab
L008f: je short L0096
L0091: call 0x7219a540
L0096: add esp, 0x30
L0099: ret 0x10using System.Numerics;
public class C {
public Vector2 Test(Vector2 x, Vector2 y) {
return x + y;
}
public Vec2 Test(Vec2 x, Vec2 y) {
return x + y;
}
}
public struct Vec2
{
unsafe fixed float Values[2];
public static unsafe Vec2 operator +(Vec2 x, Vec2 y)
{
Vec2 ret = default;
ret.Values[0] = x.Values[0] + y.Values[0];
ret.Values[1] = x.Values[1] + y.Values[1];
return ret;
}
}vzeroupper