| 1 | /* libFLAC - Free Lossless Audio Codec library |
| 2 | * Copyright (C) 2001-2009 Josh Coalson |
| 3 | * Copyright (C) 2011-2025 Xiph.Org Foundation |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * |
| 9 | * - Redistributions of source code must retain the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer. |
| 11 | * |
| 12 | * - Redistributions in binary form must reproduce the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer in the |
| 14 | * documentation and/or other materials provided with the distribution. |
| 15 | * |
| 16 | * - Neither the name of the Xiph.org Foundation nor the names of its |
| 17 | * contributors may be used to endorse or promote products derived from |
| 18 | * this software without specific prior written permission. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR |
| 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | */ |
| 32 | |
| 33 | #ifndef FLAC__PRIVATE__CPU_H |
| 34 | #define FLAC__PRIVATE__CPU_Hcxx . . $ `external/flac/flac_private_cpu.h:34:9`! |
| 35 | |
| 36 | #include "flac_FLAC_ordinals.h"cxx . . $ `<file>/external/flac/flac_FLAC_ordinals.h`/ |
| 37 | |
| 38 | #ifdef HAVE_CONFIG_H |
| 39 | #include <config.h> |
| 40 | #endif |
| 41 | |
| 42 | #ifndef FLAC__CPU_X86_64 |
| 43 | |
| 44 | #if defined(__amd64__cxx . . $ `<built-in>:371:9`!) || defined(__amd64cxx . . $ `<built-in>:372:9`!) || defined(__x86_64__cxx . . $ `<built-in>:374:9`!) || defined(__x86_64cxx . . $ `<built-in>:373:9`!) || defined(_M_X64) || defined(_M_AMD64) |
| 45 | #define FLAC__CPU_X86_64cxx . . $ `external/flac/flac_private_cpu.h:45:9`! |
| 46 | #endif |
| 47 | |
| 48 | #endif |
| 49 | |
| 50 | #ifndef FLAC__CPU_IA32 |
| 51 | |
| 52 | #if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86) |
| 53 | #define FLAC__CPU_IA32 |
| 54 | #endif |
| 55 | |
| 56 | #endif |
| 57 | |
| 58 | #ifndef __has_attribute |
| 59 | #define __has_attribute(x) 0 |
| 60 | #endif |
| 61 | |
| 62 | #if FLAC__HAS_X86INTRIN |
| 63 | /* SSE intrinsics support by ICC/MSVC/GCC */ |
| 64 | #if defined __INTEL_COMPILER |
| 65 | #define FLAC__SSE_TARGET(x) |
| 66 | #define FLAC__SSE_SUPPORTED 1 |
| 67 | #define FLAC__SSE2_SUPPORTED 1 |
| 68 | #if (__INTEL_COMPILER >= 1000) /* Intel C++ Compiler 10.0 */ |
| 69 | #define FLAC__SSSE3_SUPPORTED 1 |
| 70 | #define FLAC__SSE4_1_SUPPORTED 1 |
| 71 | #define FLAC__SSE4_2_SUPPORTED 1 |
| 72 | #endif |
| 73 | #ifdef FLAC__USE_AVX |
| 74 | #if (__INTEL_COMPILER >= 1110) /* Intel C++ Compiler 11.1 */ |
| 75 | #define FLAC__AVX_SUPPORTED 1 |
| 76 | #endif |
| 77 | #if (__INTEL_COMPILER >= 1300) /* Intel C++ Compiler 13.0 */ |
| 78 | #define FLAC__AVX2_SUPPORTED 1 |
| 79 | #define FLAC__FMA_SUPPORTED 1 |
| 80 | #endif |
| 81 | #endif |
| 82 | #elif defined __clang__ && __has_attribute(__target__) /* clang */ |
| 83 | #define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x))) |
| 84 | #define FLAC__SSE_SUPPORTED 1 |
| 85 | #define FLAC__SSE2_SUPPORTED 1 |
| 86 | #define FLAC__SSSE3_SUPPORTED 1 |
| 87 | #define FLAC__SSE4_1_SUPPORTED 1 |
| 88 | #define FLAC__SSE4_2_SUPPORTED 1 |
| 89 | #ifdef FLAC__USE_AVX |
| 90 | #define FLAC__AVX_SUPPORTED 1 |
| 91 | #define FLAC__AVX2_SUPPORTED 1 |
| 92 | #define FLAC__FMA_SUPPORTED 1 |
| 93 | #define FLAC__BMI2_SUPPORTED 1 |
| 94 | #endif |
| 95 | #elif defined __GNUC__ && !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */ |
| 96 | #define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x))) |
| 97 | #define FLAC__SSE_SUPPORTED 1 |
| 98 | #define FLAC__SSE2_SUPPORTED 1 |
| 99 | #define FLAC__SSSE3_SUPPORTED 1 |
| 100 | #define FLAC__SSE4_1_SUPPORTED 1 |
| 101 | #define FLAC__SSE4_2_SUPPORTED 1 |
| 102 | #ifdef FLAC__USE_AVX |
| 103 | #define FLAC__AVX_SUPPORTED 1 |
| 104 | #define FLAC__AVX2_SUPPORTED 1 |
| 105 | #define FLAC__FMA_SUPPORTED 1 |
| 106 | #define FLAC__BMI2_SUPPORTED 1 |
| 107 | #endif |
| 108 | #elif defined _MSC_VER |
| 109 | #define FLAC__SSE_TARGET(x) |
| 110 | #define FLAC__SSE_SUPPORTED 1 |
| 111 | #define FLAC__SSE2_SUPPORTED 1 |
| 112 | #if (_MSC_VER >= 1500) /* MS Visual Studio 2008 */ |
| 113 | #define FLAC__SSSE3_SUPPORTED 1 |
| 114 | #define FLAC__SSE4_1_SUPPORTED 1 |
| 115 | #define FLAC__SSE4_2_SUPPORTED 1 |
| 116 | #endif |
| 117 | #ifdef FLAC__USE_AVX |
| 118 | #if (_MSC_FULL_VER >= 160040219) /* MS Visual Studio 2010 SP1 */ |
| 119 | #define FLAC__AVX_SUPPORTED 1 |
| 120 | #endif |
| 121 | #if (_MSC_VER >= 1700) /* MS Visual Studio 2012 */ |
| 122 | #define FLAC__AVX2_SUPPORTED 1 |
| 123 | #define FLAC__FMA_SUPPORTED 1 |
| 124 | #endif |
| 125 | #endif |
| 126 | #else |
| 127 | #define FLAC__SSE_TARGET(x) |
| 128 | #ifdef __SSE__ |
| 129 | #define FLAC__SSE_SUPPORTED 1 |
| 130 | #endif |
| 131 | #ifdef __SSE2__ |
| 132 | #define FLAC__SSE2_SUPPORTED 1 |
| 133 | #endif |
| 134 | #ifdef __SSSE3__ |
| 135 | #define FLAC__SSSE3_SUPPORTED 1 |
| 136 | #endif |
| 137 | #ifdef __SSE4_1__ |
| 138 | #define FLAC__SSE4_1_SUPPORTED 1 |
| 139 | #endif |
| 140 | #ifdef __SSE4_2__ |
| 141 | #define FLAC__SSE4_2_SUPPORTED 1 |
| 142 | #endif |
| 143 | #ifdef FLAC__USE_AVX |
| 144 | #ifdef __AVX__ |
| 145 | #define FLAC__AVX_SUPPORTED 1 |
| 146 | #endif |
| 147 | #ifdef __AVX2__ |
| 148 | #define FLAC__AVX2_SUPPORTED 1 |
| 149 | #endif |
| 150 | #ifdef __FMA__ |
| 151 | #define FLAC__FMA_SUPPORTED 1 |
| 152 | #endif |
| 153 | #endif |
| 154 | #endif /* compiler version */ |
| 155 | #endif /* intrinsics support */ |
| 156 | |
| 157 | |
| 158 | #ifndef FLAC__AVX_SUPPORTED |
| 159 | #define FLAC__AVX_SUPPORTEDcxx . . $ `external/flac/flac_private_cpu.h:159:9`! 0 |
| 160 | #endif |
| 161 | |
| 162 | typedef enumcxx . . $ $anonymous_type_7cf0c57286ec8bf5_0# { |
| 163 | FLAC__CPUINFO_TYPE_IA32cxx . . $ FLAC__CPUINFO_TYPE_IA32., |
| 164 | FLAC__CPUINFO_TYPE_X86_64cxx . . $ FLAC__CPUINFO_TYPE_X86_64., |
| 165 | FLAC__CPUINFO_TYPE_UNKNOWNcxx . . $ FLAC__CPUINFO_TYPE_UNKNOWN. |
| 166 | } FLAC__CPUInfo_Typecxx . . $ FLAC__CPUInfo_Type#; |
| 167 | |
| 168 | typedef structcxx . . $ $anonymous_type_7cf0c57286ec8bf5_1# { |
| 169 | FLAC__boolcxx . . $ FLAC__bool# intelcxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#intel.; |
| 170 | |
| 171 | FLAC__boolcxx . . $ FLAC__bool# cmovcxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#cmov.; |
| 172 | FLAC__boolcxx . . $ FLAC__bool# mmxcxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#mmx.; |
| 173 | FLAC__boolcxx . . $ FLAC__bool# ssecxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#sse.; |
| 174 | FLAC__boolcxx . . $ FLAC__bool# sse2cxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#sse2.; |
| 175 | |
| 176 | FLAC__boolcxx . . $ FLAC__bool# sse3cxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#sse3.; |
| 177 | FLAC__boolcxx . . $ FLAC__bool# ssse3cxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#ssse3.; |
| 178 | FLAC__boolcxx . . $ FLAC__bool# sse41cxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#sse41.; |
| 179 | FLAC__boolcxx . . $ FLAC__bool# sse42cxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#sse42.; |
| 180 | FLAC__boolcxx . . $ FLAC__bool# avxcxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#avx.; |
| 181 | FLAC__boolcxx . . $ FLAC__bool# avx2cxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#avx2.; |
| 182 | FLAC__boolcxx . . $ FLAC__bool# fmacxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#fma.; |
| 183 | FLAC__boolcxx . . $ FLAC__bool# bmi2cxx . . $ $anonymous_type_7cf0c57286ec8bf5_1#bmi2.; |
| 184 | } FLAC__CPUInfo_x86cxx . . $ FLAC__CPUInfo_x86#; |
| 185 | |
| 186 | typedef structcxx . . $ $anonymous_type_7cf0c57286ec8bf5_2# { |
| 187 | FLAC__boolcxx . . $ FLAC__bool# use_asmcxx . . $ $anonymous_type_7cf0c57286ec8bf5_2#use_asm.; |
| 188 | FLAC__CPUInfo_Typecxx . . $ FLAC__CPUInfo_Type# typecxx . . $ $anonymous_type_7cf0c57286ec8bf5_2#type.; |
| 189 | FLAC__CPUInfo_x86cxx . . $ FLAC__CPUInfo_x86# x86cxx . . $ $anonymous_type_7cf0c57286ec8bf5_2#x86.; |
| 190 | } FLAC__CPUInfocxx . . $ FLAC__CPUInfo#; |
| 191 | |
| 192 | void FLAC__cpu_infocxx . . $ FLAC__cpu_info(add83a8062c32f2e).(FLAC__CPUInfocxx . . $ FLAC__CPUInfo# *info); |
| 193 | |
| 194 | FLAC__uint32cxx . . $ FLAC__uint32# FLAC__cpu_have_cpuid_asm_ia32cxx . . $ FLAC__cpu_have_cpuid_asm_ia32(db52760e79bf9054).(void); |
| 195 | |
| 196 | void FLAC__cpu_info_asm_ia32cxx . . $ FLAC__cpu_info_asm_ia32(29d332744f49b4aa).(FLAC__uint32cxx . . $ FLAC__uint32# level, FLAC__uint32cxx . . $ FLAC__uint32# *eax, FLAC__uint32cxx . . $ FLAC__uint32# *ebx, FLAC__uint32cxx . . $ FLAC__uint32# *ecx, FLAC__uint32cxx . . $ FLAC__uint32# *edx); |
| 197 | |
| 198 | #endif |