55 lines
No EOL
1.6 KiB
C
55 lines
No EOL
1.6 KiB
C
/*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
* -----------------------------------------------------------------------------
|
|
* File: Simd.h
|
|
* Description:
|
|
* This file implements the functions for detecting SIMD support and defines the
|
|
* enum for specifing the SIMD type.
|
|
*
|
|
* Author: Mineplay
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
#ifndef HALLOCY_SIMD
|
|
#define HALLOCY_SIMD
|
|
|
|
#if defined(_MSC_VER)
|
|
#if defined(_M_ARM64)
|
|
#include <arm64intr.h>
|
|
#else
|
|
#include <intrin.h>
|
|
#endif
|
|
#else
|
|
#if defined(__aarch64__)
|
|
#include <arm64intr.h>
|
|
#elif defined(__arm__)
|
|
#include <arm_neon.h>
|
|
#else
|
|
#include <immintrin.h>
|
|
#endif
|
|
#endif
|
|
|
|
typedef enum {
|
|
HALLOCY_SIMD_UNDEFINED = 0,
|
|
HALLOCY_SIMD_NONE = 1,
|
|
HALLOCY_SIMD_SSE = 2,
|
|
HALLOCY_SIMD_SSE2 = 3,
|
|
HALLOCY_SIMD_AVX = 4,
|
|
HALLOCY_SIMD_AVX2 = 5,
|
|
HALLOCY_SIMD_AVX512 = 6,
|
|
HALLOCY_SIMD_NEON = 7
|
|
} HallocySimdType;
|
|
|
|
HallocySimdType hallocy_is_simd_supported();
|
|
|
|
#endif |