Skip to content

Commit 3de24ef

Browse files
authored
Merge pull request #98328 from carlossanlop/release/8.0-staging
[manual] Merge release/8.0-staging into release/8.0
2 parents 31691ff + ec1636f commit 3de24ef

File tree

123 files changed

+2797
-419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+2797
-419
lines changed

NuGet.config

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<clear />
1010
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
1111
<!-- Begin: Package sources from dotnet-emsdk -->
12+
<add key="darc-pub-dotnet-emsdk-9a29abd" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-9a29abdd/nuget/v3/index.json" />
1213
<add key="darc-pub-dotnet-emsdk-2fc2ffd" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2fc2ffd9/nuget/v3/index.json" />
1314
<add key="darc-pub-dotnet-emsdk-201f4da" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-201f4dae/nuget/v3/index.json" />
1415
<add key="darc-pub-dotnet-emsdk-201f4da-3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-201f4dae-3/nuget/v3/index.json" />

eng/Version.Details.xml

+34-34
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@
9090
<Sha>45dd3a73dd5b64b010c4251303b3664bb30df029</Sha>
9191
<SourceBuild RepoName="cecil" ManagedOnly="true" />
9292
</Dependency>
93-
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100" Version="8.0.2">
93+
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100" Version="8.0.3">
9494
<Uri>https://github.com/dotnet/emsdk</Uri>
95-
<Sha>2fc2ffd960930318f33fcaa690cbdbc55d72f52d</Sha>
95+
<Sha>9a29abdd764a4de0f253ed368871877a47725247</Sha>
9696
</Dependency>
97-
<Dependency Name="Microsoft.SourceBuild.Intermediate.emsdk" Version="8.0.2-servicing.24062.1">
97+
<Dependency Name="Microsoft.SourceBuild.Intermediate.emsdk" Version="8.0.3-servicing.24108.3">
9898
<Uri>https://github.com/dotnet/emsdk</Uri>
99-
<Sha>2fc2ffd960930318f33fcaa690cbdbc55d72f52d</Sha>
99+
<Sha>9a29abdd764a4de0f253ed368871877a47725247</Sha>
100100
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
101101
</Dependency>
102102
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="8.0.0-alpha.1.24061.1">
@@ -185,57 +185,57 @@
185185
<Uri>https://github.com/dotnet/arcade</Uri>
186186
<Sha>61ae141d2bf3534619265c8f691fd55dc3e75147</Sha>
187187
</Dependency>
188-
<Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="8.0.0-beta.24060.2">
188+
<Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="8.0.0-beta.24108.4">
189189
<Uri>https://github.com/dotnet/runtime-assets</Uri>
190-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
190+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
191191
</Dependency>
192-
<Dependency Name="System.Data.Common.TestData" Version="8.0.0-beta.24060.2">
192+
<Dependency Name="System.Data.Common.TestData" Version="8.0.0-beta.24108.4">
193193
<Uri>https://github.com/dotnet/runtime-assets</Uri>
194-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
194+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
195195
</Dependency>
196-
<Dependency Name="System.Drawing.Common.TestData" Version="8.0.0-beta.24060.2">
196+
<Dependency Name="System.Drawing.Common.TestData" Version="8.0.0-beta.24108.4">
197197
<Uri>https://github.com/dotnet/runtime-assets</Uri>
198-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
198+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
199199
</Dependency>
200-
<Dependency Name="System.Formats.Tar.TestData" Version="8.0.0-beta.24060.2">
200+
<Dependency Name="System.Formats.Tar.TestData" Version="8.0.0-beta.24108.4">
201201
<Uri>https://github.com/dotnet/runtime-assets</Uri>
202-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
202+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
203203
</Dependency>
204-
<Dependency Name="System.IO.Compression.TestData" Version="8.0.0-beta.24060.2">
204+
<Dependency Name="System.IO.Compression.TestData" Version="8.0.0-beta.24108.4">
205205
<Uri>https://github.com/dotnet/runtime-assets</Uri>
206-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
206+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
207207
</Dependency>
208-
<Dependency Name="System.IO.Packaging.TestData" Version="8.0.0-beta.24060.2">
208+
<Dependency Name="System.IO.Packaging.TestData" Version="8.0.0-beta.24108.4">
209209
<Uri>https://github.com/dotnet/runtime-assets</Uri>
210-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
210+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
211211
</Dependency>
212-
<Dependency Name="System.Net.TestData" Version="8.0.0-beta.24060.2">
212+
<Dependency Name="System.Net.TestData" Version="8.0.0-beta.24108.4">
213213
<Uri>https://github.com/dotnet/runtime-assets</Uri>
214-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
214+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
215215
</Dependency>
216-
<Dependency Name="System.Private.Runtime.UnicodeData" Version="8.0.0-beta.24060.2">
216+
<Dependency Name="System.Private.Runtime.UnicodeData" Version="8.0.0-beta.24108.4">
217217
<Uri>https://github.com/dotnet/runtime-assets</Uri>
218-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
218+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
219219
</Dependency>
220-
<Dependency Name="System.Runtime.TimeZoneData" Version="8.0.0-beta.24060.2">
220+
<Dependency Name="System.Runtime.TimeZoneData" Version="8.0.0-beta.24108.4">
221221
<Uri>https://github.com/dotnet/runtime-assets</Uri>
222-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
222+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
223223
</Dependency>
224-
<Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="8.0.0-beta.24060.2">
224+
<Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="8.0.0-beta.24108.4">
225225
<Uri>https://github.com/dotnet/runtime-assets</Uri>
226-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
226+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
227227
</Dependency>
228-
<Dependency Name="System.Text.RegularExpressions.TestData" Version="8.0.0-beta.24060.2">
228+
<Dependency Name="System.Text.RegularExpressions.TestData" Version="8.0.0-beta.24108.4">
229229
<Uri>https://github.com/dotnet/runtime-assets</Uri>
230-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
230+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
231231
</Dependency>
232-
<Dependency Name="System.Windows.Extensions.TestData" Version="8.0.0-beta.24060.2">
232+
<Dependency Name="System.Windows.Extensions.TestData" Version="8.0.0-beta.24108.4">
233233
<Uri>https://github.com/dotnet/runtime-assets</Uri>
234-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
234+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
235235
</Dependency>
236-
<Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="8.0.0-beta.24060.2">
236+
<Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="8.0.0-beta.24108.4">
237237
<Uri>https://github.com/dotnet/runtime-assets</Uri>
238-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
238+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
239239
</Dependency>
240240
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="16.0.5-alpha.1.23566.1" CoherentParentDependency="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100">
241241
<Uri>https://github.com/dotnet/llvm-project</Uri>
@@ -354,13 +354,13 @@
354354
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
355355
<Sha>67613417f5e1af250e6ddfba79f8f2885d8e90fb</Sha>
356356
</Dependency>
357-
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="8.0.0-alpha.0.24060.1">
357+
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="8.0.0-alpha.0.24072.2">
358358
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
359-
<Sha>3b7da338c73b31b943c5512dcf0e2f6dd75f601c</Sha>
359+
<Sha>bc857c64c5c5f1fc73048261e8f471c3310224d2</Sha>
360360
</Dependency>
361-
<Dependency Name="System.Runtime.Numerics.TestData" Version="8.0.0-beta.24060.2">
361+
<Dependency Name="System.Runtime.Numerics.TestData" Version="8.0.0-beta.24108.4">
362362
<Uri>https://github.com/dotnet/runtime-assets</Uri>
363-
<Sha>3b165c269b12cc194f48fde6a1a7694bece8931b</Sha>
363+
<Sha>ca6c46012f68934198ce0d303196c3ae179230f5</Sha>
364364
</Dependency>
365365
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.8.0-7.23566.2">
366366
<Uri>https://github.com/dotnet/roslyn</Uri>

eng/Versions.props

+17-17
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
<SystemBuffersVersion>4.5.1</SystemBuffersVersion>
127127
<SystemCollectionsImmutableVersion>7.0.0</SystemCollectionsImmutableVersion>
128128
<SystemComponentModelAnnotationsVersion>5.0.0</SystemComponentModelAnnotationsVersion>
129-
<SystemDataSqlClientVersion>4.8.5</SystemDataSqlClientVersion>
129+
<SystemDataSqlClientVersion>4.8.6</SystemDataSqlClientVersion>
130130
<SystemDrawingCommonVersion>8.0.0</SystemDrawingCommonVersion>
131131
<SystemIOFileSystemAccessControlVersion>5.0.0</SystemIOFileSystemAccessControlVersion>
132132
<SystemMemoryVersion>4.5.5</SystemMemoryVersion>
@@ -143,20 +143,20 @@
143143
<SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
144144
<runtimenativeSystemIOPortsVersion>8.0.0-rc.1.23406.6</runtimenativeSystemIOPortsVersion>
145145
<!-- Runtime-Assets dependencies -->
146-
<SystemRuntimeNumericsTestDataVersion>8.0.0-beta.24060.2</SystemRuntimeNumericsTestDataVersion>
147-
<SystemComponentModelTypeConverterTestDataVersion>8.0.0-beta.24060.2</SystemComponentModelTypeConverterTestDataVersion>
148-
<SystemDataCommonTestDataVersion>8.0.0-beta.24060.2</SystemDataCommonTestDataVersion>
149-
<SystemDrawingCommonTestDataVersion>8.0.0-beta.24060.2</SystemDrawingCommonTestDataVersion>
150-
<SystemFormatsTarTestDataVersion>8.0.0-beta.24060.2</SystemFormatsTarTestDataVersion>
151-
<SystemIOCompressionTestDataVersion>8.0.0-beta.24060.2</SystemIOCompressionTestDataVersion>
152-
<SystemIOPackagingTestDataVersion>8.0.0-beta.24060.2</SystemIOPackagingTestDataVersion>
153-
<SystemNetTestDataVersion>8.0.0-beta.24060.2</SystemNetTestDataVersion>
154-
<SystemPrivateRuntimeUnicodeDataVersion>8.0.0-beta.24060.2</SystemPrivateRuntimeUnicodeDataVersion>
155-
<SystemRuntimeTimeZoneDataVersion>8.0.0-beta.24060.2</SystemRuntimeTimeZoneDataVersion>
156-
<SystemSecurityCryptographyX509CertificatesTestDataVersion>8.0.0-beta.24060.2</SystemSecurityCryptographyX509CertificatesTestDataVersion>
157-
<SystemTextRegularExpressionsTestDataVersion>8.0.0-beta.24060.2</SystemTextRegularExpressionsTestDataVersion>
158-
<SystemWindowsExtensionsTestDataVersion>8.0.0-beta.24060.2</SystemWindowsExtensionsTestDataVersion>
159-
<MicrosoftDotNetCilStripSourcesVersion>8.0.0-beta.24060.2</MicrosoftDotNetCilStripSourcesVersion>
146+
<SystemRuntimeNumericsTestDataVersion>8.0.0-beta.24108.4</SystemRuntimeNumericsTestDataVersion>
147+
<SystemComponentModelTypeConverterTestDataVersion>8.0.0-beta.24108.4</SystemComponentModelTypeConverterTestDataVersion>
148+
<SystemDataCommonTestDataVersion>8.0.0-beta.24108.4</SystemDataCommonTestDataVersion>
149+
<SystemDrawingCommonTestDataVersion>8.0.0-beta.24108.4</SystemDrawingCommonTestDataVersion>
150+
<SystemFormatsTarTestDataVersion>8.0.0-beta.24108.4</SystemFormatsTarTestDataVersion>
151+
<SystemIOCompressionTestDataVersion>8.0.0-beta.24108.4</SystemIOCompressionTestDataVersion>
152+
<SystemIOPackagingTestDataVersion>8.0.0-beta.24108.4</SystemIOPackagingTestDataVersion>
153+
<SystemNetTestDataVersion>8.0.0-beta.24108.4</SystemNetTestDataVersion>
154+
<SystemPrivateRuntimeUnicodeDataVersion>8.0.0-beta.24108.4</SystemPrivateRuntimeUnicodeDataVersion>
155+
<SystemRuntimeTimeZoneDataVersion>8.0.0-beta.24108.4</SystemRuntimeTimeZoneDataVersion>
156+
<SystemSecurityCryptographyX509CertificatesTestDataVersion>8.0.0-beta.24108.4</SystemSecurityCryptographyX509CertificatesTestDataVersion>
157+
<SystemTextRegularExpressionsTestDataVersion>8.0.0-beta.24108.4</SystemTextRegularExpressionsTestDataVersion>
158+
<SystemWindowsExtensionsTestDataVersion>8.0.0-beta.24108.4</SystemWindowsExtensionsTestDataVersion>
159+
<MicrosoftDotNetCilStripSourcesVersion>8.0.0-beta.24108.4</MicrosoftDotNetCilStripSourcesVersion>
160160
<!-- dotnet-optimization dependencies -->
161161
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.23566.3</optimizationwindows_ntx64MIBCRuntimeVersion>
162162
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.23566.3</optimizationwindows_ntx86MIBCRuntimeVersion>
@@ -186,7 +186,7 @@
186186
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>8.0.0-prerelease.24060.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
187187
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>8.0.0-prerelease.24060.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
188188
<MicrosoftDotNetXHarnessCLIVersion>8.0.0-prerelease.24060.1</MicrosoftDotNetXHarnessCLIVersion>
189-
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>8.0.0-alpha.0.24060.1</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
189+
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>8.0.0-alpha.0.24072.2</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
190190
<XUnitVersion>2.4.2</XUnitVersion>
191191
<XUnitAnalyzersVersion>1.0.0</XUnitAnalyzersVersion>
192192
<XUnitRunnerVisualStudioVersion>2.4.5</XUnitRunnerVisualStudioVersion>
@@ -240,7 +240,7 @@
240240
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
241241
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-8_0_100_Transport
242242
-->
243-
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version>8.0.2</MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version>
243+
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version>8.0.3</MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version>
244244
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version)</MicrosoftNETRuntimeEmscriptenVersion>
245245
<!-- workloads -->
246246
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>

eng/pipelines/libraries/helix-queues-setup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787

8888
# Linux PPC64le
8989
- ${{ if eq(parameters.platform, 'linux_ppc64le') }}:
90-
- Ubuntu.2004.PPC64le.Experimental.Open
90+
- Ubuntu.2204.PPC64le.Experimental.Open
9191

9292
# OSX arm64
9393
- ${{ if eq(parameters.platform, 'osx_arm64') }}:

src/coreclr/debug/shared/dbgtransportsession.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -2499,9 +2499,11 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent)
24992499
break;
25002500

25012501
case DB_IPCE_DISABLE_OPTS:
2502+
cbAdditionalSize = sizeof(pEvent->DisableOptData);
2503+
break;
25022504

25032505
default:
2504-
printf("Unknown debugger event type: 0x%x\n", (pEvent->type & DB_IPCE_TYPE_MASK));
2506+
STRESS_LOG1(LF_CORDB, LL_INFO1000, "Unknown debugger event type: 0x%x\n", (pEvent->type & DB_IPCE_TYPE_MASK));
25052507
_ASSERTE(!"Unknown debugger event type");
25062508
}
25072509

src/coreclr/jit/hwintrinsicxarch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ GenTree* Compiler::impNonConstFallback(NamedIntrinsic intrinsic, var_types simdT
924924
GenTree* op2 = impPopStack().val;
925925
GenTree* op1 = impSIMDPopStack();
926926

927-
GenTree* tmpOp = gtNewSimdCreateScalarUnsafeNode(TYP_SIMD16, op2, CORINFO_TYPE_INT, 16);
927+
GenTree* tmpOp = gtNewSimdCreateScalarNode(TYP_SIMD16, op2, CORINFO_TYPE_INT, 16);
928928
return gtNewSimdHWIntrinsicNode(simdType, op1, tmpOp, intrinsic, simdBaseJitType, genTypeSize(simdType));
929929
}
930930

src/coreclr/jit/importercalls.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -8290,7 +8290,8 @@ GenTree* Compiler::impMinMaxIntrinsic(CORINFO_METHOD_HANDLE method,
82908290

82918291
if (isNumber)
82928292
{
8293-
std::swap(op1, op2);
8293+
// Swap the operands so that the cnsNode is op1, this prevents
8294+
// the unknown value (which could be NaN) from being selected.
82948295

82958296
retNode->AsHWIntrinsic()->Op(1) = op2;
82968297
retNode->AsHWIntrinsic()->Op(2) = op1;

src/coreclr/jit/morph.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -10724,6 +10724,16 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)
1072410724
break;
1072510725
}
1072610726

10727+
#if defined(TARGET_XARCH)
10728+
if ((node->GetSimdSize() == 8) && !compOpportunisticallyDependsOn(InstructionSet_SSE41))
10729+
{
10730+
// When SSE4.1 isn't supported then Vector2 only needs a single horizontal add
10731+
// which means the result isn't broadcast across the entire vector and we can't
10732+
// optimize
10733+
break;
10734+
}
10735+
#endif // TARGET_XARCH
10736+
1072710737
GenTree* op1 = node->Op(1);
1072810738
GenTree* sqrt = nullptr;
1072910739
GenTree* toScalar = nullptr;

src/coreclr/jit/simd.h

+51-3
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,23 @@ void EvaluateUnarySimd(genTreeOps oper, bool scalar, var_types baseType, TSimd*
453453
template <typename TBase>
454454
TBase EvaluateBinaryScalarRSZ(TBase arg0, TBase arg1)
455455
{
456-
return arg0 >> (arg1 & ((sizeof(TBase) * 8) - 1));
456+
#if defined(TARGET_XARCH)
457+
if ((arg1 < 0) || (arg1 >= (sizeof(TBase) * 8)))
458+
{
459+
// For SIMD, xarch allows overshifting and treats
460+
// it as zeroing. So ensure we do the same here.
461+
//
462+
// The xplat APIs ensure the shiftAmount is masked
463+
// to be within range, so we can't hit this for them.
464+
465+
return static_cast<TBase>(0);
466+
}
467+
#else
468+
// Other platforms enforce masking in their encoding
469+
assert((arg1 >= 0) && (arg1 < (sizeof(TBase) * 8)));
470+
#endif
471+
472+
return arg0 >> arg1;
457473
}
458474

459475
template <>
@@ -513,7 +529,22 @@ TBase EvaluateBinaryScalarSpecialized(genTreeOps oper, TBase arg0, TBase arg1)
513529

514530
case GT_LSH:
515531
{
516-
return arg0 << (arg1 & ((sizeof(TBase) * 8) - 1));
532+
#if defined(TARGET_XARCH)
533+
if ((arg1 < 0) || (arg1 >= (sizeof(TBase) * 8)))
534+
{
535+
// For SIMD, xarch allows overshifting and treats
536+
// it as zeroing. So ensure we do the same here.
537+
//
538+
// The xplat APIs ensure the shiftAmount is masked
539+
// to be within range, so we can't hit this for them.
540+
541+
return static_cast<TBase>(0);
542+
}
543+
#else
544+
// Other platforms enforce masking in their encoding
545+
assert((arg1 >= 0) && (arg1 < (sizeof(TBase) * 8)));
546+
#endif
547+
return arg0 << arg1;
517548
}
518549

519550
case GT_OR:
@@ -535,7 +566,24 @@ TBase EvaluateBinaryScalarSpecialized(genTreeOps oper, TBase arg0, TBase arg1)
535566

536567
case GT_RSH:
537568
{
538-
return arg0 >> (arg1 & ((sizeof(TBase) * 8) - 1));
569+
#if defined(TARGET_XARCH)
570+
if ((arg1 < 0) || (arg1 >= (sizeof(TBase) * 8)))
571+
{
572+
// For SIMD, xarch allows overshifting and treats
573+
// it as propagating the sign bit (returning Zero
574+
// or AllBitsSet). So ensure we do the same here.
575+
//
576+
// The xplat APIs ensure the shiftAmount is masked
577+
// to be within range, so we can't hit this for them.
578+
579+
arg0 >>= ((sizeof(TBase) * 8) - 1);
580+
arg1 = static_cast<TBase>(1);
581+
}
582+
#else
583+
// Other platforms enforce masking in their encoding
584+
assert((arg1 >= 0) && (arg1 < (sizeof(TBase) * 8)));
585+
#endif
586+
return arg0 >> arg1;
539587
}
540588

541589
case GT_RSZ:

0 commit comments

Comments
 (0)