310 bool long_state, address stubAddr, const char *stubName,
311 Node* src_start, Node* ofs, Node* limit);
312 Node* get_state_from_sha_object(Node *sha_object);
313 Node* get_state_from_sha5_object(Node *sha_object);
314 Node* inline_digestBase_implCompressMB_predicate(int predicate);
315 bool inline_encodeISOArray();
316 bool inline_updateCRC32();
317 bool inline_updateBytesCRC32();
318 bool inline_updateByteBufferCRC32();
319 Node* get_table_from_crc32c_class(ciInstanceKlass *crc32c_class);
320 bool inline_updateBytesCRC32C();
321 bool inline_updateDirectByteBufferCRC32C();
322 bool inline_updateBytesAdler32();
323 bool inline_updateByteBufferAdler32();
324 bool inline_multiplyToLen();
325 bool inline_hasNegatives();
326 bool inline_squareToLen();
327 bool inline_mulAdd();
328 bool inline_montgomeryMultiply();
329 bool inline_montgomerySquare();
330 bool inline_vectorizedMismatch();
331 bool inline_fma(vmIntrinsics::ID id);
332 bool inline_character_compare(vmIntrinsics::ID id);
333 bool inline_fp_min_max(vmIntrinsics::ID id);
334
335 bool inline_profileBoolean();
336 bool inline_isCompileConstant();
337 void clear_upper_avx() {
338 #ifdef X86
339 if (UseAVX >= 2) {
340 C->set_clear_upper_avx(true);
341 }
342 #endif
343 }
344 };
345
346 //---------------------------make_vm_intrinsic----------------------------
347 CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
348 vmIntrinsics::ID id = m->intrinsic_id();
349 assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
828 case vmIntrinsics::_sha5_implCompress:
829 return inline_sha_implCompress(intrinsic_id());
830
831 case vmIntrinsics::_digestBase_implCompressMB:
832 return inline_digestBase_implCompressMB(predicate);
833
834 case vmIntrinsics::_multiplyToLen:
835 return inline_multiplyToLen();
836
837 case vmIntrinsics::_squareToLen:
838 return inline_squareToLen();
839
840 case vmIntrinsics::_mulAdd:
841 return inline_mulAdd();
842
843 case vmIntrinsics::_montgomeryMultiply:
844 return inline_montgomeryMultiply();
845 case vmIntrinsics::_montgomerySquare:
846 return inline_montgomerySquare();
847
848 case vmIntrinsics::_vectorizedMismatch:
849 return inline_vectorizedMismatch();
850
851 case vmIntrinsics::_ghash_processBlocks:
852 return inline_ghash_processBlocks();
853 case vmIntrinsics::_base64_encodeBlock:
854 return inline_base64_encodeBlock();
855
856 case vmIntrinsics::_encodeISOArray:
857 case vmIntrinsics::_encodeByteISOArray:
858 return inline_encodeISOArray();
859
860 case vmIntrinsics::_updateCRC32:
861 return inline_updateCRC32();
862 case vmIntrinsics::_updateBytesCRC32:
863 return inline_updateBytesCRC32();
864 case vmIntrinsics::_updateByteBufferCRC32:
865 return inline_updateByteBufferCRC32();
866
867 case vmIntrinsics::_updateBytesCRC32C:
5291
5292 BasicType a_elem = a_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5293 BasicType n_elem = n_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5294 BasicType m_elem = m_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5295 if (a_elem != T_INT || n_elem != T_INT || m_elem != T_INT) {
5296 return false;
5297 }
5298
5299 // Make the call
5300 {
5301 Node* a_start = array_element_address(a, intcon(0), a_elem);
5302 Node* n_start = array_element_address(n, intcon(0), n_elem);
5303 Node* m_start = array_element_address(m, intcon(0), m_elem);
5304
5305 Node* call = make_runtime_call(RC_LEAF,
5306 OptoRuntime::montgomerySquare_Type(),
5307 stubAddr, stubName, TypePtr::BOTTOM,
5308 a_start, n_start, len, inv, top(),
5309 m_start);
5310 set_result(m);
5311 }
5312
5313 return true;
5314 }
5315
5316 //-------------inline_vectorizedMismatch------------------------------
5317 bool LibraryCallKit::inline_vectorizedMismatch() {
5318 assert(UseVectorizedMismatchIntrinsic, "not implementated on this platform");
5319
5320 address stubAddr = StubRoutines::vectorizedMismatch();
5321 if (stubAddr == NULL) {
5322 return false; // Intrinsic's stub is not implemented on this platform
5323 }
5324 const char* stubName = "vectorizedMismatch";
5325 int size_l = callee()->signature()->size();
5326 assert(callee()->signature()->size() == 8, "vectorizedMismatch has 6 parameters");
5327
5328 Node* obja = argument(0);
5329 Node* aoffset = argument(1);
5330 Node* objb = argument(3);
|
310 bool long_state, address stubAddr, const char *stubName,
311 Node* src_start, Node* ofs, Node* limit);
312 Node* get_state_from_sha_object(Node *sha_object);
313 Node* get_state_from_sha5_object(Node *sha_object);
314 Node* inline_digestBase_implCompressMB_predicate(int predicate);
315 bool inline_encodeISOArray();
316 bool inline_updateCRC32();
317 bool inline_updateBytesCRC32();
318 bool inline_updateByteBufferCRC32();
319 Node* get_table_from_crc32c_class(ciInstanceKlass *crc32c_class);
320 bool inline_updateBytesCRC32C();
321 bool inline_updateDirectByteBufferCRC32C();
322 bool inline_updateBytesAdler32();
323 bool inline_updateByteBufferAdler32();
324 bool inline_multiplyToLen();
325 bool inline_hasNegatives();
326 bool inline_squareToLen();
327 bool inline_mulAdd();
328 bool inline_montgomeryMultiply();
329 bool inline_montgomerySquare();
330 bool inline_bigIntegerShift(bool isRightShift);
331 bool inline_vectorizedMismatch();
332 bool inline_fma(vmIntrinsics::ID id);
333 bool inline_character_compare(vmIntrinsics::ID id);
334 bool inline_fp_min_max(vmIntrinsics::ID id);
335
336 bool inline_profileBoolean();
337 bool inline_isCompileConstant();
338 void clear_upper_avx() {
339 #ifdef X86
340 if (UseAVX >= 2) {
341 C->set_clear_upper_avx(true);
342 }
343 #endif
344 }
345 };
346
347 //---------------------------make_vm_intrinsic----------------------------
348 CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
349 vmIntrinsics::ID id = m->intrinsic_id();
350 assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
829 case vmIntrinsics::_sha5_implCompress:
830 return inline_sha_implCompress(intrinsic_id());
831
832 case vmIntrinsics::_digestBase_implCompressMB:
833 return inline_digestBase_implCompressMB(predicate);
834
835 case vmIntrinsics::_multiplyToLen:
836 return inline_multiplyToLen();
837
838 case vmIntrinsics::_squareToLen:
839 return inline_squareToLen();
840
841 case vmIntrinsics::_mulAdd:
842 return inline_mulAdd();
843
844 case vmIntrinsics::_montgomeryMultiply:
845 return inline_montgomeryMultiply();
846 case vmIntrinsics::_montgomerySquare:
847 return inline_montgomerySquare();
848
849 case vmIntrinsics::_bigIntegerRightShiftWorker:
850 return inline_bigIntegerShift(true);
851 case vmIntrinsics::_bigIntegerLeftShiftWorker:
852 return inline_bigIntegerShift(false);
853
854 case vmIntrinsics::_vectorizedMismatch:
855 return inline_vectorizedMismatch();
856
857 case vmIntrinsics::_ghash_processBlocks:
858 return inline_ghash_processBlocks();
859 case vmIntrinsics::_base64_encodeBlock:
860 return inline_base64_encodeBlock();
861
862 case vmIntrinsics::_encodeISOArray:
863 case vmIntrinsics::_encodeByteISOArray:
864 return inline_encodeISOArray();
865
866 case vmIntrinsics::_updateCRC32:
867 return inline_updateCRC32();
868 case vmIntrinsics::_updateBytesCRC32:
869 return inline_updateBytesCRC32();
870 case vmIntrinsics::_updateByteBufferCRC32:
871 return inline_updateByteBufferCRC32();
872
873 case vmIntrinsics::_updateBytesCRC32C:
5297
5298 BasicType a_elem = a_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5299 BasicType n_elem = n_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5300 BasicType m_elem = m_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5301 if (a_elem != T_INT || n_elem != T_INT || m_elem != T_INT) {
5302 return false;
5303 }
5304
5305 // Make the call
5306 {
5307 Node* a_start = array_element_address(a, intcon(0), a_elem);
5308 Node* n_start = array_element_address(n, intcon(0), n_elem);
5309 Node* m_start = array_element_address(m, intcon(0), m_elem);
5310
5311 Node* call = make_runtime_call(RC_LEAF,
5312 OptoRuntime::montgomerySquare_Type(),
5313 stubAddr, stubName, TypePtr::BOTTOM,
5314 a_start, n_start, len, inv, top(),
5315 m_start);
5316 set_result(m);
5317 }
5318
5319 return true;
5320 }
5321
5322 bool LibraryCallKit::inline_bigIntegerShift(bool isRightShift) {
5323 address stubAddr = NULL;
5324 const char* stubName = NULL;
5325
5326 stubAddr = isRightShift? StubRoutines::bigIntegerRightShift(): StubRoutines::bigIntegerLeftShift();
5327 if (stubAddr == NULL) {
5328 return false; // Intrinsic's stub is not implemented on this platform
5329 }
5330
5331 stubName = isRightShift? "bigIntegerRightShiftWorker" : "bigIntegerLeftShiftWorker";
5332
5333 assert(callee()->signature()->size() == 5, "expected 5 arguments");
5334
5335 Node* newArr = argument(0);
5336 Node* oldArr = argument(1);
5337 Node* newIdx = argument(2);
5338 Node* shiftCount = argument(3);
5339 Node* numIter = argument(4);
5340
5341 const Type* newArr_type = newArr->Value(&_gvn);
5342 const TypeAryPtr* top_newArr = newArr_type->isa_aryptr();
5343 const Type* oldArr_type = oldArr->Value(&_gvn);
5344 const TypeAryPtr* top_oldArr = oldArr_type->isa_aryptr();
5345 if (top_newArr == NULL || top_newArr->klass() == NULL || top_oldArr == NULL
5346 || top_oldArr->klass() == NULL) {
5347 return false;
5348 }
5349
5350 BasicType newArr_elem = newArr_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5351 BasicType oldArr_elem = oldArr_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5352 if (newArr_elem != T_INT || oldArr_elem != T_INT) {
5353 return false;
5354 }
5355
5356 // Make the call
5357 {
5358 Node* newArr_start = array_element_address(newArr, intcon(0), newArr_elem);
5359 Node* oldArr_start = array_element_address(oldArr, intcon(0), oldArr_elem);
5360
5361 Node* call = make_runtime_call(RC_LEAF,
5362 OptoRuntime::bigIntegerShift_Type(),
5363 stubAddr,
5364 stubName,
5365 TypePtr::BOTTOM,
5366 newArr_start,
5367 oldArr_start,
5368 newIdx,
5369 shiftCount,
5370 numIter);
5371 }
5372
5373 return true;
5374 }
5375
5376 //-------------inline_vectorizedMismatch------------------------------
5377 bool LibraryCallKit::inline_vectorizedMismatch() {
5378 assert(UseVectorizedMismatchIntrinsic, "not implementated on this platform");
5379
5380 address stubAddr = StubRoutines::vectorizedMismatch();
5381 if (stubAddr == NULL) {
5382 return false; // Intrinsic's stub is not implemented on this platform
5383 }
5384 const char* stubName = "vectorizedMismatch";
5385 int size_l = callee()->signature()->size();
5386 assert(callee()->signature()->size() == 8, "vectorizedMismatch has 6 parameters");
5387
5388 Node* obja = argument(0);
5389 Node* aoffset = argument(1);
5390 Node* objb = argument(3);
|