Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

CarolEidt
Copy link

In a mismatched struct assignment, e.g. using Unsafe.As, we need to retain the OBJ(ADDR(lcl)) on the rhs of the assignment.

Fix #15237

In a mismatched struct assignment, e.g. using Unsafe.As, we need to retain the OBJ(ADDR(lcl)) on the rhs of the assignment.

Fix #15237
@CarolEidt
Copy link
Author

@benaadams - this incorporates your test case; I presume you're OK with that.
@dotnet/jit-contrib PTAL

There are zero jit-diffs for this change on Windows/x64 & x86. However, I plan to run desktop diffs on this as well before merging (I'm having some resource and other issues on my systems with desktop enlistments, so it might be a little while), since jit-diffs doesn't exercise Vector, as it uses crossgen.

@benaadams
Copy link
Member

this incorporates your test case; I presume you're OK with that.

It doesn't cover the exact pattern I'd like to use, closest is

Vector4 q = Unsafe.ReadUnaligned<Vector4>(ref Unsafe.As<QuaternionStruct, byte>(ref this));

I'd probably like to use a straight ref conversion -> value

Vector4 q = Unsafe.As<QuaternionStruct, Vector4>(ref this);

An hope as a result q would be a SIMD register?

@benaadams
Copy link
Member

Oh it does LengthSquaredUnsafeAs :)

@CarolEidt
Copy link
Author

There are zero diffs for desktop x64 as well.

@CarolEidt CarolEidt merged commit d5a9c01 into dotnet:master Jan 4, 2018
@CarolEidt CarolEidt deleted the Fix15237 branch January 4, 2018 23:35
@briansull
Copy link

Issue #15906 is also fixed with this changeset, or alternatively broken without this changset

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants