diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs index 20e33b642fc15f..70092316218fcd 100644 --- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs +++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs @@ -38,7 +38,7 @@ public static MethodIL EmitIL( { ceArgType = method.Context.GetWellKnownType(WellKnownType.Object); } - else if ((tType.IsPrimitive || tType.IsEnum) && (tType.UnderlyingType.Category is not (TypeFlags.Single or TypeFlags.Double))) + else if (tType.IsPrimitive || tType.IsEnum) { int size = tType.GetElementSize().AsInt; Debug.Assert(size is 1 or 2 or 4 or 8); @@ -46,7 +46,9 @@ public static MethodIL EmitIL( { 1 => method.Context.GetWellKnownType(WellKnownType.Byte), 2 => method.Context.GetWellKnownType(WellKnownType.UInt16), + 4 when tType.UnderlyingType.Category is TypeFlags.Single => method.Context.GetWellKnownType(WellKnownType.Single), 4 => method.Context.GetWellKnownType(WellKnownType.Int32), + _ when tType.UnderlyingType.Category is TypeFlags.Double => method.Context.GetWellKnownType(WellKnownType.Double), _ => method.Context.GetWellKnownType(WellKnownType.Int64), }; }