8041957: -XX:UseAVX=0 cause assert(UseAVX) failed

Temporary set UseAVX=1 and UseSSE=2 in generate_get_cpu_info()

Reviewed-by: twisti
This commit is contained in:
Vladimir Kozlov 2014-04-29 12:20:53 -07:00
parent 5c074b749c
commit d9056b18ee
2 changed files with 9 additions and 3 deletions

View File

@ -1766,7 +1766,7 @@ void Assembler::movdqu(Address dst, XMMRegister src) {
// Move Unaligned 256bit Vector
void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) {
assert(UseAVX, "");
assert(UseAVX > 0, "");
bool vector256 = true;
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256);
emit_int8(0x6F);
@ -1774,7 +1774,7 @@ void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) {
}
void Assembler::vmovdqu(XMMRegister dst, Address src) {
assert(UseAVX, "");
assert(UseAVX > 0, "");
InstructionMark im(this);
bool vector256 = true;
vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256);
@ -1783,7 +1783,7 @@ void Assembler::vmovdqu(XMMRegister dst, Address src) {
}
void Assembler::vmovdqu(Address dst, XMMRegister src) {
assert(UseAVX, "");
assert(UseAVX > 0, "");
InstructionMark im(this);
bool vector256 = true;
// swap src<->dst for encoding

View File

@ -263,6 +263,10 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
// and check upper YMM bits after it.
//
VM_Version::set_avx_cpuFeatures(); // Enable temporary to pass asserts
intx saved_useavx = UseAVX;
intx saved_usesse = UseSSE;
UseAVX = 1;
UseSSE = 2;
// load value into all 32 bytes of ymm7 register
__ movl(rcx, VM_Version::ymm_test_value());
@ -292,6 +296,8 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
#endif
VM_Version::clean_cpuFeatures();
UseAVX = saved_useavx;
UseSSE = saved_usesse;
//
// cpuid(0x7) Structured Extended Features