--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp Wed Sep 21 13:47:56 2016 -0700
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp Thu Sep 22 12:17:24 2016 +0200
@@ -3205,28 +3205,59 @@
const Register crc = R3_ARG1; // Current checksum, preset by caller or result from previous call.
const Register data = R4_ARG2; // source byte array
const Register dataLen = R5_ARG3; // #bytes to process
- const Register table = R6_ARG4; // crc table address
-
- const Register t0 = R2;
- const Register t1 = R7;
- const Register t2 = R8;
- const Register t3 = R9;
- const Register tc0 = R10;
- const Register tc1 = R11;
- const Register tc2 = R12;
-
- BLOCK_COMMENT("Stub body {");
- assert_different_registers(crc, data, dataLen, table);
-
- StubRoutines::ppc64::generate_load_crc_table_addr(_masm, table);
-
- __ kernel_crc32_1word(crc, data, dataLen, table, t0, t1, t2, t3, tc0, tc1, tc2, table);
-
- BLOCK_COMMENT("return");
- __ mr_if_needed(R3_RET, crc); // Updated crc is function result. No copying required (R3_ARG1 == R3_RET).
- __ blr();
-
- BLOCK_COMMENT("} Stub body");
+
+ const Register table = R6; // crc table address
+
+#ifdef VM_LITTLE_ENDIAN
+ if (VM_Version::has_vpmsumb()) {
+ const Register constants = R2; // constants address
+ const Register bconstants = R8; // barret table address
+
+ const Register t0 = R9;
+ const Register t1 = R10;
+ const Register t2 = R11;
+ const Register t3 = R12;
+ const Register t4 = R7;
+
+ BLOCK_COMMENT("Stub body {");
+ assert_different_registers(crc, data, dataLen, table);
+
+ StubRoutines::ppc64::generate_load_crc_table_addr(_masm, table);
+ StubRoutines::ppc64::generate_load_crc_constants_addr(_masm, constants);
+ StubRoutines::ppc64::generate_load_crc_barret_constants_addr(_masm, bconstants);
+
+ __ kernel_crc32_1word_vpmsumd(crc, data, dataLen, table, constants, bconstants, t0, t1, t2, t3, t4);
+
+ BLOCK_COMMENT("return");
+ __ mr_if_needed(R3_RET, crc); // Updated crc is function result. No copying required (R3_ARG1 == R3_RET).
+ __ blr();
+
+ BLOCK_COMMENT("} Stub body");
+ } else
+#endif
+ {
+ const Register t0 = R2;
+ const Register t1 = R7;
+ const Register t2 = R8;
+ const Register t3 = R9;
+ const Register tc0 = R10;
+ const Register tc1 = R11;
+ const Register tc2 = R12;
+
+ BLOCK_COMMENT("Stub body {");
+ assert_different_registers(crc, data, dataLen, table);
+
+ StubRoutines::ppc64::generate_load_crc_table_addr(_masm, table);
+
+ __ kernel_crc32_1word(crc, data, dataLen, table, t0, t1, t2, t3, tc0, tc1, tc2, table);
+
+ BLOCK_COMMENT("return");
+ __ mr_if_needed(R3_RET, crc); // Updated crc is function result. No copying required (R3_ARG1 == R3_RET).
+ __ blr();
+
+ BLOCK_COMMENT("} Stub body");
+ }
+
return start;
}