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("ppc64.*", new String[] { "sha" }, null),
75 new OrPredicate(new CPUSpecificPredicate("ppc64le.*", new String[] { "sha" }, null),
76 // x86 variants
77 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
78 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
79 new OrPredicate(new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null),
80 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "avx2", "bmi2" }, null),
81 new CPUSpecificPredicate("x86_64", new String[] { "avx2", "bmi2" }, null))))))))));
82
83 public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE
84 = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha512" }, null),
85 new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha512" }, null),
86 new OrPredicate(new CPUSpecificPredicate("sparc.*", new String[] { "sha512" }, null),
87 new OrPredicate(new CPUSpecificPredicate("ppc64.*", new String[] { "sha" }, null),
88 new OrPredicate(new CPUSpecificPredicate("ppc64le.*", new String[] { "sha" }, null),
89 // x86 variants
90 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
91 new OrPredicate(new CPUSpecificPredicate("i386.*", new String[] { "sha" }, null),
92 new OrPredicate(new CPUSpecificPredicate("x86.*", new String[] { "sha" }, null),
93 new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "avx2", "bmi2" }, null),
94 new CPUSpecificPredicate("x86_64", new String[] { "avx2", "bmi2" }, null))))))))));
95
96 public static final BooleanSupplier ANY_SHA_INSTRUCTION_AVAILABLE
97 = new OrPredicate(IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
98 new OrPredicate(
99 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
100 IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE));
101
102 public static final BooleanSupplier SHA1_INTRINSICS_AVAILABLE
103 = new AndPredicate(new AndPredicate(
104 IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
105 IntrinsicPredicates.COMPILABLE_BY_C2),
106 IntrinsicPredicates.booleanOptionValue("UseSHA1Intrinsics"));
107
108 public static final BooleanSupplier SHA256_INTRINSICS_AVAILABLE
109 = new AndPredicate(new AndPredicate(
110 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
111 IntrinsicPredicates.COMPILABLE_BY_C2),
112 IntrinsicPredicates.booleanOptionValue("UseSHA256Intrinsics"));
113
114 public static final BooleanSupplier SHA512_INTRINSICS_AVAILABLE
|