MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / _Lsub

Function _Lsub

vm/ByteCodeTranslator/src/javascript/parparvm_runtime.js:3745–3758  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

3743}
3744function _Lneg(a) { a = _Lc(a); return _Leq(a, _LMIN) ? _LMIN : _Ladd(_LL(~a.l, ~a.h), _L1); }
3745function _Lsub(a, b) {
3746 // a - b = a + ~b + 1, inlined as a single 16-bit add chain (one allocation
3747 // instead of _Lneg+_Ladd's two) -- LSUB is hot in timing/loops.
3748 a = _Lc(a); b = _Lc(b);
3749 const a48 = a.h >>> 16, a32 = a.h & 0xFFFF, a16 = a.l >>> 16, a00 = a.l & 0xFFFF;
3750 const nl = ~b.l, nh = ~b.h;
3751 const b48 = nh >>> 16, b32 = nh & 0xFFFF, b16 = nl >>> 16, b00 = nl & 0xFFFF;
3752 let c00 = a00 + b00 + 1, c16 = 0, c32 = 0, c48 = 0; // +1 = the two's-complement carry-in
3753 c16 += c00 >>> 16; c00 &= 0xFFFF;
3754 c16 += a16 + b16; c32 += c16 >>> 16; c16 &= 0xFFFF;
3755 c32 += a32 + b32; c48 += c32 >>> 16; c32 &= 0xFFFF;
3756 c48 += a48 + b48; c48 &= 0xFFFF;
3757 return _LL((c16 << 16) | c00, (c48 << 16) | c32);
3758}
3759function _Lmul(a, b) {
3760 a = _Lc(a); b = _Lc(b);
3761 const a48 = a.h >>> 16, a32 = a.h & 0xFFFF, a16 = a.l >>> 16, a00 = a.l & 0xFFFF;

Callers 3

_LdivFunction · 0.85
_LremFunction · 0.85
_LtoStrFunction · 0.85

Calls 2

_LcFunction · 0.85
_LLFunction · 0.85

Tested by

no test coverage detected