summaryrefslogtreecommitdiff
path: root/neozip/cpu_features.h
blob: 2b6cc4e843cf4773ce417bfb41ffa36b45e4338c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* cpu_features.h -- CPU architecture feature check
 * Copyright (C) 2017 Hans Kristian Rosbach
 * For conditions of distribution and use, see copyright notice in zlib.h
 */

#ifndef CPU_FEATURES_H_
#define CPU_FEATURES_H_

#ifndef DISABLE_RUNTIME_CPU_DETECTION

#if defined(X86_FEATURES)
#  include "arch/x86/x86_features.h"
#elif defined(ARM_FEATURES)
#  include "arch/arm/arm_features.h"
#elif defined(PPC_FEATURES) || defined(POWER_FEATURES)
#  include "arch/power/power_features.h"
#elif defined(S390_FEATURES)
#  include "arch/s390/s390_features.h"
#elif defined(RISCV_FEATURES)
#  include "arch/riscv/riscv_features.h"
#elif defined(LOONGARCH_FEATURES)
#  include "arch/loongarch/loongarch_features.h"
#endif

struct cpu_features {
#if defined(X86_FEATURES)
    struct x86_cpu_features x86;
#elif defined(ARM_FEATURES)
    struct arm_cpu_features arm;
#elif defined(PPC_FEATURES) || defined(POWER_FEATURES)
    struct power_cpu_features power;
#elif defined(S390_FEATURES)
    struct s390_cpu_features s390;
#elif defined(RISCV_FEATURES)
    struct riscv_cpu_features riscv;
#elif defined(LOONGARCH_FEATURES)
    struct loongarch_cpu_features loongarch;
#else
    char empty;
#endif
};

void cpu_check_features(struct cpu_features *features);

#endif

#endif