Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/stubGenerator_x86_32.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 | 93767e6a2dfd |
comparison
equal
deleted
inserted
replaced
1364:0dc88ad3244e | 1365:6476042f815c |
---|---|
810 void xmm_copy_forward(Register from, Register to_from, Register qword_count) { | 810 void xmm_copy_forward(Register from, Register to_from, Register qword_count) { |
811 assert( UseSSE >= 2, "supported cpu only" ); | 811 assert( UseSSE >= 2, "supported cpu only" ); |
812 Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit; | 812 Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit; |
813 // Copy 64-byte chunks | 813 // Copy 64-byte chunks |
814 __ jmpb(L_copy_64_bytes); | 814 __ jmpb(L_copy_64_bytes); |
815 __ align(16); | 815 __ align(OptoLoopAlignment); |
816 __ BIND(L_copy_64_bytes_loop); | 816 __ BIND(L_copy_64_bytes_loop); |
817 | 817 |
818 if(UseUnalignedLoadStores) { | 818 if(UseUnalignedLoadStores) { |
819 __ movdqu(xmm0, Address(from, 0)); | 819 __ movdqu(xmm0, Address(from, 0)); |
820 __ movdqu(Address(from, to_from, Address::times_1, 0), xmm0); | 820 __ movdqu(Address(from, to_from, Address::times_1, 0), xmm0); |
872 void mmx_copy_forward(Register from, Register to_from, Register qword_count) { | 872 void mmx_copy_forward(Register from, Register to_from, Register qword_count) { |
873 assert( VM_Version::supports_mmx(), "supported cpu only" ); | 873 assert( VM_Version::supports_mmx(), "supported cpu only" ); |
874 Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit; | 874 Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit; |
875 // Copy 64-byte chunks | 875 // Copy 64-byte chunks |
876 __ jmpb(L_copy_64_bytes); | 876 __ jmpb(L_copy_64_bytes); |
877 __ align(16); | 877 __ align(OptoLoopAlignment); |
878 __ BIND(L_copy_64_bytes_loop); | 878 __ BIND(L_copy_64_bytes_loop); |
879 __ movq(mmx0, Address(from, 0)); | 879 __ movq(mmx0, Address(from, 0)); |
880 __ movq(mmx1, Address(from, 8)); | 880 __ movq(mmx1, Address(from, 8)); |
881 __ movq(mmx2, Address(from, 16)); | 881 __ movq(mmx2, Address(from, 16)); |
882 __ movq(Address(from, to_from, Address::times_1, 0), mmx0); | 882 __ movq(Address(from, to_from, Address::times_1, 0), mmx0); |
1142 __ subl(count, 1<<shift); | 1142 __ subl(count, 1<<shift); |
1143 __ movl(rdx, Address(from, count, sf, 0)); | 1143 __ movl(rdx, Address(from, count, sf, 0)); |
1144 __ movl(Address(to, count, sf, 0), rdx); | 1144 __ movl(Address(to, count, sf, 0), rdx); |
1145 __ jmpb(L_copy_8_bytes); | 1145 __ jmpb(L_copy_8_bytes); |
1146 | 1146 |
1147 __ align(16); | 1147 __ align(OptoLoopAlignment); |
1148 // Move 8 bytes | 1148 // Move 8 bytes |
1149 __ BIND(L_copy_8_bytes_loop); | 1149 __ BIND(L_copy_8_bytes_loop); |
1150 if (UseXMMForArrayCopy) { | 1150 if (UseXMMForArrayCopy) { |
1151 __ movq(xmm0, Address(from, count, sf, 0)); | 1151 __ movq(xmm0, Address(from, count, sf, 0)); |
1152 __ movq(Address(to, count, sf, 0), xmm0); | 1152 __ movq(Address(to, count, sf, 0), xmm0); |
1233 } else { | 1233 } else { |
1234 mmx_copy_forward(from, to_from, count); | 1234 mmx_copy_forward(from, to_from, count); |
1235 } | 1235 } |
1236 } else { | 1236 } else { |
1237 __ jmpb(L_copy_8_bytes); | 1237 __ jmpb(L_copy_8_bytes); |
1238 __ align(16); | 1238 __ align(OptoLoopAlignment); |
1239 __ BIND(L_copy_8_bytes_loop); | 1239 __ BIND(L_copy_8_bytes_loop); |
1240 __ fild_d(Address(from, 0)); | 1240 __ fild_d(Address(from, 0)); |
1241 __ fistp_d(Address(from, to_from, Address::times_1)); | 1241 __ fistp_d(Address(from, to_from, Address::times_1)); |
1242 __ addptr(from, 8); | 1242 __ addptr(from, 8); |
1243 __ BIND(L_copy_8_bytes); | 1243 __ BIND(L_copy_8_bytes); |
1280 __ movptr(from, Address(rsp, 8)); // from | 1280 __ movptr(from, Address(rsp, 8)); // from |
1281 __ jump_cc(Assembler::aboveEqual, nooverlap); | 1281 __ jump_cc(Assembler::aboveEqual, nooverlap); |
1282 | 1282 |
1283 __ jmpb(L_copy_8_bytes); | 1283 __ jmpb(L_copy_8_bytes); |
1284 | 1284 |
1285 __ align(16); | 1285 __ align(OptoLoopAlignment); |
1286 __ BIND(L_copy_8_bytes_loop); | 1286 __ BIND(L_copy_8_bytes_loop); |
1287 if (VM_Version::supports_mmx()) { | 1287 if (VM_Version::supports_mmx()) { |
1288 if (UseXMMForArrayCopy) { | 1288 if (UseXMMForArrayCopy) { |
1289 __ movq(xmm0, Address(from, count, Address::times_8)); | 1289 __ movq(xmm0, Address(from, count, Address::times_8)); |
1290 __ movq(Address(to, count, Address::times_8), xmm0); | 1290 __ movq(Address(to, count, Address::times_8), xmm0); |
1452 // ======== begin loop ======== | 1452 // ======== begin loop ======== |
1453 // (Loop is rotated; its entry is L_load_element.) | 1453 // (Loop is rotated; its entry is L_load_element.) |
1454 // Loop control: | 1454 // Loop control: |
1455 // for (count = -count; count != 0; count++) | 1455 // for (count = -count; count != 0; count++) |
1456 // Base pointers src, dst are biased by 8*count,to last element. | 1456 // Base pointers src, dst are biased by 8*count,to last element. |
1457 __ align(16); | 1457 __ align(OptoLoopAlignment); |
1458 | 1458 |
1459 __ BIND(L_store_element); | 1459 __ BIND(L_store_element); |
1460 __ movptr(to_element_addr, elem); // store the oop | 1460 __ movptr(to_element_addr, elem); // store the oop |
1461 __ increment(count); // increment the count toward zero | 1461 __ increment(count); // increment the count toward zero |
1462 __ jccb(Assembler::zero, L_do_card_marks); | 1462 __ jccb(Assembler::zero, L_do_card_marks); |