Mercurial > hg > graal-compiler
diff src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @ 2415:09f96c3ff1ad
7032388: guarantee(VM_Version::supports_cmov()) failed: illegal instruction on i586 after 6919934
Summary: 6919934 added some unguarded cmov instructions which hit a guarantee on older hardware.
Reviewed-by: never, iveresov, kvn, phh
author | twisti |
---|---|
date | Thu, 31 Mar 2011 00:27:08 -0700 |
parents | b40d4fa697bf |
children | 13bc79b5c9c8 |
line wrap: on
line diff
--- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Wed Mar 30 18:55:04 2011 -0700 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Thu Mar 31 00:27:08 2011 -0700 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/assembler.hpp" #include "c1/c1_Compilation.hpp" #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_MacroAssembler.hpp" @@ -569,24 +570,13 @@ __ lea (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); // compute minimum length (in rax) and difference of lengths (on top of stack) - if (VM_Version::supports_cmov()) { - __ movl (rbx, Address(rbx, java_lang_String::count_offset_in_bytes())); - __ movl (rax, Address(rax, java_lang_String::count_offset_in_bytes())); - __ mov (rcx, rbx); - __ subptr (rbx, rax); // subtract lengths - __ push (rbx); // result - __ cmov (Assembler::lessEqual, rax, rcx); - } else { - Label L; - __ movl (rbx, Address(rbx, java_lang_String::count_offset_in_bytes())); - __ movl (rcx, Address(rax, java_lang_String::count_offset_in_bytes())); - __ mov (rax, rbx); - __ subptr (rbx, rcx); - __ push (rbx); - __ jcc (Assembler::lessEqual, L); - __ mov (rax, rcx); - __ bind (L); - } + __ movl (rbx, Address(rbx, java_lang_String::count_offset_in_bytes())); + __ movl (rax, Address(rax, java_lang_String::count_offset_in_bytes())); + __ mov (rcx, rbx); + __ subptr(rbx, rax); // subtract lengths + __ push (rbx); // result + __ cmov (Assembler::lessEqual, rax, rcx); + // is minimum length 0? Label noLoop, haveResult; __ testptr (rax, rax);