JDK-4850194 : (C1) Intrinsics for operations used in crypto
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 5.0,9,10
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2003-04-17
  • Updated: 2017-02-17
  • Resolved: 2017-02-17
Related Reports
Relates :  
Relates :  
It should be possible to get a noticeable improvement in the performance of some of the crypto code by adding a few intrinsics:

 (1) unsigned integer to long conversion. (i & 0xffffffffL) to zero-extend integers to longs.

 (2) multiplication u32 * u32 -> u64. (a & 0xffffffffL) * (b & 0xffffffffL)

 (3) divide and remainder: u64 / u32 -> u32, u64 % u32 -> u32. Because Java does not have unsigned arithmetic, this currently has to be emulated using several lines of Java code, see MutableBigInteger.divideOneWord and divWord.

 (4) 32 bit rotate. (a >>> r) | (a << (32 - r))

Methods for (1)-(3) will probably we defined as part of 4504839, for (4) with 4495754. If that does not happen, I would suggest defining internal APIs for this.

BigInteger and our crypto implementations would need to be modified to use those new methods, but that should be trivial.

The same RFE has been filed against C2 as JDK-4850191.

###@###.### 2003-04-17

The problem for C2 was apparently fixed by JDK-4850191. We also have a number of crypto intrinsics already available. Finally, with tiered compilation enabled, performance-critical methods will eventually be compiled/intrinsified by C2, therefore I do not see much benefit for spending time on this issue.

EVALUATION Will try to do this for 1.5. ###@###.### 2003-04-17