mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8327964: Simplify BigInteger.implMultiplyToLen intrinsic
Reviewed-by: mdoerr, amitkumar, kvn, fyang
This commit is contained in:
parent
08face8c4c
commit
ed81a478e1
17 changed files with 64 additions and 135 deletions
|
@ -1831,6 +1831,10 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
|
|||
private static int[] multiplyToLen(int[] x, int xlen, int[] y, int ylen, int[] z) {
|
||||
multiplyToLenCheck(x, xlen);
|
||||
multiplyToLenCheck(y, ylen);
|
||||
|
||||
if (z == null || z.length < (xlen + ylen))
|
||||
z = new int[xlen + ylen];
|
||||
|
||||
return implMultiplyToLen(x, xlen, y, ylen, z);
|
||||
}
|
||||
|
||||
|
@ -1839,9 +1843,6 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
|
|||
int xstart = xlen - 1;
|
||||
int ystart = ylen - 1;
|
||||
|
||||
if (z == null || z.length < (xlen+ ylen))
|
||||
z = new int[xlen+ylen];
|
||||
|
||||
long carry = 0;
|
||||
for (int j=ystart, k=ystart+1+xstart; j >= 0; j--, k--) {
|
||||
long product = (y[j] & LONG_MASK) *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue