Wed, 17 May 2017 03:46:25 -0400
#5481 Vector optimization was not used by default.
Vector optimization of MIPS works in most cases, but cannot pass hotspot/test/compiler/6340864/TestFloatVect.java.
The reasons:
1. The kernel does not have emulation of PS instructions yet, so the emulation of PS instructions must be done in JVM, see JVM_handle_linux_signal.
2. It seems the gcc4.4.7 had some bug related to ucontext_t, which is used in signal handler to emulate PS instructions.
use java -XX:MaxVectorSize=8 to enable Vector optimization.
src/cpu/mips/vm/mips_64.ad | file | annotate | diff | comparison | revisions | |
src/cpu/mips/vm/vm_version_mips.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/mips_64.ad Tue May 16 16:35:16 2017 -0400 1.2 +++ b/src/cpu/mips/vm/mips_64.ad Wed May 17 03:46:25 2017 -0400 1.3 @@ -692,6 +692,8 @@ 1.4 1.5 // Max vector size in bytes. 0 if not supported. 1.6 const int Matcher::vector_width_in_bytes(BasicType bt) { 1.7 + if (MaxVectorSize == 0) 1.8 + return 0; 1.9 assert(MaxVectorSize == 8, ""); 1.10 return 8; 1.11 }
2.1 --- a/src/cpu/mips/vm/vm_version_mips.cpp Tue May 16 16:35:16 2017 -0400 2.2 +++ b/src/cpu/mips/vm/vm_version_mips.cpp Wed May 17 03:46:25 2017 -0400 2.3 @@ -91,6 +91,18 @@ 2.4 MaxVectorSize = 8; 2.5 } 2.6 } 2.7 +/* 2.8 + * 2.9 + * 2017/5/17: 2.10 + * Vector optimization of MIPS works in most cases, but cannot pass hotspot/test/compiler/6340864/TestFloatVect.java. 2.11 + * Vector optimization was closed by default. 2.12 + * The reasons: 2.13 + * 1. The kernel does not have emulation of PS instructions yet, so the emulation of PS instructions must be done in JVM, see JVM_handle_linux_signal. 2.14 + * 2. It seems the gcc4.4.7 had some bug related to ucontext_t, which is used in signal handler to emulate PS instructions. 2.15 + */ 2.16 + if (FLAG_IS_DEFAULT(MaxVectorSize)) { 2.17 + MaxVectorSize = 0; 2.18 + } 2.19 2.20 if (is_gs464e()) { 2.21 if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) {