< prev index next >

src/hotspot/share/opto/library_call.cpp

Print this page




 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:


5231 
5232   BasicType a_elem = a_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5233   BasicType n_elem = n_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5234   BasicType m_elem = m_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5235   if (a_elem != T_INT || n_elem != T_INT || m_elem != T_INT) {
5236     return false;
5237   }
5238 
5239   // Make the call
5240   {
5241     Node* a_start = array_element_address(a, intcon(0), a_elem);
5242     Node* n_start = array_element_address(n, intcon(0), n_elem);
5243     Node* m_start = array_element_address(m, intcon(0), m_elem);
5244 
5245     Node* call = make_runtime_call(RC_LEAF,
5246                                    OptoRuntime::montgomerySquare_Type(),
5247                                    stubAddr, stubName, TypePtr::BOTTOM,
5248                                    a_start, n_start, len, inv, top(),
5249                                    m_start);
5250     set_result(m);






















































5251   }
5252 
5253   return true;
5254 }
5255 
5256 //-------------inline_vectorizedMismatch------------------------------
5257 bool LibraryCallKit::inline_vectorizedMismatch() {
5258   assert(UseVectorizedMismatchIntrinsic, "not implementated on this platform");
5259 
5260   address stubAddr = StubRoutines::vectorizedMismatch();
5261   if (stubAddr == NULL) {
5262     return false; // Intrinsic's stub is not implemented on this platform
5263   }
5264   const char* stubName = "vectorizedMismatch";
5265   int size_l = callee()->signature()->size();
5266   assert(callee()->signature()->size() == 8, "vectorizedMismatch has 6 parameters");
5267 
5268   Node* obja = argument(0);
5269   Node* aoffset = argument(1);
5270   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:


5237 
5238   BasicType a_elem = a_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5239   BasicType n_elem = n_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5240   BasicType m_elem = m_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5241   if (a_elem != T_INT || n_elem != T_INT || m_elem != T_INT) {
5242     return false;
5243   }
5244 
5245   // Make the call
5246   {
5247     Node* a_start = array_element_address(a, intcon(0), a_elem);
5248     Node* n_start = array_element_address(n, intcon(0), n_elem);
5249     Node* m_start = array_element_address(m, intcon(0), m_elem);
5250 
5251     Node* call = make_runtime_call(RC_LEAF,
5252                                    OptoRuntime::montgomerySquare_Type(),
5253                                    stubAddr, stubName, TypePtr::BOTTOM,
5254                                    a_start, n_start, len, inv, top(),
5255                                    m_start);
5256     set_result(m);
5257   }
5258 
5259   return true;
5260 }
5261 
5262 bool LibraryCallKit::inline_bigIntegerShift(bool isRightShift) {
5263   address stubAddr = NULL;
5264   const char* stubName = NULL;
5265 
5266   stubAddr = isRightShift? StubRoutines::bigIntegerRightShift(): StubRoutines::bigIntegerLeftShift();
5267   if (stubAddr == NULL) {
5268     return false; // Intrinsic's stub is not implemented on this platform
5269   }
5270 
5271   stubName = isRightShift? "bigIntegerRightShiftWorker" : "bigIntegerLeftShiftWorker";
5272 
5273   assert(callee()->signature()->size() == 5, "expected 5 arguments");
5274 
5275   Node* newArr = argument(0);
5276   Node* oldArr = argument(1);
5277   Node* newIdx = argument(2);
5278   Node* shiftCount = argument(3);
5279   Node* numIter = argument(4);
5280 
5281   const Type* newArr_type = newArr->Value(&_gvn);
5282   const TypeAryPtr* top_newArr = newArr_type->isa_aryptr();
5283   const Type* oldArr_type = oldArr->Value(&_gvn);
5284   const TypeAryPtr* top_oldArr = oldArr_type->isa_aryptr();
5285   if (top_newArr == NULL || top_newArr->klass() == NULL || top_oldArr == NULL
5286       || top_oldArr->klass() == NULL) {
5287     return false;
5288   }
5289 
5290   BasicType newArr_elem = newArr_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5291   BasicType oldArr_elem = oldArr_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type();
5292   if (newArr_elem != T_INT || oldArr_elem != T_INT) {
5293     return false;
5294   }
5295 
5296   // Make the call
5297   {
5298     Node* newArr_start = array_element_address(newArr, intcon(0), newArr_elem);
5299     Node* oldArr_start = array_element_address(oldArr, intcon(0), oldArr_elem);
5300 
5301     Node* call = make_runtime_call(RC_LEAF,
5302                                    OptoRuntime::bigIntegerShift_Type(),
5303                                    stubAddr,
5304                                    stubName,
5305                                    TypePtr::BOTTOM,
5306                                    newArr_start,
5307                                    oldArr_start,
5308                                    newIdx,
5309                                    shiftCount,
5310                                    numIter);
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);


< prev index next >