diff --git a/eng/native.wasm.targets b/eng/native.wasm.targets
index c72c24ff6df2d1..7e6754795c8717 100644
--- a/eng/native.wasm.targets
+++ b/eng/native.wasm.targets
@@ -56,12 +56,14 @@
false
false
false
+ false
<_CoreCLRPropertyThatTriggersRelinking Include="InvariantGlobalization" RuntimePackValue="$(BrowserHostInvariantGlobalization)" />
<_CoreCLRPropertyThatTriggersRelinking Include="InvariantTimezone" RuntimePackValue="$(BrowserHostInvariantTimezone)" />
<_CoreCLRPropertyThatTriggersRelinking Include="EnableDiagnostics" RuntimePackValue="$(BrowserHostEnableDiagnostics)" />
+ <_CoreCLRPropertyThatTriggersRelinking Include="WasmEnableRelaxedSimd" RuntimePackValue="$(BrowserHostEnableRelaxedSimd)" />
<_CoreCLRPropertyThatTriggersRelinking Include="WasmInitialHeapSize" RuntimePackValue="$(BrowserHostInitialHeapSize)" />
<_CoreCLRPropertyThatTriggersRelinking Include="EmccMaximumHeapSize" RuntimePackValue="$(BrowserHostMaximumHeapSize)" />
<_CoreCLRPropertyThatTriggersRelinking Include="EmccStackSize" RuntimePackValue="$(BrowserHostStackSize)" />
diff --git a/eng/pipelines/coreclr/hardware-intrinsics-wasm.yml b/eng/pipelines/coreclr/hardware-intrinsics-wasm.yml
index 4db8cafecc02a9..c21c1649ad19ba 100644
--- a/eng/pipelines/coreclr/hardware-intrinsics-wasm.yml
+++ b/eng/pipelines/coreclr/hardware-intrinsics-wasm.yml
@@ -28,4 +28,4 @@ extends:
parameters:
platforms:
- browser_wasm
- testBuildArgs: '/p:EnableWasmHWIntrinsicsTests=true -tree:JIT/HardwareIntrinsics/Wasm'
+ testBuildArgs: '/p:EnableWasmHWIntrinsicsTests=true /p:WasmEnableRelaxedSimd=true -tree:JIT/HardwareIntrinsics/Wasm'
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index 74c90c04774dc9..4d43fb63e1bbd3 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -1255,7 +1255,7 @@ extends:
runOnlyOnChromeVersionUpdate: true
shouldRunSmokeOnly: 'true'
nameSuffix: _SmokeMac
- extraBuildArgs: /p:AotHostArchitecture=arm64 /p:AotHostOS=$(_hostedOS)
+ extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
useHelixMonitor: ${{ variables.enableHelixJobMonitor }}
scenarios:
- WasmTestOnChrome
diff --git a/eng/testing/BrowserVersions.props b/eng/testing/BrowserVersions.props
index 6b37f314e7d5a5..07fbfadb0a4c94 100644
--- a/eng/testing/BrowserVersions.props
+++ b/eng/testing/BrowserVersions.props
@@ -12,9 +12,9 @@
1689415
https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1689481
15.4.80
- 140.11.0esr
+ 155.0.1
0.37.0
- 140.11.0esr
+ 155.0.1
0.37.0
\ No newline at end of file
diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets
index 63a30b0f8a6741..cd5d65bcf48071 100644
--- a/eng/testing/tests.wasm.targets
+++ b/eng/testing/tests.wasm.targets
@@ -89,12 +89,16 @@
-->
<_WasmIntrinsicsSubstitutions Condition="'$(WasmEnableSIMD)' != 'false'">WasmIntrinsics
<_WasmIntrinsicsSubstitutions Condition="'$(WasmEnableSIMD)' == 'false'">NoWasmIntrinsics
+ <_WasmRelaxedSimdSubstitutions Condition="'$(WasmEnableSIMD)' != 'false' and '$(WasmEnableRelaxedSimd)' == 'true'">WasmRelaxedSimd
+ <_WasmRelaxedSimdSubstitutions Condition="'$(WasmEnableSIMD)' != 'false' and '$(WasmEnableRelaxedSimd)' != 'true'">NoWasmRelaxedSimd
<_WasmIntrinsicsSubstitutions Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(PublishReadyToRun)' != 'true'">NoWasmIntrinsics
+ <_WasmRelaxedSimdSubstitutions Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(PublishReadyToRun)' != 'true'">
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --substitutions "$(BrowserProjectRoot)build\ILLink.Substitutions.$(_WasmIntrinsicsSubstitutions).xml"
+ <_ExtraTrimmerArgs Condition="'$(_WasmRelaxedSimdSubstitutions)' != ''">$(_ExtraTrimmerArgs) --substitutions "$(BrowserProjectRoot)build\ILLink.Substitutions.$(_WasmRelaxedSimdSubstitutions).xml"
@@ -165,6 +169,7 @@
<_WasmPropertyNames Include="WasmBuildNative" />
<_WasmPropertyNames Include="WasmDebugLevel" />
<_WasmPropertyNames Include="WasmDedup" />
+ <_WasmPropertyNames Include="WasmEnableRelaxedSimd" />
<_WasmPropertyNames Include="WasmLinkIcalls" />
<_WasmPropertyNames Include="WasmNativeStrip" />
<_WasmPropertyNames Include="WasmNativeDebugSymbols" />
diff --git a/src/coreclr/inc/corinfoinstructionset.h b/src/coreclr/inc/corinfoinstructionset.h
index 2f347572ee34d4..2d43c6cb2d925f 100644
--- a/src/coreclr/inc/corinfoinstructionset.h
+++ b/src/coreclr/inc/corinfoinstructionset.h
@@ -70,6 +70,7 @@ enum CORINFO_InstructionSet
InstructionSet_WasmBase=1,
InstructionSet_PackedSimd=2,
InstructionSet_Vector128=3,
+ InstructionSet_RelaxedSimd=4,
#endif // TARGET_WASM
#ifdef TARGET_AMD64
InstructionSet_X86Base=1,
@@ -473,6 +474,8 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins
#ifdef TARGET_WASM
if (resultflags.HasInstructionSet(InstructionSet_Vector128) && !resultflags.HasInstructionSet(InstructionSet_PackedSimd))
resultflags.RemoveInstructionSet(InstructionSet_Vector128);
+ if (resultflags.HasInstructionSet(InstructionSet_RelaxedSimd) && !resultflags.HasInstructionSet(InstructionSet_PackedSimd))
+ resultflags.RemoveInstructionSet(InstructionSet_RelaxedSimd);
if (resultflags.HasInstructionSet(InstructionSet_PackedSimd) && !resultflags.HasInstructionSet(InstructionSet_WasmBase))
resultflags.RemoveInstructionSet(InstructionSet_PackedSimd);
#endif // TARGET_WASM
@@ -785,6 +788,8 @@ inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet)
return "PackedSimd";
case InstructionSet_Vector128 :
return "Vector128";
+ case InstructionSet_RelaxedSimd :
+ return "RelaxedSimd";
#endif // TARGET_WASM
#ifdef TARGET_AMD64
case InstructionSet_X86Base :
@@ -993,6 +998,7 @@ inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInst
#ifdef TARGET_WASM
case READYTORUN_INSTRUCTION_WasmBase: return InstructionSet_WasmBase;
case READYTORUN_INSTRUCTION_PackedSimd: return InstructionSet_PackedSimd;
+ case READYTORUN_INSTRUCTION_RelaxedSimd: return InstructionSet_RelaxedSimd;
#endif // TARGET_WASM
#ifdef TARGET_AMD64
case READYTORUN_INSTRUCTION_X86Base: return InstructionSet_X86Base;
diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h
index 529831e7e5aada..aef310a48c8bda 100644
--- a/src/coreclr/inc/jiteeversionguid.h
+++ b/src/coreclr/inc/jiteeversionguid.h
@@ -37,11 +37,11 @@
#include
-constexpr GUID JITEEVersionIdentifier = { /* d3368fe9-d21b-4c5c-9786-49f591047bf7 */
- 0xd3368fe9,
- 0xd21b,
- 0x4c5c,
- {0x97, 0x86, 0x49, 0xf5, 0x91, 0x04, 0x7b, 0xf7}
+constexpr GUID JITEEVersionIdentifier = { /* d663060e-9184-48cb-b7dc-c8afa4b33a82 */
+ 0xd663060e,
+ 0x9184,
+ 0x48cb,
+ {0xb7, 0xdc, 0xc8, 0xaf, 0xa4, 0xb3, 0x3a, 0x82}
};
#endif // JIT_EE_VERSIONING_GUID_H
diff --git a/src/coreclr/inc/readytoruninstructionset.h b/src/coreclr/inc/readytoruninstructionset.h
index d2851e91577f1e..4e1c644737d4ff 100644
--- a/src/coreclr/inc/readytoruninstructionset.h
+++ b/src/coreclr/inc/readytoruninstructionset.h
@@ -103,6 +103,7 @@ enum ReadyToRunInstructionSet
READYTORUN_INSTRUCTION_Cssc=93,
READYTORUN_INSTRUCTION_Zicond=94,
READYTORUN_INSTRUCTION_Fp16=95,
+ READYTORUN_INSTRUCTION_RelaxedSimd=96,
};
diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp
index d84f1dfa732107..9d29971768efa5 100644
--- a/src/coreclr/jit/hwintrinsic.cpp
+++ b/src/coreclr/jit/hwintrinsic.cpp
@@ -1019,6 +1019,7 @@ static const HWIntrinsicIsaRange hwintrinsicIsaRangeArray[] = {
{ FIRST_NI_WasmBase, LAST_NI_WasmBase }, // WasmBase
{ FIRST_NI_PackedSimd, LAST_NI_PackedSimd }, // PackedSimd
{ FIRST_NI_Vector, LAST_NI_Vector }, // Vector128
+ { FIRST_NI_RelaxedSimd, LAST_NI_RelaxedSimd }, // RelaxedSimd
#else
#error Unsupported platform
#endif
diff --git a/src/coreclr/jit/hwintrinsiclistwasm.h b/src/coreclr/jit/hwintrinsiclistwasm.h
index c639f343656889..c07b42396f6105 100644
--- a/src/coreclr/jit/hwintrinsiclistwasm.h
+++ b/src/coreclr/jit/hwintrinsiclistwasm.h
@@ -82,6 +82,21 @@ HARDWARE_INTRINSIC(PackedSimd, ZeroExtendWideningLower,
HARDWARE_INTRINSIC(PackedSimd, ZeroExtendWideningUpper, 16, 1, INS_i16x8_extend_high_u_i8x16, INS_i16x8_extend_high_u_i8x16, INS_i32x4_extend_high_u_i16x8, INS_i32x4_extend_high_u_i16x8, INS_i64x2_extend_high_u_i32x4, INS_i64x2_extend_high_u_i32x4, INS_invalid, INS_invalid, INS_invalid, INS_invalid, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
#define LAST_NI_PackedSimd NI_PackedSimd_ZeroExtendWideningUpper
+// RelaxedSimd Intrinsics
+#define FIRST_NI_RelaxedSimd NI_RelaxedSimd_ConvertToInt32Native
+HARDWARE_INTRINSIC(RelaxedSimd, ConvertToInt32Native, 16, 1, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_i32x4_relaxed_trunc_f32x4_s, INS_i32x4_relaxed_trunc_f64x2_s_zero, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(RelaxedSimd, ConvertToUInt32Native, 16, 1, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_i32x4_relaxed_trunc_f32x4_u, INS_i32x4_relaxed_trunc_f64x2_u_zero, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(RelaxedSimd, DotProductAddNative, 16, 3, INS_i32x4_relaxed_dot_i8x16_i7x16_add_s, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(RelaxedSimd, DotProductNative, 16, 2, INS_i16x8_relaxed_dot_i8x16_i7x16_s, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(RelaxedSimd, LaneSelectNative, 16, 3, INS_i8x16_relaxed_laneselect, INS_i8x16_relaxed_laneselect, INS_i16x8_relaxed_laneselect, INS_i16x8_relaxed_laneselect, INS_i32x4_relaxed_laneselect, INS_i32x4_relaxed_laneselect, INS_i64x2_relaxed_laneselect, INS_i64x2_relaxed_laneselect, INS_invalid, INS_invalid, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(RelaxedSimd, MaxNative, 16, 2, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_f32x4_relaxed_max, INS_f64x2_relaxed_max, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_Commutative)
+HARDWARE_INTRINSIC(RelaxedSimd, MinNative, 16, 2, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_f32x4_relaxed_min, INS_f64x2_relaxed_min, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_Commutative)
+HARDWARE_INTRINSIC(RelaxedSimd, MultiplyAddEstimate, 16, 3, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_f32x4_relaxed_madd, INS_f64x2_relaxed_madd, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(RelaxedSimd, MultiplyAddNegatedEstimate, 16, 3, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_f32x4_relaxed_nmadd, INS_f64x2_relaxed_nmadd, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(RelaxedSimd, MultiplyRoundedQ15Native, 16, 2, INS_invalid, INS_invalid, INS_i16x8_relaxed_q15mulr_s, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_Commutative)
+HARDWARE_INTRINSIC(RelaxedSimd, SwizzleNative, 16, 2, INS_i8x16_relaxed_swizzle, INS_i8x16_relaxed_swizzle, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, -1, -1, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg)
+#define LAST_NI_RelaxedSimd NI_RelaxedSimd_SwizzleNative
+
// WasmBase Intrinsics
// These scalar intrinsics are special-imported (see hwintrinsicwasm.cpp) and always rewritten into the
// existing NI_PRIMITIVE_*ZeroCount GT_INTRINSIC nodes (which codegen already emits as wasm clz/ctz), so
diff --git a/src/coreclr/jit/hwintrinsicwasm.cpp b/src/coreclr/jit/hwintrinsicwasm.cpp
index 859f0390554eaa..13c2bd6c2f2d75 100644
--- a/src/coreclr/jit/hwintrinsicwasm.cpp
+++ b/src/coreclr/jit/hwintrinsicwasm.cpp
@@ -25,6 +25,10 @@ CORINFO_InstructionSet Compiler::lookupInstructionSet(const char* className)
{
return InstructionSet_PackedSimd;
}
+ else if (strcmp(className, "RelaxedSimd") == 0)
+ {
+ return InstructionSet_RelaxedSimd;
+ }
else if ((strcmp(className, "Vector128") == 0) || (strcmp(className, "Vector128`1") == 0))
{
return InstructionSet_Vector128;
diff --git a/src/coreclr/jit/instrswasm.h b/src/coreclr/jit/instrswasm.h
index 095a1d997b497a..fc6cdd0be83b73 100644
--- a/src/coreclr/jit/instrswasm.h
+++ b/src/coreclr/jit/instrswasm.h
@@ -527,6 +527,28 @@ INST2(i32x4_trunc_sat_u_f64x2_zero, "i32x4.trunc_sat_u_f64x2_zero", 0, IF_OP
INST2(f64x2_convert_low_s_i32x4, "f64x2.convert_low_s_i32x4", 0, IF_OPCODE, 0xFD, 254)
INST2(f64x2_convert_low_u_i32x4, "f64x2.convert_low_u_i32x4", 0, IF_OPCODE, 0xFD, 255)
+// Relaxed SIMD operations
+INST2(i8x16_relaxed_swizzle, "i8x16.relaxed_swizzle", 0, IF_OPCODE, 0xFD, 0x100)
+INST2(i32x4_relaxed_trunc_f32x4_s, "i32x4.relaxed_trunc_f32x4_s", 0, IF_OPCODE, 0xFD, 0x101)
+INST2(i32x4_relaxed_trunc_f32x4_u, "i32x4.relaxed_trunc_f32x4_u", 0, IF_OPCODE, 0xFD, 0x102)
+INST2(i32x4_relaxed_trunc_f64x2_s_zero, "i32x4.relaxed_trunc_f64x2_s_zero", 0, IF_OPCODE, 0xFD, 0x103)
+INST2(i32x4_relaxed_trunc_f64x2_u_zero, "i32x4.relaxed_trunc_f64x2_u_zero", 0, IF_OPCODE, 0xFD, 0x104)
+INST2(f32x4_relaxed_madd, "f32x4.relaxed_madd", 0, IF_OPCODE, 0xFD, 0x105)
+INST2(f32x4_relaxed_nmadd, "f32x4.relaxed_nmadd", 0, IF_OPCODE, 0xFD, 0x106)
+INST2(f64x2_relaxed_madd, "f64x2.relaxed_madd", 0, IF_OPCODE, 0xFD, 0x107)
+INST2(f64x2_relaxed_nmadd, "f64x2.relaxed_nmadd", 0, IF_OPCODE, 0xFD, 0x108)
+INST2(i8x16_relaxed_laneselect, "i8x16.relaxed_laneselect", 0, IF_OPCODE, 0xFD, 0x109)
+INST2(i16x8_relaxed_laneselect, "i16x8.relaxed_laneselect", 0, IF_OPCODE, 0xFD, 0x10A)
+INST2(i32x4_relaxed_laneselect, "i32x4.relaxed_laneselect", 0, IF_OPCODE, 0xFD, 0x10B)
+INST2(i64x2_relaxed_laneselect, "i64x2.relaxed_laneselect", 0, IF_OPCODE, 0xFD, 0x10C)
+INST2(f32x4_relaxed_min, "f32x4.relaxed_min", 0, IF_OPCODE, 0xFD, 0x10D)
+INST2(f32x4_relaxed_max, "f32x4.relaxed_max", 0, IF_OPCODE, 0xFD, 0x10E)
+INST2(f64x2_relaxed_min, "f64x2.relaxed_min", 0, IF_OPCODE, 0xFD, 0x10F)
+INST2(f64x2_relaxed_max, "f64x2.relaxed_max", 0, IF_OPCODE, 0xFD, 0x110)
+INST2(i16x8_relaxed_q15mulr_s, "i16x8.relaxed_q15mulr_s", 0, IF_OPCODE, 0xFD, 0x111)
+INST2(i16x8_relaxed_dot_i8x16_i7x16_s, "i16x8.relaxed_dot_i8x16_i7x16_s", 0, IF_OPCODE, 0xFD, 0x112)
+INST2(i32x4_relaxed_dot_i8x16_i7x16_add_s, "i32x4.relaxed_dot_i8x16_i7x16_add_s", 0, IF_OPCODE, 0xFD, 0x113)
+
// clang-format on
#undef INST
diff --git a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs
index 4c5574d6870c32..075243f63cf82e 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs
@@ -106,5 +106,6 @@ public enum ReadyToRunInstructionSet
Cssc = 93,
Zicond = 94,
Fp16 = 95,
+ RelaxedSimd = 96,
}
}
diff --git a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs
index 632e3053189a72..0d9f42b7b29d4c 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs
@@ -89,6 +89,7 @@ public static class ReadyToRunInstructionSetHelper
case InstructionSet.Wasm32_WasmBase: return ReadyToRunInstructionSet.WasmBase;
case InstructionSet.Wasm32_PackedSimd: return ReadyToRunInstructionSet.PackedSimd;
case InstructionSet.Wasm32_Vector128: return null;
+ case InstructionSet.Wasm32_RelaxedSimd: return ReadyToRunInstructionSet.RelaxedSimd;
default: throw new Exception("Unknown instruction set");
}
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs b/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs
index 870544e2156425..e2bb9d87c7fe66 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs
@@ -66,6 +66,7 @@ public enum InstructionSet
Wasm32_WasmBase = InstructionSet_Wasm32.WasmBase,
Wasm32_PackedSimd = InstructionSet_Wasm32.PackedSimd,
Wasm32_Vector128 = InstructionSet_Wasm32.Vector128,
+ Wasm32_RelaxedSimd = InstructionSet_Wasm32.RelaxedSimd,
X64_X86Base = InstructionSet_X64.X86Base,
X64_AVX = InstructionSet_X64.AVX,
X64_AVX2 = InstructionSet_X64.AVX2,
@@ -224,6 +225,7 @@ public enum InstructionSet_Wasm32
WasmBase = 1,
PackedSimd = 2,
Vector128 = 3,
+ RelaxedSimd = 4,
}
public enum InstructionSet_X64
@@ -620,6 +622,8 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target
case TargetArchitecture.Wasm32:
if (resultflags.HasInstructionSet(InstructionSet.Wasm32_Vector128))
resultflags.AddInstructionSet(InstructionSet.Wasm32_PackedSimd);
+ if (resultflags.HasInstructionSet(InstructionSet.Wasm32_RelaxedSimd))
+ resultflags.AddInstructionSet(InstructionSet.Wasm32_PackedSimd);
if (resultflags.HasInstructionSet(InstructionSet.Wasm32_PackedSimd))
resultflags.AddInstructionSet(InstructionSet.Wasm32_WasmBase);
break;
@@ -823,6 +827,7 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target
return resultflags;
}
+ // Expands unsupported instruction sets. If A implies B and B is unsupported, A is unsupported too.
public void ExpandInstructionSetByReverseImplication(TargetArchitecture architecture)
{
this = ExpandInstructionSetByReverseImplicationHelper(architecture, this);
@@ -931,6 +936,8 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe
case TargetArchitecture.Wasm32:
if (resultflags.HasInstructionSet(InstructionSet.Wasm32_PackedSimd))
resultflags.AddInstructionSet(InstructionSet.Wasm32_Vector128);
+ if (resultflags.HasInstructionSet(InstructionSet.Wasm32_PackedSimd))
+ resultflags.AddInstructionSet(InstructionSet.Wasm32_RelaxedSimd);
if (resultflags.HasInstructionSet(InstructionSet.Wasm32_WasmBase))
resultflags.AddInstructionSet(InstructionSet.Wasm32_PackedSimd);
break;
@@ -1194,6 +1201,7 @@ public static IEnumerable ArchitectureToValidInstructionSets
yield return new InstructionSetInfo("base", "WasmBase", InstructionSet.Wasm32_WasmBase, true);
yield return new InstructionSetInfo("simd128", "PackedSimd", InstructionSet.Wasm32_PackedSimd, true);
yield return new InstructionSetInfo("Vector128", "", InstructionSet.Wasm32_Vector128, false);
+ yield return new InstructionSetInfo("relaxed-simd", "RelaxedSimd", InstructionSet.Wasm32_RelaxedSimd, true);
break;
case TargetArchitecture.X64:
@@ -1663,6 +1671,9 @@ public static InstructionSet LookupPlatformIntrinsicInstructionSet(TargetArchite
case "PackedSimd":
return InstructionSet.Wasm32_PackedSimd;
+ case "RelaxedSimd":
+ return InstructionSet.Wasm32_RelaxedSimd;
+
default:
return InstructionSet.ILLEGAL;
}
@@ -2369,6 +2380,16 @@ public static IEnumerable LookupPlatformIntrinsicTypes(TypeSystemC
}
break;
+ case (InstructionSet.Wasm32_RelaxedSimd, TargetArchitecture.Wasm32):
+ {
+ var type = context.SystemModule.GetType("System.Runtime.Intrinsics.Wasm"u8, "RelaxedSimd"u8, false);
+ if (type != null)
+ {
+ yield return type;
+ }
+ }
+ break;
+
case (InstructionSet.X64_X86Base, TargetArchitecture.X64):
case (InstructionSet.X64_X86Base_X64, TargetArchitecture.X64):
{
diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
index a70cd7d9991687..a8a04d44dec630 100644
--- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
+++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
@@ -26,7 +26,7 @@
; DO NOT CHANGE R2R NUMERIC VALUES OF THE EXISTING SETS. Changing R2R numeric values definitions would be R2R format breaking change.
; The ISA definitions should also be mapped to `hwintrinsicIsaRangeArray` in hwintrinsic.cpp.
-; NEXT_AVAILABLE_R2R_BIT = 96
+; NEXT_AVAILABLE_R2R_BIT = 97
; Definition of X86 instruction sets
definearch ,X86 ,32Bit ,X64, X64, X86
@@ -323,7 +323,9 @@ definearch ,Wasm32 ,32Bit , , ,Wasm
instructionset ,Wasm32 ,WasmBase , ,91 ,WasmBase ,base
instructionset ,Wasm32 ,PackedSimd , ,92 ,PackedSimd ,simd128
instructionset ,Wasm32 , , , ,Vector128 ,
+instructionset ,Wasm32 ,RelaxedSimd , ,96 ,RelaxedSimd ,relaxed-simd
vectorinstructionset ,Wasm32 ,Vector128
implication ,Wasm32 ,Vector128 ,PackedSimd
+implication ,Wasm32 ,RelaxedSimd ,PackedSimd
implication ,Wasm32 ,PackedSimd ,WasmBase
\ No newline at end of file
diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs
index d15da9ddbff34c..d89ed8f17f39e6 100644
--- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs
+++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs
@@ -636,6 +636,7 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target
return resultflags;
}
+ // Expands unsupported instruction sets. If A implies B and B is unsupported, A is unsupported too.
public void ExpandInstructionSetByReverseImplication(TargetArchitecture architecture)
{
this = ExpandInstructionSetByReverseImplicationHelper(architecture, this);
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs
index 8a1c6dd1e5a582..f1b372bbadea31 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs
@@ -352,18 +352,6 @@ static void Validate(ReadyToRunReader reader)
static string Format(IReadOnlyList valTypes) =>
$"[{string.Join(",", valTypes.Select(b => $"0x{b:X2}"))}]";
}
-
- static WebcilImageReader.WasmFunctionInfo ResolveWasmBody(
- ReadyToRunReader reader, WebcilImageReader webcilReader, ReadyToRunMethod method)
- {
- uint tableIndex = checked(reader.WasmMinFunctionTableIndex + (uint)method.EntryPointRuntimeFunctionId);
- int functionIndex = webcilReader.GetFunctionIndexFromTableIndex(tableIndex);
- Assert.True(functionIndex >= 0, $"Could not resolve wasm table index {tableIndex} to a function body.");
-
- WebcilImageReader.WasmFunctionInfo? body = webcilReader.GetWasmFunctionBody(functionIndex);
- Assert.True(body is not null, $"Wasm function body {functionIndex} was not found.");
- return body.Value;
- }
}
[ConditionalFact(typeof(TestPaths), nameof(TestPaths.IsWasmTarget))]
@@ -411,6 +399,18 @@ static void Validate(ReadyToRunReader reader)
}
}
+ private static WebcilImageReader.WasmFunctionInfo ResolveWasmBody(
+ ReadyToRunReader reader, WebcilImageReader webcilReader, ReadyToRunMethod method)
+ {
+ uint tableIndex = checked(reader.WasmMinFunctionTableIndex + (uint)method.EntryPointRuntimeFunctionId);
+ int functionIndex = webcilReader.GetFunctionIndexFromTableIndex(tableIndex);
+ Assert.True(functionIndex >= 0, $"Could not resolve wasm table index {tableIndex} to a function body.");
+
+ WebcilImageReader.WasmFunctionInfo? body = webcilReader.GetWasmFunctionBody(functionIndex);
+ Assert.True(body is not null, $"Wasm function body {functionIndex} was not found.");
+ return body.Value;
+ }
+
[ConditionalFact(typeof(TestPaths), nameof(TestPaths.IsNotWasmTarget))]
public void RuntimeFunctionsSectionSizeExcludesSentinel()
{
diff --git a/src/coreclr/tools/r2rdump/WasmDisassembler.cs b/src/coreclr/tools/r2rdump/WasmDisassembler.cs
index 268f6632ea43d8..950c867f45de38 100644
--- a/src/coreclr/tools/r2rdump/WasmDisassembler.cs
+++ b/src/coreclr/tools/r2rdump/WasmDisassembler.cs
@@ -915,6 +915,28 @@ private string DecodeFDPrefixed()
case 254: return "f32x4.demote_f64x2_zero";
case 255: return "f64x2.promote_low_f32x4";
+ // Relaxed SIMD instructions
+ case 0x100: return "i8x16.relaxed_swizzle";
+ case 0x101: return "i32x4.relaxed_trunc_f32x4_s";
+ case 0x102: return "i32x4.relaxed_trunc_f32x4_u";
+ case 0x103: return "i32x4.relaxed_trunc_f64x2_s_zero";
+ case 0x104: return "i32x4.relaxed_trunc_f64x2_u_zero";
+ case 0x105: return "f32x4.relaxed_madd";
+ case 0x106: return "f32x4.relaxed_nmadd";
+ case 0x107: return "f64x2.relaxed_madd";
+ case 0x108: return "f64x2.relaxed_nmadd";
+ case 0x109: return "i8x16.relaxed_laneselect";
+ case 0x10A: return "i16x8.relaxed_laneselect";
+ case 0x10B: return "i32x4.relaxed_laneselect";
+ case 0x10C: return "i64x2.relaxed_laneselect";
+ case 0x10D: return "f32x4.relaxed_min";
+ case 0x10E: return "f32x4.relaxed_max";
+ case 0x10F: return "f64x2.relaxed_min";
+ case 0x110: return "f64x2.relaxed_max";
+ case 0x111: return "i16x8.relaxed_q15mulr_s";
+ case 0x112: return "i16x8.relaxed_dot_i8x16_i7x16_s";
+ case 0x113: return "i32x4.relaxed_dot_i8x16_i7x16_add_s";
+
default:
return $"";
}
diff --git a/src/coreclr/vm/codeman.cpp b/src/coreclr/vm/codeman.cpp
index dcfdcfcf0d78e0..ce035194763e58 100644
--- a/src/coreclr/vm/codeman.cpp
+++ b/src/coreclr/vm/codeman.cpp
@@ -1463,6 +1463,15 @@ extern "C" DWORD64 __stdcall GetDataCacheZeroIDReg();
extern "C" uint64_t GetSveLengthFromOS();
#endif
+#ifdef TARGET_WASM
+static bool s_wasmRelaxedSimdSupported;
+
+extern "C" void coreclr_wasm_set_relaxed_simd_supported()
+{
+ s_wasmRelaxedSimdSupported = true;
+}
+#endif
+
void EEJitManager::SetCpuInfo()
{
LIMITED_METHOD_CONTRACT;
@@ -1507,6 +1516,10 @@ void EEJitManager::SetCpuInfo()
#if defined(TARGET_WASM)
CPUCompileFlags.Set(InstructionSet_WasmBase);
CPUCompileFlags.Set(InstructionSet_PackedSimd);
+ if (s_wasmRelaxedSimdSupported)
+ {
+ CPUCompileFlags.Set(InstructionSet_RelaxedSimd);
+ }
#endif
#if defined(TARGET_X86) || defined(TARGET_AMD64)
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props
index 5c36a463c5e5a6..54aa41f3adfed2 100644
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props
@@ -229,6 +229,7 @@
+
diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
index 867e3a6fdca01f..5bf9cc9939191d 100644
--- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
+++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
@@ -2919,10 +2919,12 @@
+
+
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs
index 0ffe3d96f4fcc9..89e8687a746c77 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs
@@ -15,7 +15,7 @@ public abstract class PackedSimd
/// Gets a value that indicates whether the APIs in this class are supported.
/// if the APIs are supported; otherwise, .
/// A value of indicates that the APIs will throw .
- public static bool IsSupported { [Intrinsic] get { return IsSupported; } }
+ public static bool IsSupported { get { return IsSupported; } }
// Constructing SIMD Values
@@ -26,73 +26,61 @@ public abstract class PackedSimd
/// v128_t wasm_i8x16_splat (int8_t a)
/// i8x16.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(sbyte value) => Splat(value);
///
/// v128_t wasm_u8x16_splat (uint8_t a)
/// i8x16.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(byte value) => Splat(value);
///
/// v128_t wasm_i16x8_splat (int16_t a)
/// i16x8.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(short value) => Splat(value);
///
/// v128_t wasm_u16x8_splat (uint16_t a)
/// i16x8.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(ushort value) => Splat(value);
///
/// v128_t wasm_i32x4_splat (int32_t a)
/// i32x4.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(int value) => Splat(value);
///
/// v128_t wasm_u32x4_splat (uint32_t a)
/// i32x4.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(uint value) => Splat(value);
///
/// v128_t wasm_i64x2_splat (int64_t a)
/// i64x2.splat : [i64] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(long value) => Splat(value);
///
/// v128_t wasm_u64x2_splat (uint64_t a)
/// i64x2.splat : [i64] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(ulong value) => Splat(value);
///
/// v128_t wasm_f32x4_splat (float a)
/// f32x4.splat : [f32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(float value) => Splat(value);
///
/// v128_t wasm_f64x2_splat (double a)
/// f64x2.splat : [f64] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(double value) => Splat(value);
///
/// v128_t wasm_i32x4_splat (int32_t a)
/// i32x4.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(nint value) => Splat(value);
///
/// v128_t wasm_u32x4_splat (uint32_t a)
/// i32x4.splat : [i32] -> [v128]
///
- [Intrinsic]
public static Vector128 Splat(nuint value) => Splat(value);
// Accessing lanes
@@ -101,172 +89,144 @@ public abstract class PackedSimd
/// int8_t wasm_i8x16_extract_lane (v128_t a, int i)
/// i8x16.extract_lane_s laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static int ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx16
///
/// uint8_t wasm_u8x16_extract_lane (v128_t a, int i)
/// i8x16.extract_lane_u laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static uint ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx16
///
/// int16_t wasm_i16x8_extract_lane (v128_t a, int i)
/// i16x8.extract_lane_s laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static int ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx8
///
/// uint16_t wasm_u16x8_extract_lane (v128_t a, int i)
/// i16x8.extract_lane_u laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static uint ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx8
///
/// int32_t wasm_i32x4_extract_lane (v128_t a, int i)
/// i32x4.extract_lane laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static int ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx4
///
/// uint32_t wasm_u32x4_extract_lane (v128_t a, int i)
/// i32x4.extract_lane laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static uint ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx4
///
/// int64_t wasm_i64x2_extract_lane (v128_t a, int i)
/// i64x2.extract_lane laneidx : [v128] -> [i64]
///
- [Intrinsic]
public static long ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx2
///
/// uint64_t wasm_u64x2_extract_lane (v128_t a, int i)
/// i64x2.extract_lane laneidx : [v128] -> [i64]
///
- [Intrinsic]
public static ulong ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx2
///
/// float wasm_f32x4_extract_lane (v128_t a, int i)
/// f32x4.extract_lane laneidx : [v128] -> [f32]
///
- [Intrinsic]
public static float ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx4
///
/// double wasm_f64x2_extract_lane (v128_t a, int i)
/// f64x2.extract_lane laneidx : [v128] -> [f64]
///
- [Intrinsic]
public static double ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) => ExtractScalar(value, index); // takes ImmLaneIdx2
///
/// int32_t wasm_i32x4_extract_lane (v128_t a, int i)
/// i32x4.extract_lane laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static nint ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => ExtractScalar(value, index);
///
/// uint32_t wasm_u32x4_extract_lane (v128_t a, int i)
/// i32x4.extract_lane laneidx : [v128] -> [i32]
///
- [Intrinsic]
public static nuint ExtractScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => ExtractScalar(value, index);
///
/// v128_t wasm_i8x16_replace_lane (v128_t a, int i, int8_t b)
/// i8x16.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte imm, int value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx16
///
/// v128_t wasm_u8x16_replace_lane (v128_t a, int i, uint8_t b)
/// i8x16.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte imm, uint value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx16
///
/// v128_t wasm_i16x8_replace_lane (v128_t a, int i, int16_t b)
/// i16x8.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte imm, int value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx8
///
/// v128_t wasm_u16x8_replace_lane (v128_t a, int i, uint16_t b)
/// i16x8.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte imm, uint value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx8
///
/// v128_t wasm_i32x4_replace_lane (v128_t a, int i, int32_t b)
/// i32x4.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte imm, int value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx4
///
/// v128_t wasm_u32x4_replace_lane (v128_t a, int i, uint32_t b)
/// i32x4.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte imm, uint value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx4
///
/// v128_t wasm_i64x2_replace_lane (v128_t a, int i, int64_t b)
/// i64x2.replace_lane laneidx : [v128 i64] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte imm, long value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx2
///
/// v128_t wasm_u64x2_replace_lane (v128_t a, int i, uint64_t b)
/// i64x2.replace_lane laneidx : [v128 i64] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte imm, ulong value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx2
///
/// v128_t wasm_f32x4_replace_lane (v128_t a, int i, float b)
/// f32x4.replace_lane laneidx : [v128 f32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte imm, float value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx4
///
/// v128_t wasm_f64x2_replace_lane (v128_t a, int i, double b)
/// f64x2.replace_lane laneidx : [v128 f64] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte imm, double value) => ReplaceScalar(vector, imm, value); // takes ImmLaneIdx2
///
/// v128_t wasm_i32x4_replace_lane (v128_t a, int i, int32_t b)
/// i32x4.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte imm, nint value) => ReplaceScalar(vector, imm, value);
///
/// v128_t wasm_u32x4_replace_lane (v128_t a, int i, uint32_t b)
/// i32x4.replace_lane laneidx : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ReplaceScalar(Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte imm, nuint value) => ReplaceScalar(vector, imm, value);
///
/// v128_t wasm_i8x16_shuffle (v128_t a, v128_t b, int c0, int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8, int c9, int c10, int c11, int c12, int c13, int c14, int c15)
/// i8x16.shuffle laneidx^16 : [v128 v128] -> [v128]
///
- [Intrinsic]
internal static Vector128 Shuffle(Vector128 lower, Vector128 upper, Vector128 indices) => Shuffle(lower, upper, indices);
///
/// v128_t wasm_i8x16_shuffle (v128_t a, v128_t b, int c0, int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8, int c9, int c10, int c11, int c12, int c13, int c14, int c15)
/// i8x16.shuffle laneidx^16 : [v128 v128] -> [v128]
///
- [Intrinsic]
internal static Vector128 Shuffle(Vector128 lower, Vector128 upper, Vector128 indices) => Shuffle(lower, upper, indices);
///
/// v128_t wasm_i8x16_swizzle (v128_t a, v128_t b)
/// i8x16.swizzle : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Swizzle(Vector128 vector, Vector128 indices) => Swizzle(vector, indices);
///
/// v128_t wasm_i8x16_swizzle (v128_t a, v128_t b)
/// i8x16.swizzle : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Swizzle(Vector128 vector, Vector128 indices) => Swizzle(vector, indices);
// Integer arithmetic
@@ -275,239 +235,200 @@ public abstract class PackedSimd
/// v128_t wasm_i8x16_add (v128_t a, v128_t b)
/// i8x16.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i8x16_add (v128_t a, v128_t b)
/// i8x16.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i16x8_add (v128_t a, v128_t b)
/// i16x8.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i16x8_add (v128_t a, v128_t b)
/// i16x8.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i32x4_add (v128_t a, v128_t b)
/// i32x4.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i32x4_add (v128_t a, v128_t b)
/// i32x4.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i64x2_add (v128_t a, v128_t b)
/// i64x2.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i64x2_add (v128_t a, v128_t b)
/// i64x2.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i32x4_add (v128_t a, v128_t b)
/// i32x4.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i32x4_add (v128_t a, v128_t b)
/// i32x4.add : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right);
///
/// v128_t wasm_i8x16_sub (v128_t a, v128_t b)
/// i8x16.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i8x16_sub (v128_t a, v128_t b)
/// i8x16.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i16x8_sub (v128_t a, v128_t b)
/// i16x8.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i16x8_sub (v128_t a, v128_t b)
/// i16x8.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i32x4_sub (v128_t a, v128_t b)
/// i32x4.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i32x4_sub (v128_t a, v128_t b)
/// i32x4.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i64x2_sub (v128_t a, v128_t b)
/// i64x2.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i64x2_sub (v128_t a, v128_t b)
/// i64x2.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i32x4_sub (v128_t a, v128_t b)
/// i32x4.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i32x4_sub (v128_t a, v128_t b)
/// i32x4.sub : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Subtract(Vector128 left, Vector128 right) => Subtract(left, right);
///
/// v128_t wasm_i16x8_mul (v128_t a, v128_t b)
/// i16x8.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i16x8_mul (v128_t a, v128_t b)
/// i16x8.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i32x4_mul (v128_t a, v128_t b)
/// i32x4.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i32x4_mul (v128_t a, v128_t b)
/// i32x4.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i64x2_mul (v128_t a, v128_t b)
/// i64x2.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i64x2_mul (v128_t a, v128_t b)
/// i64x2.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i32x4_mul (v128_t a, v128_t b)
/// i32x4.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i32x4_mul (v128_t a, v128_t b)
/// i32x4.mul : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Multiply(Vector128 left, Vector128 right) => Multiply(left, right);
///
/// v128_t wasm_i32x4_dot_i16x8 (v128_t a, v128_t b)
/// i32x4.dot_i16x8_s : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Dot(Vector128 left, Vector128 right) => Dot(left, right);
///
/// v128_t wasm_i8x16_neg (v128_t a)
/// i8x16.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i8x16_neg (v128_t a)
/// i8x16.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i16x8_neg (v128_t a)
/// i16x8.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i16x8_neg (v128_t a)
/// i16x8.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i32x4_neg (v128_t a)
/// i32x4.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i32x4_neg (v128_t a)
/// i32x4.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i64x2_neg (v128_t a)
/// i64x2.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i64x2_neg (v128_t a)
/// i64x2.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i32x4_neg (v128_t a)
/// i32x4.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
///
/// v128_t wasm_i32x4_neg (v128_t a)
/// i32x4.neg : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 Negate(Vector128 value) => Negate(value);
// Extended integer arithmetic
@@ -516,99 +437,83 @@ public abstract class PackedSimd
/// v128_t wasm_i16x8_extmul_low_i8x16 (v128_t a, v128_t b)
/// i16x8.extmul_low_i8x16_s : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningLower(Vector128 left, Vector128 right) => MultiplyWideningLower(left, right);
///
/// v128_t wasm_u16x8_extmul_low_u8x16 (v128_t a, v128_t b)
/// i16x8.extmul_low_i8x16_u : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningLower(Vector128 left, Vector128 right) => MultiplyWideningLower(left, right);
///
/// v128_t wasm_i32x4_extmul_low_i16x8 (v128_t a, v128_t b)
/// i32x4.extmul_low_i16x8_s : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningLower(Vector128 left, Vector128 right) => MultiplyWideningLower(left, right);
///
/// v128_t wasm_u32x4_extmul_low_u16x8 (v128_t a, v128_t b)
/// i32x4.extmul_low_i16x8_u : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningLower(Vector128 left, Vector128 right) => MultiplyWideningLower(left, right);
///
/// v128_t wasm_i64x2_extmul_low_i32x4 (v128_t a, v128_t b)
/// i64x2.extmul_low_i32x4_s : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningLower(Vector128 left, Vector128 right) => MultiplyWideningLower(left, right);
///
/// v128_t wasm_u64x2_extmul_low_u32x4 (v128_t a, v128_t b)
/// i64x2.extmul_low_i32x4_u : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningLower(Vector128 left, Vector128 right) => MultiplyWideningLower(left, right);
///
/// v128_t wasm_i16x8_extmul_high_i8x16 (v128_t a, v128_t b)
/// i16x8.extmul_high_i8x16_s : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningUpper(Vector128 left, Vector128 right) => MultiplyWideningUpper(left, right);
///
/// v128_t wasm_u16x8_extmul_high_u8x16 (v128_t a, v128_t b)
/// i16x8.extmul_high_i8x16_u : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningUpper(Vector128 left, Vector128 right) => MultiplyWideningUpper(left, right);
///
/// v128_t wasm_i32x4_extmul_high_i16x8 (v128_t a, v128_t b)
/// i32x4.extmul_high_i16x8_s : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningUpper(Vector128 left, Vector128 right) => MultiplyWideningUpper(left, right);
///
/// v128_t wasm_u32x4_extmul_high_u16x8 (v128_t a, v128_t b)
/// i32x4.extmul_high_i16x8_u : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningUpper(Vector128 left, Vector128 right) => MultiplyWideningUpper(left, right);
///
/// v128_t wasm_i64x2_extmul_high_i32x4 (v128_t a, v128_t b)
/// i64x2.extmul_high_i32x4_s : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningUpper(Vector128 left, Vector128 right) => MultiplyWideningUpper(left, right);
///
/// v128_t wasm_u64x2_extmul_high_u32x4 (v128_t a, v128_t b)
/// i64x2.extmul_high_i32x4_u : [v128 v128] -> [v128]
///
- [Intrinsic]
public static Vector128 MultiplyWideningUpper(Vector128 left, Vector128 right) => MultiplyWideningUpper(left, right);
///
/// v128_t wasm_i16x8_extadd_pairwise_i8x16 (v128_t a)
/// i16x8.extadd_pairwise_i8x16_s : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 AddPairwiseWidening(Vector128 value) => AddPairwiseWidening(value);
///
/// v128_t wasm_u16x8_extadd_pairwise_u8x16 (v128_t a)
/// i16x8.extadd_pairwise_i8x16_u : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 AddPairwiseWidening(Vector128 value) => AddPairwiseWidening(value);
///
/// v128_t wasm_i32x4_extadd_pairwise_i16x8 (v128_t a)
/// i32x4.extadd_pairwise_i16x8_s : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 AddPairwiseWidening(Vector128 value) => AddPairwiseWidening(value);
///
/// v128_t wasm_u32x4_extadd_pairwise_u16x8 (v128_t a)
/// i32x4.extadd_pairwise_i16x8_u : [v128] -> [v128]
///
- [Intrinsic]
public static Vector128 AddPairwiseWidening(Vector128 value) => AddPairwiseWidening(value);
// Saturating integer arithmetic
@@ -766,183 +671,153 @@ public abstract class PackedSimd
/// v128_t wasm_i8x16_shl (v128_t a, uint32_t b)
/// i8x16.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i8x16_shl (v128_t a, uint32_t b)
/// i8x16.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i16x8_shl (v128_t a, uint32_t b)
/// i16x8.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i16x8_shl (v128_t a, uint32_t b)
/// i16x8.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i32x4_shl (v128_t a, uint32_t b)
/// i32x4.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i32x4_shl (v128_t a, uint32_t b)
/// i32x4.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i64x2_shl (v128_t a, uint32_t b)
/// i64x2.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i64x2_shl (v128_t a, uint32_t b)
/// i64x2.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i32x4_shl (v128_t a, uint32_t b)
/// i32x4.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i32x4_shl (v128_t a, uint32_t b)
/// i32x4.shl : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftLeft(Vector128 value, int count) => ShiftLeft(value, count);
///
/// v128_t wasm_i8x16_shr (v128_t a, uint32_t b)
/// i8x16.shr_s : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftRightArithmetic(Vector128 value, int count) => ShiftRightArithmetic(value, count);
///
/// v128_t wasm_i8x16_shr (v128_t a, uint32_t b)
/// i8x16.shr_s : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftRightArithmetic(Vector128 value, int count) => ShiftRightArithmetic(value, count);
///
/// v128_t wasm_i16x8_shr (v128_t a, uint32_t b)
/// i16x8.shr_s : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftRightArithmetic(Vector128 value, int count) => ShiftRightArithmetic(value, count);
///
/// v128_t wasm_i16x8_shr (v128_t a, uint32_t b)
/// i16x8.shr_s : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftRightArithmetic(Vector128 value, int count) => ShiftRightArithmetic(value, count);
///
/// v128_t wasm_i32x4_shr (v128_t a, uint32_t b)
/// i32x4.shr_s : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftRightArithmetic(Vector128 value, int count) => ShiftRightArithmetic(value, count);
///
/// v128_t wasm_i32x4_shr (v128_t a, uint32_t b)
/// i32x4.shr_s : [v128 i32] -> [v128]
///
- [Intrinsic]
public static Vector128 ShiftRightArithmetic(Vector128 value, int count) => ShiftRightArithmetic(value, count);
///
///