@@ -795,55 +795,6 @@ class StubGenerator: public StubCodeGenerator {
795
795
__ BIND (L_exit);
796
796
}
797
797
798
- // Copy 64 bytes chunks
799
- //
800
- // Inputs:
801
- // from - source array address
802
- // to_from - destination array address - from
803
- // qword_count - 8-bytes element count, negative
804
- //
805
- void mmx_copy_forward (Register from, Register to_from, Register qword_count) {
806
- assert ( VM_Version::supports_mmx (), " supported cpu only" );
807
- Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit;
808
- // Copy 64-byte chunks
809
- __ jmpb (L_copy_64_bytes);
810
- __ align (OptoLoopAlignment);
811
- __ BIND (L_copy_64_bytes_loop);
812
- __ movq (mmx0, Address (from, 0 ));
813
- __ movq (mmx1, Address (from, 8 ));
814
- __ movq (mmx2, Address (from, 16 ));
815
- __ movq (Address (from, to_from, Address::times_1, 0 ), mmx0);
816
- __ movq (mmx3, Address (from, 24 ));
817
- __ movq (Address (from, to_from, Address::times_1, 8 ), mmx1);
818
- __ movq (mmx4, Address (from, 32 ));
819
- __ movq (Address (from, to_from, Address::times_1, 16 ), mmx2);
820
- __ movq (mmx5, Address (from, 40 ));
821
- __ movq (Address (from, to_from, Address::times_1, 24 ), mmx3);
822
- __ movq (mmx6, Address (from, 48 ));
823
- __ movq (Address (from, to_from, Address::times_1, 32 ), mmx4);
824
- __ movq (mmx7, Address (from, 56 ));
825
- __ movq (Address (from, to_from, Address::times_1, 40 ), mmx5);
826
- __ movq (Address (from, to_from, Address::times_1, 48 ), mmx6);
827
- __ movq (Address (from, to_from, Address::times_1, 56 ), mmx7);
828
- __ addptr (from, 64 );
829
- __ BIND (L_copy_64_bytes);
830
- __ subl (qword_count, 8 );
831
- __ jcc (Assembler::greaterEqual, L_copy_64_bytes_loop);
832
- __ addl (qword_count, 8 );
833
- __ jccb (Assembler::zero, L_exit);
834
- //
835
- // length is too short, just copy qwords
836
- //
837
- __ BIND (L_copy_8_bytes);
838
- __ movq (mmx0, Address (from, 0 ));
839
- __ movq (Address (from, to_from, Address::times_1), mmx0);
840
- __ addptr (from, 8 );
841
- __ decrement (qword_count);
842
- __ jcc (Assembler::greater, L_copy_8_bytes);
843
- __ BIND (L_exit);
844
- __ emms ();
845
- }
846
-
847
798
address generate_disjoint_copy (BasicType t, bool aligned,
848
799
Address::ScaleFactor sf,
849
800
address* entry, const char *name,
@@ -918,7 +869,7 @@ class StubGenerator: public StubCodeGenerator {
918
869
__ subl (count, 1 <<(shift-1 ));
919
870
__ BIND (L_skip_align2);
920
871
}
921
- if (!VM_Version::supports_mmx () ) {
872
+ if (!UseXMMForArrayCopy ) {
922
873
__ mov (rax, count); // save 'count'
923
874
__ shrl (count, shift); // bytes count
924
875
__ addptr (to_from, from);// restore 'to'
@@ -935,18 +886,14 @@ class StubGenerator: public StubCodeGenerator {
935
886
__ movl (Address (from, to_from, Address::times_1, 0 ), rax);
936
887
__ addptr (from, 4 );
937
888
__ subl (count, 1 <<shift);
938
- }
889
+ }
939
890
__ BIND (L_copy_64_bytes);
940
891
__ mov (rax, count);
941
892
__ shrl (rax, shift+1 ); // 8 bytes chunk count
942
893
//
943
- // Copy 8-byte chunks through MMX registers, 8 per iteration of the loop
894
+ // Copy 8-byte chunks through XMM registers, 8 per iteration of the loop
944
895
//
945
- if (UseXMMForArrayCopy) {
946
- xmm_copy_forward (from, to_from, rax);
947
- } else {
948
- mmx_copy_forward (from, to_from, rax);
949
- }
896
+ xmm_copy_forward (from, to_from, rax);
950
897
}
951
898
// copy tailing dword
952
899
__ BIND (L_copy_4_bytes);
@@ -979,9 +926,6 @@ class StubGenerator: public StubCodeGenerator {
979
926
}
980
927
}
981
928
982
- if (VM_Version::supports_mmx () && !UseXMMForArrayCopy) {
983
- __ emms ();
984
- }
985
929
__ movl (count, Address (rsp, 12 +12 )); // reread 'count'
986
930
bs->arraycopy_epilogue (_masm, decorators, t, from, to, count);
987
931
@@ -1117,7 +1061,7 @@ class StubGenerator: public StubCodeGenerator {
1117
1061
__ jcc (Assembler::below, L_copy_4_bytes);
1118
1062
}
1119
1063
1120
- if (!VM_Version::supports_mmx () ) {
1064
+ if (!UseXMMForArrayCopy ) {
1121
1065
__ std ();
1122
1066
__ mov (rax, count); // Save 'count'
1123
1067
__ mov (rdx, to); // Save 'to'
@@ -1143,20 +1087,12 @@ class StubGenerator: public StubCodeGenerator {
1143
1087
__ align (OptoLoopAlignment);
1144
1088
// Move 8 bytes
1145
1089
__ BIND (L_copy_8_bytes_loop);
1146
- if (UseXMMForArrayCopy) {
1147
- __ movq (xmm0, Address (from, count, sf, 0 ));
1148
- __ movq (Address (to, count, sf, 0 ), xmm0);
1149
- } else {
1150
- __ movq (mmx0, Address (from, count, sf, 0 ));
1151
- __ movq (Address (to, count, sf, 0 ), mmx0);
1152
- }
1090
+ __ movq (xmm0, Address (from, count, sf, 0 ));
1091
+ __ movq (Address (to, count, sf, 0 ), xmm0);
1153
1092
__ BIND (L_copy_8_bytes);
1154
1093
__ subl (count, 2 <<shift);
1155
1094
__ jcc (Assembler::greaterEqual, L_copy_8_bytes_loop);
1156
1095
__ addl (count, 2 <<shift);
1157
- if (!UseXMMForArrayCopy) {
1158
- __ emms ();
1159
- }
1160
1096
}
1161
1097
__ BIND (L_copy_4_bytes);
1162
1098
// copy prefix qword
@@ -1190,9 +1126,6 @@ class StubGenerator: public StubCodeGenerator {
1190
1126
}
1191
1127
}
1192
1128
1193
- if (VM_Version::supports_mmx () && !UseXMMForArrayCopy) {
1194
- __ emms ();
1195
- }
1196
1129
__ movl2ptr (count, Address (rsp, 12 +12 )); // reread count
1197
1130
bs->arraycopy_epilogue (_masm, decorators, t, from, to, count);
1198
1131
@@ -1232,12 +1165,8 @@ class StubGenerator: public StubCodeGenerator {
1232
1165
// UnsafeCopyMemory page error: continue after ucm
1233
1166
UnsafeCopyMemoryMark ucmm (this , true , true );
1234
1167
__ subptr (to, from); // to --> to_from
1235
- if (VM_Version::supports_mmx ()) {
1236
- if (UseXMMForArrayCopy) {
1237
- xmm_copy_forward (from, to_from, count);
1238
- } else {
1239
- mmx_copy_forward (from, to_from, count);
1240
- }
1168
+ if (UseXMMForArrayCopy) {
1169
+ xmm_copy_forward (from, to_from, count);
1241
1170
} else {
1242
1171
__ jmpb (L_copy_8_bytes);
1243
1172
__ align (OptoLoopAlignment);
@@ -1250,9 +1179,6 @@ class StubGenerator: public StubCodeGenerator {
1250
1179
__ jcc (Assembler::greaterEqual, L_copy_8_bytes_loop);
1251
1180
}
1252
1181
}
1253
- if (VM_Version::supports_mmx () && !UseXMMForArrayCopy) {
1254
- __ emms ();
1255
- }
1256
1182
inc_copy_counter_np (T_LONG);
1257
1183
__ leave (); // required for proper stackwalking of RuntimeStub frame
1258
1184
__ vzeroupper ();
@@ -1298,14 +1224,9 @@ class StubGenerator: public StubCodeGenerator {
1298
1224
1299
1225
__ align (OptoLoopAlignment);
1300
1226
__ BIND (L_copy_8_bytes_loop);
1301
- if (VM_Version::supports_mmx ()) {
1302
- if (UseXMMForArrayCopy) {
1303
- __ movq (xmm0, Address (from, count, Address::times_8));
1304
- __ movq (Address (to, count, Address::times_8), xmm0);
1305
- } else {
1306
- __ movq (mmx0, Address (from, count, Address::times_8));
1307
- __ movq (Address (to, count, Address::times_8), mmx0);
1308
- }
1227
+ if (UseXMMForArrayCopy) {
1228
+ __ movq (xmm0, Address (from, count, Address::times_8));
1229
+ __ movq (Address (to, count, Address::times_8), xmm0);
1309
1230
} else {
1310
1231
__ fild_d (Address (from, count, Address::times_8));
1311
1232
__ fistp_d (Address (to, count, Address::times_8));
@@ -1315,9 +1236,6 @@ class StubGenerator: public StubCodeGenerator {
1315
1236
__ jcc (Assembler::greaterEqual, L_copy_8_bytes_loop);
1316
1237
1317
1238
}
1318
- if (VM_Version::supports_mmx () && !UseXMMForArrayCopy) {
1319
- __ emms ();
1320
- }
1321
1239
inc_copy_counter_np (T_LONG);
1322
1240
__ leave (); // required for proper stackwalking of RuntimeStub frame
1323
1241
__ xorptr (rax, rax); // return 0
0 commit comments