comparison src/cpu/x86/vm/stubGenerator_x86_64.cpp @ 1365:6476042f815c

6940701: Don't align loops in stubs for Niagara sparc Summary: Don't align loops in stubs for Niagara sparc since NOPs are expensive. Reviewed-by: twisti, never
author kvn
date Wed, 07 Apr 2010 09:37:47 -0700
parents 9eba43136cb5
children 2338d41fbd81
comparison
equal deleted inserted replaced
1364:0dc88ad3244e 1365:6476042f815c
869 869
870 return start; 870 return start;
871 } 871 }
872 872
873 address generate_fp_mask(const char *stub_name, int64_t mask) { 873 address generate_fp_mask(const char *stub_name, int64_t mask) {
874 __ align(CodeEntryAlignment);
874 StubCodeMark mark(this, "StubRoutines", stub_name); 875 StubCodeMark mark(this, "StubRoutines", stub_name);
875
876 __ align(16);
877 address start = __ pc(); 876 address start = __ pc();
878 877
879 __ emit_data64( mask, relocInfo::none ); 878 __ emit_data64( mask, relocInfo::none );
880 __ emit_data64( mask, relocInfo::none ); 879 __ emit_data64( mask, relocInfo::none );
881 880
1266 void copy_32_bytes_forward(Register end_from, Register end_to, 1265 void copy_32_bytes_forward(Register end_from, Register end_to,
1267 Register qword_count, Register to, 1266 Register qword_count, Register to,
1268 Label& L_copy_32_bytes, Label& L_copy_8_bytes) { 1267 Label& L_copy_32_bytes, Label& L_copy_8_bytes) {
1269 DEBUG_ONLY(__ stop("enter at entry label, not here")); 1268 DEBUG_ONLY(__ stop("enter at entry label, not here"));
1270 Label L_loop; 1269 Label L_loop;
1271 __ align(16); 1270 __ align(OptoLoopAlignment);
1272 __ BIND(L_loop); 1271 __ BIND(L_loop);
1273 if(UseUnalignedLoadStores) { 1272 if(UseUnalignedLoadStores) {
1274 __ movdqu(xmm0, Address(end_from, qword_count, Address::times_8, -24)); 1273 __ movdqu(xmm0, Address(end_from, qword_count, Address::times_8, -24));
1275 __ movdqu(Address(end_to, qword_count, Address::times_8, -24), xmm0); 1274 __ movdqu(Address(end_to, qword_count, Address::times_8, -24), xmm0);
1276 __ movdqu(xmm1, Address(end_from, qword_count, Address::times_8, - 8)); 1275 __ movdqu(xmm1, Address(end_from, qword_count, Address::times_8, - 8));
1307 void copy_32_bytes_backward(Register from, Register dest, 1306 void copy_32_bytes_backward(Register from, Register dest,
1308 Register qword_count, Register to, 1307 Register qword_count, Register to,
1309 Label& L_copy_32_bytes, Label& L_copy_8_bytes) { 1308 Label& L_copy_32_bytes, Label& L_copy_8_bytes) {
1310 DEBUG_ONLY(__ stop("enter at entry label, not here")); 1309 DEBUG_ONLY(__ stop("enter at entry label, not here"));
1311 Label L_loop; 1310 Label L_loop;
1312 __ align(16); 1311 __ align(OptoLoopAlignment);
1313 __ BIND(L_loop); 1312 __ BIND(L_loop);
1314 if(UseUnalignedLoadStores) { 1313 if(UseUnalignedLoadStores) {
1315 __ movdqu(xmm0, Address(from, qword_count, Address::times_8, 16)); 1314 __ movdqu(xmm0, Address(from, qword_count, Address::times_8, 16));
1316 __ movdqu(Address(dest, qword_count, Address::times_8, 16), xmm0); 1315 __ movdqu(Address(dest, qword_count, Address::times_8, 16), xmm0);
1317 __ movdqu(xmm1, Address(from, qword_count, Address::times_8, 0)); 1316 __ movdqu(xmm1, Address(from, qword_count, Address::times_8, 0));
2227 // ======== begin loop ======== 2226 // ======== begin loop ========
2228 // (Loop is rotated; its entry is L_load_element.) 2227 // (Loop is rotated; its entry is L_load_element.)
2229 // Loop control: 2228 // Loop control:
2230 // for (count = -count; count != 0; count++) 2229 // for (count = -count; count != 0; count++)
2231 // Base pointers src, dst are biased by 8*(count-1),to last element. 2230 // Base pointers src, dst are biased by 8*(count-1),to last element.
2232 __ align(16); 2231 __ align(OptoLoopAlignment);
2233 2232
2234 __ BIND(L_store_element); 2233 __ BIND(L_store_element);
2235 __ store_heap_oop(to_element_addr, rax_oop); // store the oop 2234 __ store_heap_oop(to_element_addr, rax_oop); // store the oop
2236 __ increment(count); // increment the count toward zero 2235 __ increment(count); // increment the count toward zero
2237 __ jcc(Assembler::zero, L_do_card_marks); 2236 __ jcc(Assembler::zero, L_do_card_marks);