Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -8433,7 +8433,21 @@ MONO_RESTORE_WARNING
LLVMValueRef dest;

dest = convert (ctx, LLVMBuildAdd (builder, convert (ctx, values [ins->inst_destbasereg], IntPtrType ()), LLVMConstInt (IntPtrType (), ins->inst_offset, FALSE), ""), pointer_type (t));
mono_llvm_build_aligned_store (builder, lhs, dest, FALSE, 1);
if (mono_class_value_size (ins->klass, NULL) == 12) {
const int mask_values [] = { 0, 1, 2 };

LLVMValueRef truncatedVec3 = LLVMBuildShuffleVector (
builder,
lhs,
LLVMGetUndef (t),
create_const_vector_i32 (mask_values, 3),
"truncated_vec3"
);

mono_llvm_build_aligned_store (builder, truncatedVec3, dest, FALSE, 1);
} else {
mono_llvm_build_aligned_store (builder, lhs, dest, FALSE, 1);
}
break;
}
case OP_XBINOP:
Expand Down
24 changes: 24 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_110820/Runtime_110820.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Xunit;
using System.Numerics;

public class Foo
{
public Vector3 v1;
public Vector3 v2;
}

public class Runtime_110820
{
[Fact]
public static void TestEntryPoint()
{
var foo = new Foo();
foo.v2 = new Vector3(4, 5, 6);
foo.v1 = new Vector3(1, 2, 3);
Assert.Equal(new Vector3(1, 2, 3), foo.v1);
Assert.Equal(new Vector3(4, 5, 6), foo.v2);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
Loading