Skip to content

Commit 3e239f8

Browse files
saitama951lewing
andauthored
[Mono][Win] Incorrect decomposition of simd calls (#116433)
* Incorrect decomposition of simd calls simd decomposition for OP_ARG cases for simd calls in handled incorrectly currently the decomposition intrinsic takes place based on a xcall but later on this xcall is decomposed into a vcall where the return register is removed. fixes #116287 * add missing semicolon --------- Co-authored-by: Larry Ewing <[email protected]>
1 parent 23323e9 commit 3e239f8

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

src/mono/mono/mini/simd-intrinsics.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6717,21 +6717,29 @@ mono_emit_common_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSi
67176717
static gboolean
67186718
decompose_vtype_opt_uses_simd_intrinsics (MonoCompile *cfg, MonoInst *ins)
67196719
{
6720-
if (cfg->uses_simd_intrinsics)
6721-
return TRUE;
6720+
switch (ins->opcode) {
6721+
case OP_XCALL:
6722+
case OP_XCALL_REG:
6723+
case OP_XCALL_MEMBASE:
6724+
return FALSE;
6725+
}
6726+
6727+
if (cfg->uses_simd_intrinsics)
6728+
return TRUE;
6729+
6730+
switch (ins->opcode) {
6731+
case OP_XMOVE:
6732+
case OP_XZERO:
6733+
case OP_XPHI:
6734+
case OP_LOADX_MEMBASE:
6735+
case OP_LOADX_ALIGNED_MEMBASE:
6736+
case OP_STOREX_MEMBASE:
6737+
case OP_STOREX_ALIGNED_MEMBASE_REG:
6738+
return TRUE;
6739+
default:
6740+
return FALSE;
6741+
}
67226742

6723-
switch (ins->opcode) {
6724-
case OP_XMOVE:
6725-
case OP_XZERO:
6726-
case OP_XPHI:
6727-
case OP_LOADX_MEMBASE:
6728-
case OP_LOADX_ALIGNED_MEMBASE:
6729-
case OP_STOREX_MEMBASE:
6730-
case OP_STOREX_ALIGNED_MEMBASE_REG:
6731-
return TRUE;
6732-
default:
6733-
return FALSE;
6734-
}
67356743
}
67366744

67376745
static void

0 commit comments

Comments
 (0)