swar.h
1.66 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
/* -----------------------------------------------------------------------------
* 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_H
#define SWAR_H
// SWAR configuration register definitions
#define SW_OP_ADD 0x0
#define SW_OP_SUB 0x8
#define SW_OP_MUL 0xc
//
#define SW_OP_COR1b 0x4
#define SW_OP_COR2b 0x5
#define SW_OP_COR3b 0x6
#define SW_OP_COR4b 0x7
//
#define SW_OP_DEMR2b 0x9
#define SW_OP_DEMR3b 0xa
#define SW_OP_DEMR4b 0xb
//
#define SW_OP_DEMC2b 0xd
#define SW_OP_DEMC3b 0xe
#define SW_OP_DEMC4b 0xf
//
#define SW_OP_DEMC2bG 0x1
#define SW_OP_DEMC3bG 0x2
#define SW_OP_DEMC4bG 0x3
//
#define SW_OP_SC1b 0x10
#define SW_OP_SC2b 0x20
#define SW_OP_SC3b 0x30
#define SW_OP_SC4b 0x40
//
#define SW_SGND 0x100
#define SW_RED 0x200
#define SW_SAT 0x400
#define SW_NORM 0x800
//
#define SW_AUDIO 0x1000
#define SW_VIDEO 0x2000
#define SW_ALU 0x4000
void swar_config(unsigned config);
unsigned swar_readconfig(void);
void swar_selacc(unsigned accid);
int swar_readacc(void);
unsigned exec_swar(unsigned a, unsigned b);
unsigned exec_swarcc(unsigned a, unsigned b);
#endif