1#ifndef AWS_CHECKSUMS_PRIVATE_CPUID_H
2#define AWS_CHECKSUMS_PRIVATE_CPUID_H
3/*
4 * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License").
7 * You may not use this file except in compliance with the License.
8 * A copy of the License is located at
9 *
10 * http://aws.amazon.com/apache2.0
11 *
12 * or in the "license" file accompanying this file. This file is distributed
13 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14 * express or implied. See the License for the specific language governing
15 * permissions and limitations under the License.
16 */
17#include <stdint.h>
18
19/***
20 * runs cpu id and fills in capabilities for the current cpu architecture.
21 * returns non zero on success, zero on failure. If the operation was successful
22 * cpuid will be set with the bits from the cpuid call, otherwise they will be untouched.
23 **/
24int aws_checksums_do_cpu_id(int32_t *cpuid);
25
26/** Returns non-zero if the CPU supports the PCLMULQDQ instruction. */
27int aws_checksums_is_clmul_present(void);
28
29/** Returns non-zero if the CPU supports SSE4.1 instructions. */
30int aws_checksums_is_sse41_present(void);
31
32/** Returns non-zero if the CPU supports SSE4.2 instructions (i.e. CRC32). */
33int aws_checksums_is_sse42_present(void);
34
35#endif /* AWS_CHECKSUMS_PRIVATE_CPUID_H */
36