Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono][interp] Mask all shift amounts #90666

Merged
merged 2 commits into from
Aug 23, 2023
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
18 changes: 9 additions & 9 deletions src/mono/mono/mini/interp/interp-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,57 +215,57 @@ interp_v128_i2_op_left_shift (gpointer res, gpointer v1, gpointer s1)
static void
interp_v128_i4_op_left_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_i4*)res = *(v128_i4*)v1 << *(gint32*)s1;
*(v128_i4*)res = *(v128_i4*)v1 << (*(gint32*)s1 & 31);
}

static void
interp_v128_i8_op_left_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_i8*)res = *(v128_i8*)v1 << *(gint32*)s1;
*(v128_i8*)res = *(v128_i8*)v1 << (*(gint32*)s1 & 63);
}

// op_RightShift
static void
interp_v128_i1_op_right_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_i1*)res = *(v128_i1*)v1 >> *(gint32*)s1;
*(v128_i1*)res = *(v128_i1*)v1 >> (*(gint32*)s1 & 7);
}

static void
interp_v128_i2_op_right_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_i2*)res = *(v128_i2*)v1 >> *(gint32*)s1;
*(v128_i2*)res = *(v128_i2*)v1 >> (*(gint32*)s1 & 15);
}

static void
interp_v128_i4_op_right_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_i4*)res = *(v128_i4*)v1 >> *(gint32*)s1;
*(v128_i4*)res = *(v128_i4*)v1 >> (*(gint32*)s1 & 31);
}

// op_UnsignedRightShift
static void
interp_v128_i1_op_uright_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_u1*)res = *(v128_u1*)v1 >> *(gint32*)s1;
*(v128_u1*)res = *(v128_u1*)v1 >> (*(gint32*)s1 & 7);
}

static void
interp_v128_i2_op_uright_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_u2*)res = *(v128_u2*)v1 >> *(gint32*)s1;
*(v128_u2*)res = *(v128_u2*)v1 >> (*(gint32*)s1 & 15);
}

static void
interp_v128_i4_op_uright_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_u4*)res = *(v128_u4*)v1 >> *(gint32*)s1;
*(v128_u4*)res = *(v128_u4*)v1 >> (*(gint32*)s1 & 31);
}

static void
interp_v128_i8_op_uright_shift (gpointer res, gpointer v1, gpointer s1)
{
*(v128_u8*)res = *(v128_u8*)v1 >> *(gint32*)s1;
*(v128_u8*)res = *(v128_u8*)v1 >> (*(gint32*)s1 & 63);
}

// op_OnesComplement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace JIT.HardwareIntrinsics.General
public static partial class Program
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89938", TestRuntimes.Mono)]
public static void {Method}{RetBaseType}{Imm}()
{
var test = new VectorImmBinaryOpTest__{Method}{RetBaseType}{Imm}();
Expand Down
Loading