OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [cuc/] [insn.h] - Blame information for rev 902

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 879 markom
/* insn.h -- OpenRISC Custom Unit Compiler, internal instruction definitions
2
 *    Copyright (C) 2002 Marko Mlinar, markom@opencores.org
3
 *
4
 *    This file is part of OpenRISC 1000 Architectural Simulator.
5
 *
6
 *    This program is free software; you can redistribute it and/or modify
7
 *    it under the terms of the GNU General Public License as published by
8
 *    the Free Software Foundation; either version 2 of the License, or
9
 *    (at your option) any later version.
10
 *
11
 *    This program is distributed in the hope that it will be useful,
12
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *    GNU General Public License for more details.
15
 *
16
 *    You should have received a copy of the GNU General Public License
17
 *    along with this program; if not, write to the Free Software
18
 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20
#ifndef _DF_INSN_
21
#define _DF_INSN_
22
 
23
#include "cuc.h"
24
 
25
/* Instruction types */
26
#define II_ADD   0
27
#define II_SUB   1
28
#define II_AND   2
29
#define II_OR    3
30
#define II_XOR   4
31
#define II_MUL   5
32
#define II_SRL   6
33
#define II_SLL   7
34
#define II_SRA   8
35
#define II_LB    9
36
#define II_LH    10
37
#define II_LW    11
38
#define II_SB    12
39
#define II_SH    13
40
#define II_SW    14
41
#define II_SFEQ  15
42
#define II_SFNE  16
43
#define II_SFLE  17
44
#define II_SFLT  18
45
#define II_SFGE  19
46
#define II_SFGT  20
47
#define II_SFOR  21
48
#define II_BF    22
49
#define II_LRBB  23
50
#define II_CMOV  24
51
#define II_REG   25
52
#define II_NOP   26
53
#define II_LAST  26
54
 
55
/* misc flags */
56
#define II_MASK   0x0fff
57
#define II_MEM    0x1000
58
#define II_SIGNED 0x2000
59
 
60
#define II_IS_LOAD(x) ((x) == II_LB || (x) == II_LH || (x) == II_LW)
61 883 markom
#define II_MEM_WIDTH(x) (((x) == II_LB || (x) == II_SB) ? 1 :\
62
                         ((x) == II_LH || (x) == II_SH) ? 2 :\
63
                         ((x) == II_LW || (x) == II_SW) ? 4 : -1)
64 879 markom
 
65
/* List of known instructions and their rtl representation */
66
typedef struct {
67
        char *name;
68
        int  comutative;
69
        char *rtl;
70
} cuc_known_insn;
71
 
72
extern const cuc_known_insn known[II_LAST + 1];
73
 
74
/* Timing table -- same indexes as known table */
75
typedef struct {
76
        double delay;
77
        double size;
78
        double delayi;
79
        double sizei;
80
} cuc_timing_table;
81
 
82
/* Conversion links */
83
typedef struct {
84
        const char *from;
85
        const int to;
86
} cuc_conv;
87
 
88 883 markom
/* normal (not immediate) size of a function */
89
double ii_size (int index, int imm);
90
 
91
/* Returns instruction size */
92
double insn_time (cuc_insn *ii);
93
 
94
/* Returns instruction time */
95
double insn_size (cuc_insn *ii);
96
 
97 879 markom
/* Find known instruction and attach them to insn */
98
void change_insn_type (cuc_insn *i, int index);
99
 
100 902 markom
/* Search and otimize complex cmov assignments */
101
void optimize_cmovs (cuc_func *f);
102
 
103 879 markom
/* Returns instruction name */
104
const char *cuc_insn_name (cuc_insn *ii);
105
 
106
/* Loads in the specified timings table */
107
void load_timing_table (char *filename);
108
 
109 897 markom
/* Displays shared instructions */
110
void print_shared (cuc_func *rf, cuc_shared_item *shared, int nshared);
111
 
112 879 markom
#endif /* _DF_INSN_ */
113
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.