private static long addUnsignedReturnOverflow ( Slice left , Slice right , Slice result , boolean resultNegative ) { // TODO: consider two 7 bytes operations int l0 = getInt ( left , 0 ) ; int l1 = getInt ( left , 1 ) ; int l2 = getInt ( left , 2 ) ; int l3 = getInt ( left , 3 ) ; int r0 = getInt ( right , 0 ) ; int r1 = getInt ( right , 1 ) ; int r2 = getInt ( right , 2 ) ; int r3 = getInt ( right , 3 ) ; long intermediateResult ; intermediateResult = ( l0 & LONG_MASK ) + ( r0 & LONG_MASK ) ; int z0 = ( int ) intermediateResult ; intermediateResult = ( l1 & LONG_MASK ) + ( r1 & LONG_MASK ) + ( intermediateResult >>> 32 ) ; int z1 = ( int ) intermediateResult ; intermediateResult = ( l2 & LONG_MASK ) + ( r2 & LONG_MASK ) + ( intermediateResult >>> 32 ) ; int z2 = ( int ) intermediateResult ; intermediateResult = ( l3 & LONG_MASK ) + ( r3 & LONG_MASK ) + ( intermediateResult >>> 32 ) ; int z3 = ( int ) intermediateResult & ( ~ SIGN_INT_MASK ) ; pack ( result , z0 , z1 , z2 , z3 , resultNegative ) ; return intermediateResult >> 31 ; }
This method ignores signs of the left and right . Returns overflow value .