Skip to content

Where can I find the constructor of System.Numerics.Vector2? #99396

Closed Answered by huoyaoyuan
MinxuanZ asked this question in Q&A
Discussion options

You must be logged in to vote

The managed source is now in System.Private.CoreLib:

[Intrinsic]
public Vector2(float value) : this(value, value)
{
}

At runtime the body is not used and JIT specially expands it:

case NI_Vector2_Create:
{
assert(retType == TYP_VOID);
assert(simdBaseType == TYP_FLOAT);
assert(simdSize == 8);
if (op2->IsCnsFltOrDbl() && op3->IsCnsFltOrDbl())
{
GenTreeVecCon* vecCon = gtNewVconNode(TYP_SIMD8);
float cnsVal = 0;
v…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MinxuanZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants