484 UseSquareToLenIntrinsic = true;
485 }
486
487 if (FLAG_IS_DEFAULT(UseMulAddIntrinsic)) {
488 UseMulAddIntrinsic = true;
489 }
490
491 if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
492 UseMontgomeryMultiplyIntrinsic = true;
493 }
494 if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
495 UseMontgomerySquareIntrinsic = true;
496 }
497
498 if (UseSVE > 0) {
499 if (FLAG_IS_DEFAULT(MaxVectorSize)) {
500 MaxVectorSize = _initial_sve_vector_length;
501 } else if (MaxVectorSize < 16) {
502 warning("SVE does not support vector length less than 16 bytes. Disabling SVE.");
503 UseSVE = 0;
504 } else if (MaxVectorSize % 16 == 0) {
505 int new_vl = prctl(PR_SVE_SET_VL, MaxVectorSize);
506 _initial_sve_vector_length = new_vl;
507 // If MaxVectorSize is larger than system largest supported SVE vector length, above prctl()
508 // call will set task vector length to the system largest supported value. So, we also update
509 // MaxVectorSize to that largest supported value.
510 if (new_vl < 0) {
511 vm_exit_during_initialization(
512 err_msg("Current system does not support SVE vector length for MaxVectorSize: %d",
513 (int)MaxVectorSize));
514 } else if (new_vl != MaxVectorSize) {
515 warning("Current system only supports max SVE vector length %d. Set MaxVectorSize to %d",
516 new_vl, new_vl);
517 }
518 MaxVectorSize = new_vl;
519 } else {
520 vm_exit_during_initialization(err_msg("Unsupported MaxVectorSize: %d", (int)MaxVectorSize));
521 }
522 }
523
524 if (FLAG_IS_DEFAULT(OptoScheduling)) {
525 OptoScheduling = true;
526 }
527
528 if (FLAG_IS_DEFAULT(AlignVector)) {
529 AlignVector = AvoidUnalignedAccesses;
530 }
531 #endif
532 }
533
534 void VM_Version::initialize() {
535 ResourceMark rm;
536
537 stub_blob = BufferBlob::create("getPsrInfo_stub", stub_size);
538 if (stub_blob == NULL) {
539 vm_exit_during_initialization("Unable to allocate getPsrInfo_stub");
540 }
541
542 CodeBuffer c(stub_blob);
543 VM_Version_StubGenerator g(&c);
|
484 UseSquareToLenIntrinsic = true;
485 }
486
487 if (FLAG_IS_DEFAULT(UseMulAddIntrinsic)) {
488 UseMulAddIntrinsic = true;
489 }
490
491 if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
492 UseMontgomeryMultiplyIntrinsic = true;
493 }
494 if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
495 UseMontgomerySquareIntrinsic = true;
496 }
497
498 if (UseSVE > 0) {
499 if (FLAG_IS_DEFAULT(MaxVectorSize)) {
500 MaxVectorSize = _initial_sve_vector_length;
501 } else if (MaxVectorSize < 16) {
502 warning("SVE does not support vector length less than 16 bytes. Disabling SVE.");
503 UseSVE = 0;
504 } else if ((MaxVectorSize % 16) == 0 && is_power_of_2(MaxVectorSize)) {
505 int new_vl = prctl(PR_SVE_SET_VL, MaxVectorSize);
506 _initial_sve_vector_length = new_vl;
507 // If MaxVectorSize is larger than system largest supported SVE vector length, above prctl()
508 // call will set task vector length to the system largest supported value. So, we also update
509 // MaxVectorSize to that largest supported value.
510 if (new_vl < 0) {
511 vm_exit_during_initialization(
512 err_msg("Current system does not support SVE vector length for MaxVectorSize: %d",
513 (int)MaxVectorSize));
514 } else if (new_vl != MaxVectorSize) {
515 warning("Current system only supports max SVE vector length %d. Set MaxVectorSize to %d",
516 new_vl, new_vl);
517 }
518 MaxVectorSize = new_vl;
519 } else {
520 vm_exit_during_initialization(err_msg("Unsupported MaxVectorSize: %d", (int)MaxVectorSize));
521 }
522 }
523
524 if (UseSVE == 0) { // NEON
525 int min_vector_size = 8;
526 int max_vector_size = 16;
527 if (!FLAG_IS_DEFAULT(MaxVectorSize)) {
528 if (!is_power_of_2(MaxVectorSize)) {
529 vm_exit_during_initialization(err_msg("Unsupported MaxVectorSize: %d", (int)MaxVectorSize));
530 } else if (MaxVectorSize < min_vector_size) {
531 warning("MaxVectorSize must be at least %i on this platform", min_vector_size);
532 FLAG_SET_DEFAULT(MaxVectorSize, min_vector_size);
533 } else if (MaxVectorSize > max_vector_size) {
534 warning("MaxVectorSize must be at most %i on this platform", max_vector_size);
535 FLAG_SET_DEFAULT(MaxVectorSize, max_vector_size);
536 }
537 } else {
538 FLAG_SET_DEFAULT(MaxVectorSize, 16);
539 }
540 }
541
542 if (FLAG_IS_DEFAULT(OptoScheduling)) {
543 OptoScheduling = true;
544 }
545
546 if (FLAG_IS_DEFAULT(AlignVector)) {
547 AlignVector = AvoidUnalignedAccesses;
548 }
549 #endif
550 }
551
552 void VM_Version::initialize() {
553 ResourceMark rm;
554
555 stub_blob = BufferBlob::create("getPsrInfo_stub", stub_size);
556 if (stub_blob == NULL) {
557 vm_exit_during_initialization("Unable to allocate getPsrInfo_stub");
558 }
559
560 CodeBuffer c(stub_blob);
561 VM_Version_StubGenerator g(&c);
|