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] MiniJIT OP_XEQUAL for floats #77770

Merged
merged 7 commits into from
Nov 11, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ public void VectorSingleEqualsNaNTest()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/74781", TestRuntimes.Mono)]
public void VectorDoubleEqualsNonCanonicalNaNTest()
{
// max 8 bit exponent, just under half max mantissa
Expand All @@ -880,7 +879,6 @@ public void VectorDoubleEqualsNonCanonicalNaNTest()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/74781", TestRuntimes.Mono)]
public void VectorSingleEqualsNonCanonicalNaNTest()
{
// max 11 bit exponent, just under half max mantissa
Expand Down
10 changes: 9 additions & 1 deletion src/mono/mono/mini/mini-amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -3882,8 +3882,16 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb)
case OP_XEQUAL: {
int temp_reg1 = mono_alloc_ireg (cfg);
int temp_reg2 = mono_alloc_ireg (cfg);
int opcode= -1;
switch (ins->inst_c1)
{
case MONO_TYPE_R4: opcode = OP_COMPPS; break;
case MONO_TYPE_R8: opcode = OP_COMPPD; break;
default: opcode = OP_PCMPEQD;
}

NEW_SIMD_INS (cfg, ins, temp, OP_PCMPEQD, temp_reg1, ins->sreg1, ins->sreg2);
NEW_SIMD_INS (cfg, ins, temp, opcode, temp_reg1, ins->sreg1, ins->sreg2);
fanyang-mono marked this conversation as resolved.
Show resolved Hide resolved
temp->inst_c0 = 0;
NEW_SIMD_INS (cfg, ins, temp, OP_EXTRACT_MASK, temp_reg2, temp_reg1, -1);
temp->type = STACK_I4;
NEW_INS (cfg, ins, temp, OP_COMPARE_IMM);
Expand Down
5 changes: 4 additions & 1 deletion src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ emit_xequal (MonoCompile *cfg, MonoClass *klass, MonoInst *arg1, MonoInst *arg2)
else
return emit_simd_ins (cfg, klass, OP_XEQUAL, arg1->dreg, arg2->dreg);
#else
return emit_simd_ins (cfg, klass, OP_XEQUAL, arg1->dreg, arg2->dreg);
MonoInst *ins = emit_simd_ins (cfg, klass, OP_XEQUAL, arg1->dreg, arg2->dreg);
if (!COMPILE_LLVM (cfg))
ins->inst_c1 = mono_class_get_context (klass)->class_inst->type_argv [0]->type;
return ins;
#endif
}

Expand Down