Skip to content

Commit d820bc1

Browse files
committed
remove legacy support for polyfilling Math.clz32, imul, trunc
1 parent 606f722 commit d820bc1

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

src/preamble.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,46 +1678,6 @@ function writeAsciiToMemory(str, buffer, dontAddNull) {
16781678
{{{ unSign }}}
16791679
{{{ reSign }}}
16801680

1681-
// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )
1682-
if (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {
1683-
var ah = a >>> 16;
1684-
var al = a & 0xffff;
1685-
var bh = b >>> 16;
1686-
var bl = b & 0xffff;
1687-
return (al*bl + ((ah*bl + al*bh) << 16))|0;
1688-
};
1689-
Math.imul = Math['imul'];
1690-
1691-
#if PRECISE_F32
1692-
#if PRECISE_F32 == 1
1693-
if (!Math['fround']) {
1694-
var froundBuffer = new Float32Array(1);
1695-
Math['fround'] = function(x) { froundBuffer[0] = x; return froundBuffer[0] };
1696-
}
1697-
#else // 2
1698-
if (!Math['fround']) Math['fround'] = function(x) { return x };
1699-
#endif
1700-
Math.fround = Math['fround'];
1701-
#else
1702-
#if SIMD
1703-
if (!Math['fround']) Math['fround'] = function(x) { return x };
1704-
#endif
1705-
#endif
1706-
1707-
if (!Math['clz32']) Math['clz32'] = function(x) {
1708-
x = x >>> 0;
1709-
for (var i = 0; i < 32; i++) {
1710-
if (x & (1 << (31 - i))) return i;
1711-
}
1712-
return 32;
1713-
};
1714-
Math.clz32 = Math['clz32']
1715-
1716-
if (!Math['trunc']) Math['trunc'] = function(x) {
1717-
return x < 0 ? Math.ceil(x) : Math.floor(x);
1718-
};
1719-
Math.trunc = Math['trunc'];
1720-
17211681
var Math_abs = Math.abs;
17221682
var Math_cos = Math.cos;
17231683
var Math_sin = Math.sin;

0 commit comments

Comments
 (0)