') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Fix buffer overrun in JIT for Vector256<T> types on ARM64 by AntonLapounov · Pull Request #35864 · dotnet/runtime · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/coreclr/src/jit/compiler.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -1738,6 +1738,10 @@ struct fgArgTabEntry
#else
unsigned int regSize = 1;
#endif

if (numRegs > MAX_ARG_REG_COUNT)
NO_WAY("Multireg argument exceeds the maximum length");

for (unsigned int regIndex = 1; regIndex < numRegs; regIndex++)
{
argReg = (regNumber)(argReg + regSize);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -96,7 +96,6 @@ public override ValueTypeShapeCharacteristics ComputeValueTypeShapeCharacteristi
{
8 => ValueTypeShapeCharacteristics.Vector64Aggregate,
16 => ValueTypeShapeCharacteristics.Vector128Aggregate,
32 => ValueTypeShapeCharacteristics.Vector256Aggregate,
_ => ValueTypeShapeCharacteristics.None
};
}
Expand All@@ -107,9 +106,7 @@ public static bool IsVectorType(DefType type)
{
return type.IsIntrinsic &&
type.Namespace == "System.Runtime.Intrinsics" &&
(type.Name == "Vector64`1" ||
type.Name == "Vector128`1" ||
type.Name == "Vector256`1") &&
((type.Name == "Vector64`1") || (type.Name == "Vector128`1")) &&
type.Instantiation[0].IsPrimitive;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -2206,15 +2206,14 @@ private CorInfoType getHFAType(CORINFO_CLASS_STRUCT_* hClass)
var type = (DefType)HandleToObject(hClass);

// For 8-byte vectors return CORINFO_TYPE_DOUBLE, which is mapped by JIT to SIMD8.
// Otherwise, return CORINFO_TYPE_VALUECLASS, which is mapped by JIT to SIMD16.
// For 16-byte vectors return CORINFO_TYPE_VALUECLASS, which is mapped by JIT to SIMD16.
// See MethodTable::GetHFAType and Compiler::GetHfaType.
return (type.ValueTypeShapeCharacteristics & ValueTypeShapeCharacteristics.AggregateMask) switch
{
ValueTypeShapeCharacteristics.Float32Aggregate => CorInfoType.CORINFO_TYPE_FLOAT,
ValueTypeShapeCharacteristics.Float64Aggregate => CorInfoType.CORINFO_TYPE_DOUBLE,
ValueTypeShapeCharacteristics.Vector64Aggregate => CorInfoType.CORINFO_TYPE_DOUBLE,
ValueTypeShapeCharacteristics.Vector128Aggregate => CorInfoType.CORINFO_TYPE_VALUECLASS,
ValueTypeShapeCharacteristics.Vector256Aggregate => CorInfoType.CORINFO_TYPE_VALUECLASS,
_ => CorInfoType.CORINFO_TYPE_UNDEF
};
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,7 +321,6 @@ public int GetHomogeneousAggregateElementSize()
ValueTypeShapeCharacteristics.Float64Aggregate => 8,
ValueTypeShapeCharacteristics.Vector64Aggregate => 8,
ValueTypeShapeCharacteristics.Vector128Aggregate => 16,
ValueTypeShapeCharacteristics.Vector256Aggregate => 16,
_ => throw new InvalidOperationException()
};
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -132,11 +132,6 @@ public enum ValueTypeShapeCharacteristics
/// </summary>
Vector128Aggregate = 0x08,

/// <summary>
/// The type is an aggregate of 256-bit short-vector values.
/// </summary>
Vector256Aggregate = 0x10,

/// <summary>
/// The mask for homogeneous aggregates of floating-point values.
/// </summary>
Expand All@@ -145,7 +140,7 @@ public enum ValueTypeShapeCharacteristics
/// <summary>
/// The mask for homogeneous aggregates of short-vector values.
/// </summary>
ShortVectorAggregateMask = Vector64Aggregate | Vector128Aggregate | Vector256Aggregate,
ShortVectorAggregateMask = Vector64Aggregate | Vector128Aggregate,

/// <summary>
/// The mask for homogeneous aggregates.
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -906,7 +906,6 @@ private ValueTypeShapeCharacteristics ComputeHomogeneousAggregateCharacteristic(
ValueTypeShapeCharacteristics.Float64Aggregate => 8,
ValueTypeShapeCharacteristics.Vector64Aggregate => 8,
ValueTypeShapeCharacteristics.Vector128Aggregate => 16,
ValueTypeShapeCharacteristics.Vector256Aggregate => 32,
_ => throw new ArgumentOutOfRangeException()
};

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,6 @@ private static void EncodeTypeLayout(ObjectDataSignatureBuilder dataBuilder, Typ
ValueTypeShapeCharacteristics.Vector64Aggregate => CorElementType.ELEMENT_TYPE_R8,
// See MethodTable::GetHFAType
ValueTypeShapeCharacteristics.Vector128Aggregate => CorElementType.ELEMENT_TYPE_VALUETYPE,
ValueTypeShapeCharacteristics.Vector256Aggregate => CorElementType.ELEMENT_TYPE_VALUETYPE,
_ => CorElementType.Invalid
};
dataBuilder.EmitUInt((uint)elementType);
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/src/vm/class.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -1195,10 +1195,6 @@ int MethodTable::GetVectorSize()
{
vectorSize = 16;
}
else if (strcmp(className, "Vector256`1") == 0)
{
vectorSize = 32;
}
else if (strcmp(className, "Vector64`1") == 0)
{
vectorSize = 8;
Expand Down