8282221: x86 intrinsics for divideUnsigned and remainderUnsigned methods in java.lang.Integer and java.lang.Long

Reviewed-by: sviswanathan, kvn, jbhateja
This commit is contained in:
vamsi-parasa 2022-04-10 03:47:18 +00:00 committed by Jatin Bhateja
parent 0b867b5e73
commit 37e28aea27
20 changed files with 1155 additions and 2 deletions

View file

@ -1542,6 +1542,7 @@ public final class Integer extends Number
* @see #remainderUnsigned
* @since 1.8
*/
@IntrinsicCandidate
public static int divideUnsigned(int dividend, int divisor) {
// In lieu of tricky code, for now just use long arithmetic.
return (int)(toUnsignedLong(dividend) / toUnsignedLong(divisor));
@ -1559,6 +1560,7 @@ public final class Integer extends Number
* @see #divideUnsigned
* @since 1.8
*/
@IntrinsicCandidate
public static int remainderUnsigned(int dividend, int divisor) {
// In lieu of tricky code, for now just use long arithmetic.
return (int)(toUnsignedLong(dividend) % toUnsignedLong(divisor));