comparison src/cpu/x86/vm/macroAssembler_x86.cpp @ 17922:400709e275c1

8029302: Performance regression in Math.pow intrinsic Summary: Added special case for x^y where y == 2 Reviewed-by: kvn
author adlertz
date Fri, 25 Apr 2014 12:48:34 +0200
parents 526acaf3626f
children 78bbf4d43a14
comparison
equal deleted inserted replaced
17921:f1b83c6b8411 17922:400709e275c1
3150 void MacroAssembler::fast_pow() { 3150 void MacroAssembler::fast_pow() {
3151 // computes X^Y = 2^(Y * log2(X)) 3151 // computes X^Y = 2^(Y * log2(X))
3152 // if fast computation is not possible, result is NaN. Requires 3152 // if fast computation is not possible, result is NaN. Requires
3153 // fallback from user of this macro. 3153 // fallback from user of this macro.
3154 // increase precision for intermediate steps of the computation 3154 // increase precision for intermediate steps of the computation
3155 BLOCK_COMMENT("fast_pow {");
3155 increase_precision(); 3156 increase_precision();
3156 fyl2x(); // Stack: (Y*log2(X)) ... 3157 fyl2x(); // Stack: (Y*log2(X)) ...
3157 pow_exp_core_encoding(); // Stack: exp(X) ... 3158 pow_exp_core_encoding(); // Stack: exp(X) ...
3158 restore_precision(); 3159 restore_precision();
3160 BLOCK_COMMENT("} fast_pow");
3159 } 3161 }
3160 3162
3161 void MacroAssembler::fast_exp() { 3163 void MacroAssembler::fast_exp() {
3162 // computes exp(X) = 2^(X * log2(e)) 3164 // computes exp(X) = 2^(X * log2(e))
3163 // if fast computation is not possible, result is NaN. Requires 3165 // if fast computation is not possible, result is NaN. Requires