Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixed WASM builds.
  • Loading branch information
jandupej committed Apr 14, 2023
commit 42dd837a0049becfd147de68ff2fd1814b39caa3
36 changes: 18 additions & 18 deletions src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,11 +1845,26 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
}
case SN_WidenLower:
case SN_WidenUpper: {
#if defined(TARGET_ARM64) || defined(TARGET_WASM)
if (!is_element_type_primitive (fsig->params [0]))
return NULL;

if (COMPILE_LLVM (cfg)) {
#if defined(TARGET_ARM64)
if (!COMPILE_LLVM (cfg)) {
int subop = 0;
gboolean is_upper = (id == SN_WidenUpper);
if (type_enum_is_float (arg0_type))
subop = is_upper ? OP_SIMD_FCVTL2 : OP_SIMD_FCVTL;
else if (type_enum_is_unsigned (arg0_type))
subop = is_upper ? OP_ARM64_UXTL2 : OP_ARM64_UXTL;
else
subop = is_upper ? OP_ARM64_SXTL2 : OP_ARM64_SXTL;

MonoInst* ins = emit_simd_ins (cfg, klass, OP_XUNOP, args [0]->dreg, -1);
ins->inst_c0 = subop;
ins->inst_c1 = arg0_type;
return ins;
}
#endif
#if defined(TARGET_ARM64) || defined(TARGET_WASM)
int op = id == SN_WidenLower ? OP_XLOWER : OP_XUPPER;
MonoInst *lower_or_upper_half = emit_simd_ins_for_sig (cfg, klass, op, 0, arg0_type, fsig, args);
if (type_enum_is_float (arg0_type)) {
Expand All @@ -1860,21 +1875,6 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
op = type_enum_is_unsigned (arg0_type) ? OP_SIMD_USHLL : OP_SIMD_SSHLL;
return emit_simd_ins (cfg, klass, op, lower_or_upper_half->dreg, zero);
}
} else {
int op = 0;
gboolean is_upper = (id == SN_WidenUpper);
if (type_enum_is_float (arg0_type))
op = is_upper ? OP_SIMD_FCVTL2 : OP_SIMD_FCVTL;
else if (type_enum_is_unsigned (arg0_type))
op = is_upper ? OP_ARM64_UXTL2 : OP_ARM64_UXTL;
else
op = is_upper ? OP_ARM64_SXTL2 : OP_ARM64_SXTL;

MonoInst* ins = emit_simd_ins (cfg, klass, OP_XUNOP, args [0]->dreg, -1);
ins->inst_c0 = op;
ins->inst_c1 = arg0_type;
return ins;
}
#else
return NULL;
#endif
Expand Down