54 long tieredMaxLevel = IntrinsicPredicates.WHITE_BOX.getIntxVMFlag(
55 "TieredStopAtLevel");
56 boolean maxLevelIsReachable = (tieredMaxLevel
57 == IntrinsicPredicates.TIERED_MAX_LEVEL);
58 return Platform.isServer() && !Platform.isEmulatedClient() && (!isTiered || maxLevelIsReachable);
59 };
60
61 public static final BooleanSupplier SHA1_INSTRUCTION_AVAILABLE
62 = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha1" }, null),
63 new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha1" }, null),
64 new OrPredicate(new CPUSpecificPredicate("sparc.*", new String[] { "sha1" }, null),
65 // x86 variants
66 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
67 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
68 new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null))))));
69
70 public static final BooleanSupplier SHA256_INSTRUCTION_AVAILABLE
71 = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha256" }, null),
72 new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha256" }, null),
73 new OrPredicate(new CPUSpecificPredicate("sparc.*", new String[] { "sha256" }, null),
74 // x86 variants
75 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
76 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
77 new OrPredicate(new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null),
78 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "avx2", "bmi2" }, null),
79 new CPUSpecificPredicate("x86_64", new String[] { "avx2", "bmi2" }, null))))))));
80
81 public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE
82 = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha512" }, null),
83 new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha512" }, null),
84 new OrPredicate(new CPUSpecificPredicate("sparc.*", new String[] { "sha512" }, null),
85 // x86 variants
86 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
87 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
88 new OrPredicate(new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null),
89 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "avx2", "bmi2" }, null),
90 new CPUSpecificPredicate("x86_64", new String[] { "avx2", "bmi2" }, null))))))));
91
92 public static final BooleanSupplier ANY_SHA_INSTRUCTION_AVAILABLE
93 = new OrPredicate(IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
94 new OrPredicate(
95 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
96 IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE));
97
98 public static final BooleanSupplier SHA1_INTRINSICS_AVAILABLE
99 = new AndPredicate(new AndPredicate(
100 IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
101 IntrinsicPredicates.COMPILABLE_BY_C2),
102 IntrinsicPredicates.booleanOptionValue("UseSHA1Intrinsics"));
103
104 public static final BooleanSupplier SHA256_INTRINSICS_AVAILABLE
105 = new AndPredicate(new AndPredicate(
106 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
107 IntrinsicPredicates.COMPILABLE_BY_C2),
108 IntrinsicPredicates.booleanOptionValue("UseSHA256Intrinsics"));
109
110 public static final BooleanSupplier SHA512_INTRINSICS_AVAILABLE
|
54 long tieredMaxLevel = IntrinsicPredicates.WHITE_BOX.getIntxVMFlag(
55 "TieredStopAtLevel");
56 boolean maxLevelIsReachable = (tieredMaxLevel
57 == IntrinsicPredicates.TIERED_MAX_LEVEL);
58 return Platform.isServer() && !Platform.isEmulatedClient() && (!isTiered || maxLevelIsReachable);
59 };
60
61 public static final BooleanSupplier SHA1_INSTRUCTION_AVAILABLE
62 = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha1" }, null),
63 new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha1" }, null),
64 new OrPredicate(new CPUSpecificPredicate("sparc.*", new String[] { "sha1" }, null),
65 // x86 variants
66 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
67 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
68 new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null))))));
69
70 public static final BooleanSupplier SHA256_INSTRUCTION_AVAILABLE
71 = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha256" }, null),
72 new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha256" }, null),
73 new OrPredicate(new CPUSpecificPredicate("sparc.*", new String[] { "sha256" }, null),
74 new OrPredicate(new CPUSpecificPredicate("ppc64le.*", new String[] { "sha" }, null),
75 // x86 variants
76 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
77 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
78 new OrPredicate(new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null),
79 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "avx2", "bmi2" }, null),
80 new CPUSpecificPredicate("x86_64", new String[] { "avx2", "bmi2" }, null)))))))));
81
82 public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE
83 = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha512" }, null),
84 new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha512" }, null),
85 new OrPredicate(new CPUSpecificPredicate("sparc.*", new String[] { "sha512" }, null),
86 new OrPredicate(new CPUSpecificPredicate("ppc64le.*", new String[] { "sha" }, null),
87 // x86 variants
88 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
89 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
90 new OrPredicate(new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null),
91 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "avx2", "bmi2" }, null),
92 new CPUSpecificPredicate("x86_64", new String[] { "avx2", "bmi2" }, null)))))))));
93
94 public static final BooleanSupplier ANY_SHA_INSTRUCTION_AVAILABLE
95 = new OrPredicate(IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
96 new OrPredicate(
97 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
98 IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE));
99
100 public static final BooleanSupplier SHA1_INTRINSICS_AVAILABLE
101 = new AndPredicate(new AndPredicate(
102 IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
103 IntrinsicPredicates.COMPILABLE_BY_C2),
104 IntrinsicPredicates.booleanOptionValue("UseSHA1Intrinsics"));
105
106 public static final BooleanSupplier SHA256_INTRINSICS_AVAILABLE
107 = new AndPredicate(new AndPredicate(
108 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
109 IntrinsicPredicates.COMPILABLE_BY_C2),
110 IntrinsicPredicates.booleanOptionValue("UseSHA256Intrinsics"));
111
112 public static final BooleanSupplier SHA512_INTRINSICS_AVAILABLE
|