sha.predicate.IntrinsicPredicates Java Examples

The following examples show how to use sha.predicate.IntrinsicPredicates. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SHAOptionsBase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the predicate indicating whether or not CPU instructions required
 * by the option with name {@code optionName} are available.
 *
 * @param optionName The name of the option for which a predicate should be
 *                   returned.
 * @return The predicate on availability of CPU instructions required by the
 *         option.
 */
protected static BooleanSupplier getPredicateForOption(String optionName) {
    switch (optionName) {
        case SHAOptionsBase.USE_SHA_OPTION:
            return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE;
        default:
            throw new Error("Unexpected option " + optionName);
    }
}
 
Example #2
Source File: SHAOptionsBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the predicate indicating whether or not CPU instructions required
 * by the option with name {@code optionName} are available.
 *
 * @param optionName The name of the option for which a predicate should be
 *                   returned.
 * @return The predicate on availability of CPU instructions required by the
 *         option.
 */
protected static BooleanSupplier getPredicateForOption(String optionName) {
    switch (optionName) {
        case SHAOptionsBase.USE_SHA_OPTION:
            return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE;
        default:
            throw new Error("Unexpected option " + optionName);
    }
}
 
Example #3
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForUnsupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            new NotPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #4
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU(
        String optionName) {
    // execute test case on SPARC CPU that support any sha* instructions,
    // but does not support sha* instruction required by the tested option.
    super(optionName, new AndPredicate(Platform::isSparc,
            new AndPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
                    new NotPredicate(SHAOptionsBase.getPredicateForOption(
                            optionName)))));
}
 
Example #5
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForSupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #6
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForSupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #7
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU(
        String optionName) {
    // execute test case on SPARC CPU that support any sha* instructions,
    // but does not support sha* instruction required by the tested option.
    super(optionName, new AndPredicate(Platform::isSparc,
            new AndPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
                    new NotPredicate(SHAOptionsBase.getPredicateForOption(
                            optionName)))));
}
 
Example #8
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForUnsupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            new NotPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #9
Source File: SHAOptionsBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the predicate indicating whether or not CPU instructions required
 * by the option with name {@code optionName} are available.
 *
 * @param optionName The name of the option for which a predicate should be
 *                   returned.
 * @return The predicate on availability of CPU instructions required by the
 *         option.
 */
protected static BooleanSupplier getPredicateForOption(String optionName) {
    switch (optionName) {
        case SHAOptionsBase.USE_SHA_OPTION:
            return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE;
        default:
            throw new Error("Unexpected option " + optionName);
    }
}
 
Example #10
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForUnsupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            new NotPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #11
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU(
        String optionName) {
    // execute test case on SPARC CPU that support any sha* instructions,
    // but does not support sha* instruction required by the tested option.
    super(optionName, new AndPredicate(Platform::isSparc,
            new AndPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
                    new NotPredicate(SHAOptionsBase.getPredicateForOption(
                            optionName)))));
}
 
Example #12
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForSupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #13
Source File: SHAOptionsBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the predicate indicating whether or not CPU instructions required
 * by the option with name {@code optionName} are available.
 *
 * @param optionName The name of the option for which a predicate should be
 *                   returned.
 * @return The predicate on availability of CPU instructions required by the
 *         option.
 */
protected static BooleanSupplier getPredicateForOption(String optionName) {
    switch (optionName) {
        case SHAOptionsBase.USE_SHA_OPTION:
            return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE;
        default:
            throw new Error("Unexpected option " + optionName);
    }
}
 
Example #14
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForUnsupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            new NotPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #15
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU(
        String optionName) {
    // execute test case on SPARC CPU that support any sha* instructions,
    // but does not support sha* instruction required by the tested option.
    super(optionName, new AndPredicate(Platform::isSparc,
            new AndPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
                    new NotPredicate(SHAOptionsBase.getPredicateForOption(
                            optionName)))));
}
 
Example #16
Source File: SHAOptionsBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the predicate indicating whether or not CPU instructions required
 * by the option with name {@code optionName} are available.
 *
 * @param optionName The name of the option for which a predicate should be
 *                   returned.
 * @return The predicate on availability of CPU instructions required by the
 *         option.
 */
protected static BooleanSupplier getPredicateForOption(String optionName) {
    switch (optionName) {
        case SHAOptionsBase.USE_SHA_OPTION:
            return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE;
        case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
            return IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE;
        default:
            throw new Error("Unexpected option " + optionName);
    }
}
 
Example #17
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForUnsupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            new NotPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #18
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU(
        String optionName) {
    // execute test case on SPARC CPU that support any sha* instructions,
    // but does not support sha* instruction required by the tested option.
    super(optionName, new AndPredicate(Platform::isSparc,
            new AndPredicate(
                    IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
                    new NotPredicate(SHAOptionsBase.getPredicateForOption(
                            optionName)))));
}
 
Example #19
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForSupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #20
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public UseSHASpecificTestCaseForSupportedSparcCPU(String optionName) {
    super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(Platform::isSparc,
            IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));

    Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
            "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
                    + " option only.");
}
 
Example #21
Source File: TestSHA512Intrinsics.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA512_INTRINSICS_AVAILABLE,
            SHASanityTestBase.SHA512_INTRINSIC_ID).test();
}
 
Example #22
Source File: TestSHA256Intrinsics.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA256_INTRINSICS_AVAILABLE,
            SHASanityTestBase.SHA256_INTRINSIC_ID).test();
}
 
Example #23
Source File: TestSHA512Intrinsics.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA512_INTRINSICS_AVAILABLE,
            SHASanityTestBase.SHA512_INTRINSIC_ID).test();
}
 
Example #24
Source File: TestSHA1MultiBlockIntrinsics.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA1_INTRINSICS_AVAILABLE,
            SHASanityTestBase.MB_INTRINSIC_ID).test();
}
 
Example #25
Source File: TestSHA256MultiBlockIntrinsics.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA256_INTRINSICS_AVAILABLE,
            SHASanityTestBase.MB_INTRINSIC_ID).test();
}
 
Example #26
Source File: TestSHA512Intrinsics.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA512_INTRINSICS_AVAILABLE,
            SHASanityTestBase.SHA512_INTRINSIC_ID).test();
}
 
Example #27
Source File: TestSHA512MultiBlockIntrinsics.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA512_INTRINSICS_AVAILABLE,
            SHASanityTestBase.MB_INTRINSIC_ID).test();
}
 
Example #28
Source File: TestSHA256MultiBlockIntrinsics.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA256_INTRINSICS_AVAILABLE,
            SHASanityTestBase.MB_INTRINSIC_ID).test();
}
 
Example #29
Source File: TestSHA1MultiBlockIntrinsics.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA1_INTRINSICS_AVAILABLE,
            SHASanityTestBase.MB_INTRINSIC_ID).test();
}
 
Example #30
Source File: TestSHA256Intrinsics.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
    new SHASanityTestBase(IntrinsicPredicates.SHA256_INTRINSICS_AVAILABLE,
            SHASanityTestBase.SHA256_INTRINSIC_ID).test();
}