Java Code Examples for com.oracle.java.testlibrary.Platform#isSparc()

The following examples show how to use com.oracle.java.testlibrary.Platform#isSparc() . 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 TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns warning message that should occur in VM output if an option with
 * the name {@code optionName} was turned on and CPU does not support
 * required instructions.
 *
 * @param optionName The name of the option for which warning message should
 *                   be returned.
 * @return A warning message that will be printed out to VM output if CPU
 *         instructions required by the option are not supported.
 */
protected static String getWarningForUnsupportedCPU(String optionName) {
    if (Platform.isSparc()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA1_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA256_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA512_INSTRUCTION_IS_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else if (Platform.isX64() || Platform.isX86()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA_INTRINSICS_ARE_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else {
        throw new Error("Support for CPUs other then X86 or SPARC is not "
                + "implemented.");
    }
}
 
Example 2
Source File: SHAOptionsBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns warning message that should occur in VM output if an option with
 * the name {@code optionName} was turned on and CPU does not support
 * required instructions.
 *
 * @param optionName The name of the option for which warning message should
 *                   be returned.
 * @return A warning message that will be printed out to VM output if CPU
 *         instructions required by the option are not supported.
 */
protected static String getWarningForUnsupportedCPU(String optionName) {
    if (Platform.isSparc()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA1_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA256_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA512_INSTRUCTION_IS_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else if (Platform.isX64() || Platform.isX86()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA_INTRINSICS_ARE_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else {
        throw new Error("Support for CPUs other then X86 or SPARC is not "
                + "implemented.");
    }
}
 
Example 3
Source File: SHAOptionsBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns warning message that should occur in VM output if an option with
 * the name {@code optionName} was turned on and CPU does not support
 * required instructions.
 *
 * @param optionName The name of the option for which warning message should
 *                   be returned.
 * @return A warning message that will be printed out to VM output if CPU
 *         instructions required by the option are not supported.
 */
protected static String getWarningForUnsupportedCPU(String optionName) {
    if (Platform.isSparc()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA1_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA256_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA512_INSTRUCTION_IS_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else if (Platform.isX64() || Platform.isX86()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA_INTRINSICS_ARE_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else {
        throw new Error("Support for CPUs other then X86 or SPARC is not "
                + "implemented.");
    }
}
 
Example 4
Source File: SHAOptionsBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns warning message that should occur in VM output if an option with
 * the name {@code optionName} was turned on and CPU does not support
 * required instructions.
 *
 * @param optionName The name of the option for which warning message should
 *                   be returned.
 * @return A warning message that will be printed out to VM output if CPU
 *         instructions required by the option are not supported.
 */
protected static String getWarningForUnsupportedCPU(String optionName) {
    if (Platform.isSparc()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA1_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA256_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA512_INSTRUCTION_IS_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else if (Platform.isX64() || Platform.isX86()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA_INTRINSICS_ARE_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else {
        throw new Error("Support for CPUs other then X86 or SPARC is not "
                + "implemented.");
    }
}
 
Example 5
Source File: SHAOptionsBase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns warning message that should occur in VM output if an option with
 * the name {@code optionName} was turned on and CPU does not support
 * required instructions.
 *
 * @param optionName The name of the option for which warning message should
 *                   be returned.
 * @return A warning message that will be printed out to VM output if CPU
 *         instructions required by the option are not supported.
 */
protected static String getWarningForUnsupportedCPU(String optionName) {
    if (Platform.isSparc()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA1_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA256_INSTRUCTION_IS_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA512_INSTRUCTION_IS_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else if (Platform.isX64() || Platform.isX86()) {
        switch (optionName) {
            case SHAOptionsBase.USE_SHA_OPTION:
                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
                return SHAOptionsBase.SHA_INTRINSICS_ARE_NOT_AVAILABLE;
            default:
                throw new Error("Unexpected option " + optionName);
        }
    } else {
        throw new Error("Support for CPUs other then X86 or SPARC is not "
                + "implemented.");
    }
}