swar.h
2.3 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* -----------------------------------------------------------------------------
* Copyright (C) 2019 daiteq s.r.o. http://www.daiteq.com
*
* This program is distributed WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
*
* -----------------------------------------------------------------------------
* Filename : swar.h
* Authors : Martin Danek
* Description : configuration of SWAR instructions
* Release :
* Version : 1.0
* Date : 9.4.2019
* -----------------------------------------------------------------------------
*/
#ifndef SWAR_HEADER_FILE
#define SWAR_HEADER_FILE
/* SWAR configuration register */
#define SWAR_CONF_ACCSIZE_MASK 0x3F
#define SWAR_CONF_ACCSIZE_SHIFT 26
#define SWAR_CONF_SWIDTH_MASK 0x1F
#define SWAR_CONF_SWIDTH_SHIFT 21
#define SWAR_CONF_LANES_MASK 0x1F
#define SWAR_CONF_LANES_SHIFT 16
#define SWAR_CONF_FCN_CORREL 0
#define SWAR_CONF_FCN_DEMOD 1
#define SWAR_CONF_FCN_SINCOS 2
#define SWAR_CONF_FCN_AUDIO 3
#define SWAR_CONF_FCN_VIDEO 4
#define SWAR_CONF_FCN_ALU 5
#define SWAR_CONF_FCN_LACCUMS 6
/* SWAR control register */
/* audio/video/alu operations */
#define SW_OP_ADD 0x00
#define SW_OP_SUB 0x08
#define SW_OP_MUL 0x0C
/* correlation */
#define SW_OP_COR1b 0x04
#define SW_OP_COR2b 0x05
#define SW_OP_COR3b 0x06
#define SW_OP_COR4b 0x07
/* demodulation */
#define SW_OP_DEMR2b 0x09
#define SW_OP_DEMR3b 0x0A
#define SW_OP_DEMR4b 0x0B
#define SW_OP_DEMC2b 0x0D
#define SW_OP_DEMC3b 0x0E
#define SW_OP_DEMC4b 0x0F
#define SW_OP_DEMC2bG 0x01
#define SW_OP_DEMC3bG 0x02
#define SW_OP_DEMC4bG 0x03
/* sincos LUT */
#define SW_OP_SC1b 0x10
#define SW_OP_SC2b 0x20
#define SW_OP_SC3b 0x30
#define SW_OP_SC4b 0x40
#define SW_CTRL_OPMASK 0xFF
#define SW_CTRL_SIGNED (1<<8)
#define SW_CTRL_REDUCE (1<<9)
#define SW_CTRL_SATURATE (1<<10)
#define SW_CTRL_NORMALIZE (1<<11)
#define SW_CTRL_AUDIO (1<<12)
#define SW_CTRL_VIDEO (1<<13)
#define SW_CTRL_ALU (1<<14)
#endif /* SWAR_HEADER_FILE */