summaryrefslogtreecommitdiff
path: root/plugins/supereq/nsfft-1.00/simd/SIMDBase.h
blob: 10cdeb819b9bb5a4495b039ae598bb81dc8f5622 (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
48
49
50
51
52
53
#ifndef _SIMDBase_H_
#define _SIMDBase_H_

#include <stdint.h>

#define SIMDBase_TYPE_FLOAT ( 1 | ( 1 << 24 ))
#define SIMDBase_TYPE_DOUBLE ( 2 | ( 1 << 24 ))
#define SIMDBase_TYPE_LONGDOUBLE ( 3 | ( 1 << 24 ))
#define SIMDBase_TYPE_EXTENDED ( 4 | ( 1 << 24 ))
#define SIMDBase_TYPE_QUAD ( 5 | ( 1 << 24 ))
#define SIMDBase_TYPE_HALF ( 6 | ( 1 << 24 ))

#define SIMDBase_MODE_NONE 0
#define SIMDBase_MODE_PUREC_FLOAT 1
#define SIMDBase_MODE_PUREC_DOUBLE 2
#define SIMDBase_MODE_PUREC_LONGDOUBLE 3
#define SIMDBase_MODE_SSE_FLOAT 4
#define SIMDBase_MODE_SSE2_DOUBLE 5
#define SIMDBase_MODE_NEON_FLOAT 6
#define SIMDBase_MODE_AVX_FLOAT 7
#define SIMDBase_MODE_AVX_DOUBLE 8
#define SIMDBase_MODE_ALTIVEC_FLOAT 9

#define SIMDBase_LAST_MODE SIMDBase_MODE_ALTIVEC_FLOAT

#define SIMDBase_PARAMID_MODE_MAX ( 1 | ( 2 << 24 ))
#define SIMDBase_PARAMID_TYPE_AVAILABILITY ( 2 | ( 2 << 24 ))
#define SIMDBase_PARAMID_SIZE_OF_REAL ( 3 | ( 2 << 24 ))
#define SIMDBase_PARAMID_SIZE_OF_VECT ( 4 | ( 2 << 24 ))
#define SIMDBase_PARAMID_VECTOR_LEN ( 5 | ( 2 << 24 ))
#define SIMDBase_PARAMID_MODE_AVAILABILITY ( 6 | ( 2 << 24 ))
#define SIMDBase_PARAMID_MODE_NAME ( 7 | ( 2 << 24 ))

//

typedef struct {
  uint32_t linesize;
  uint32_t size[8], assoc[8];
} CacheParam;

void *SIMDBase_alignedMalloc(uint64_t size);
void SIMDBase_alignedFree(void *ptr);
int32_t SIMDBase_sizeOfCachelineInByte();
int32_t SIMDBase_sizeOfDataCacheInByte();
int32_t SIMDBase_chooseBestMode(int32_t typeId);
char *SIMDBase_getProcessorNameString();
int32_t SIMDBase_detect(int32_t paramId);
int32_t SIMDBase_getParamInt(int32_t paramId);
int32_t SIMDBase_getTypeParamInt(int32_t paramId, int32_t typeId);
int32_t SIMDBase_getModeParamInt(int32_t paramId, int32_t mode);
char *SIMDBase_getModeParamString(int32_t paramId, int32_t mode);

#endif