(value, bits, ignore)
| 1339 | : Math.pow(2, bits) + value; |
| 1340 | } |
| 1341 | function reSign(value, bits, ignore) { |
| 1342 | if (value <= 0) { |
| 1343 | return value; |
| 1344 | } |
| 1345 | var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32 |
| 1346 | : Math.pow(2, bits-1); |
| 1347 | if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that |
| 1348 | // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors |
| 1349 | // TODO: In i64 mode 1, resign the two parts separately and safely |
| 1350 | value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts |
| 1351 | } |
| 1352 | return value; |
| 1353 | } |
| 1354 | |
| 1355 | assert(Math['imul'] && Math['fround'] && Math['clz32'] && Math['trunc'], 'this is a legacy browser, build with LEGACY_VM_SUPPORT'); |
| 1356 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…