RFR: 8046943: RSA Acceleration

Andrew Haley aph at redhat.com
Fri Jun 19 08:34:28 UTC 2015

On 18/06/15 20:28, Vladimir Kozlov wrote:

> We have few new rules regarding intrinsics.
> You need to add private static java method which does range checks 
> because their are not executed in intrinsic code - see squareToLen() 
> implementation, for example.


> Note, we will rewrite multiplyToLen() too soon.


> Also method which will be intrinsified should be private static too and 
> you can move allocation from it (like we did for squareToLen()) to avoid 
> allocation in intrinsic code.

I like that.  It's surely a lot less complicated than what I've got
right now.

> Your Hotspot changes are hard to accept. We have to compile for solaris 
> with Sun compilers which does not work with such changes:
> "hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp", line 3525: Warning: 
> parameter in inline asm statement unused: %3.
> "hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp", line 3525: Warning: 
> parameter in inline asm statement unused: %6.
> "hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp", line 3701: Error: The 
> function "__builtin_expect" must have a prototype.
> "hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp", line 3707: Error: The 
> function "__builtin_alloca" must have a prototype.

Sure.  I didn't realize that you were compiling that code with
non-GCC.  __builtin_alloca() can just be replaced by alloca() on

> May be you can convert the code to stub and add new MacroAssembler 
> functions which you can use in sharedRuntime_x86_64.cpp.

I don't think so.  It's fast because it is truly inline assembler,
inserted into the C code.  If I had some way to access an x86 Solaris
machine I'd test it there.

But those warnings about unused parameters are just warnings.  It may
be that the code would work on a Sun compiler.  Can you please try to
replace __builtin_alloca() with alloca() and then tell me if the code

> Yes, it is a lot of handwriting but we need it to work on all OSs.

Sure, I get that.  I knew there would be a few goes around with this,
but it's worth the pain for the performance improvement.


More information about the hotspot-compiler-dev mailing list