diff --git a/src/coreclr/jit/lclmorph.cpp b/src/coreclr/jit/lclmorph.cpp index cd464797e79890..ecb01980013518 100644 --- a/src/coreclr/jit/lclmorph.cpp +++ b/src/coreclr/jit/lclmorph.cpp @@ -2020,7 +2020,7 @@ class LocalAddressVisitor final : public GenTreeVisitor } if ((genTypeSize(indir) == genTypeSize(varDsc)) && (genTypeSize(indir) <= TARGET_POINTER_SIZE) && - (varTypeIsFloating(indir) || varTypeIsFloating(varDsc))) + (varTypeIsFloating(indir) || varTypeIsFloating(varDsc)) && !varDsc->lvPromoted) { return IndirTransform::BitCast; } diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.cs b/src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.cs new file mode 100644 index 00000000000000..f590d9fee539df --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Numerics; +using System.Runtime.Intrinsics; +using System.Runtime.CompilerServices; +using Xunit; + +public class Runtime_120414 +{ + [MethodImpl(MethodImplOptions.NoInlining)] + private static Vector128 DuplicateFromVec2(Vector2 s) => + Vector128.Create(Unsafe.As(ref s)).AsSingle(); + + [Fact] + public static void TestEntryPoint() + { + Vector2 testVec = new Vector2(1.0f, 0.5f); + Vector128 result = DuplicateFromVec2(testVec); + Assert.Equal(1.0f, result[0]); + Assert.Equal(0.5f, result[1]); + Assert.Equal(1.0f, result[2]); + Assert.Equal(0.5f, result[3]); + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.csproj new file mode 100644 index 00000000000000..501217e4d86892 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.csproj @@ -0,0 +1,9 @@ + + + None + True + + + + +