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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [include/] [opcode/] [or1k.h] - Blame information for rev 578

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

Line No. Rev Author Line
1 578 markom
/* Table of opcodes for the OpenRISC 1000 family.
2
   Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
3
   Contributed by Damjan Lampret <lampret@opencores.org>.
4
 
5
This file is part of GDB and GAS.
6
 
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20
 
21
struct or32_opcode {
22
  /* Name of the instruction.  */
23
  char *name;
24
 
25
  /* A string of characters which describe the operands.
26
     Ranges for I..O can be wrong (I change them the time ;-).
27
     Valid characters are:
28
     ,   Itself.  The character appears in the assembly code.
29
     rA  Register operand.
30
     rB  Register operand.
31
     rC  Register operand.
32
     rD  Register operand.
33
     I   An immediate operand, range -32768 to 32767.
34
     J   An immediate operand, range -65536 to 65535.
35
     K   An immediate operand, range -131072 to 131071.
36
     L   An immediate operand, range 0 to 31.
37
     M   An immediate operand, range -128 to 127.
38
     N   An immediate operand, range -8 to 7.
39
     O   An immediate operand, unused at the moment. */
40
 
41
  char *args;
42
 
43
  /* Opcode and operand encoding. */
44
  char *encoding;
45
 
46
  /* This will go out. */
47
  int reloc[5];
48
};
49
 
50
#ifndef CONST
51
#define CONST
52
#endif /* CONST */
53
 
54
static CONST struct or32_opcode or32_opcodes[] =
55
{
56
 
57
{ "l.illegal", "",           "0x0 0000 0000 0000 0000 0000 0000 0000", {NO_RELOC, NO_RELOC, NO_RELOC}},
58
{ "l.j",       "X",          "0x0 00XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
59
{ "l.jal",     "X",          "0x0 01XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
60
{ "l.bnf",     "X",          "0x0 10XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
61
{ "l.bf",      "X",          "0x0 11XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
62
{ "l.bfnez",   "X",          "0x0 11XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}}, /* x*/
63
{ "l.bfeqz",   "X",          "0x0 10XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}}, /* x*/
64
{ "l.jmp",     "X",          "0x0 00XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}}, /* x*/
65
 
66
{ "l.load32u", "rA,J(rB)",   "0x1 000J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
67
{ "l.load16u", "rA,J(rB)",   "0x1 001J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
68
{ "l.load16s", "rA,J(rB)",   "0x1 010J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
69
{ "l.load8u",  "rA,J(rB)",   "0x1 011J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
70
{ "l.load8s",  "rA,J(rB)",   "0x1 100J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
71
{ "l.stor32",  "J(rA),rB",   "0x1 101J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
72
{ "l.stor16",  "J(rA),rB",   "0x1 110J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
73
{ "l.stor8",   "J(rA),rB",   "0x1 111J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
74
{ "l.addi32s", "rA,rB,K",    "0x2 00KK AAAA BBBB KKKK KKKK KKKK KKKK", {NO_RELOC, NO_RELOC, NO_RELOC}},
75
{ "l.subi32s", "rA,rB,K",    "0x2 01KK AAAA BBBB KKKK KKKK KKKK KKKK", {NO_RELOC, NO_RELOC, NO_RELOC}},
76
{ "l.muli32s", "rA,rB,I",    "0x2 1000 AAAA BBBB IIII IIII IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
77
{ "l.xori16",  "rA,rB,I",    "0x2 1001 AAAA BBBB IIII IIII IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
78
{ "l.immlo16u","rA,lo(I)",   "0x2 1010 AAAA ---- IIII IIII IIII IIII", {NO_RELOC, RELOC_CONST}},
79
{ "l.immhi16u","rA,hi(I)",   "0x2 1011 AAAA ---- IIII IIII IIII IIII", {NO_RELOC, RELOC_CONSTH}},
80
 
81
{ "l.sub32s",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x0  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
82
{ "l.shla32",  "rA,rB,rC,L", "0x2 0xC  AAAA BBBB CCCC 0x1  LLLL L---", {NO_RELOC, NO_RELOC, NO_RELOC}},
83
{ "l.shra32",  "rA,rB,rC,L", "0x2 0xC  AAAA BBBB CCCC 0x2  LLLL L---", {NO_RELOC, NO_RELOC, NO_RELOC}},
84
{ "l.shrl32",  "rA,rB,rC,L", "0x2 0xC  AAAA BBBB CCCC 0x3  LLLL L---", {NO_RELOC, NO_RELOC, NO_RELOC}},
85
{ "l.and32",   "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x4  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
86
{ "l.or32",    "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x5  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
87
{ "l.xor32",   "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x6  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
88
{ "l.mul32s",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x7  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
89
{ "l.mul32u",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x8  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
90
{ "l.div32s",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x9  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
91
{ "l.div32u",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0xA  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
92
 
93
{ "l.dcbf",    "J(rA)",      "0x3 0x0  AAAA IIII IIII 0x0  IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
94
{ "l.dcbt",    "J(rA)",      "0x3 0x0  AAAA IIII IIII 0x1  IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
95
{ "l.dcbi",    "J(rA)",      "0x3 0x0  AAAA IIII IIII 0x2  IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
96
{ "l.dcia",    "",           "0x3 0x0  AAAA ---- ---- 0x3  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
97
{ "l.dcfa",    "",           "0x3 0x0  AAAA ---- ---- 0x4  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
98
{ "l.tlbia",   "",           "0x3 0x0  AAAA ---- ---- 0x5  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
99
{ "l.mtsr",    "rS,rA",      "0x3 0x0  AAAA SSSS SSSS 0x6  SSSS SSSS", {NO_RELOC, NO_RELOC, NO_RELOC}},
100
{ "l.mfsr",    "rA,rS",      "0x3 0x0  AAAA SSSS SSSS 0x7  SSSS SSSS", {NO_RELOC, NO_RELOC, NO_RELOC}},
101
 
102
{ "h.sfeq32",  "rA,rB",      "0x4 0x0  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
103
{ "h.sfne32",  "rA,rB",      "0x4 0x1  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
104
{ "h.sfgt32s", "rA,rB",      "0x4 0x2  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
105
{ "h.sfge32s", "rA,rB",      "0x4 0x3  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
106
{ "h.sflt32s", "rA,rB",      "0x4 0x4  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
107
{ "h.sfle32s", "rA,rB",      "0x4 0x5  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
108
{ "h.sfgt32u", "rA,rB",      "0x4 0x6  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
109
{ "h.sfge32u", "rA,rB",      "0x4 0x7  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
110
{ "h.sflt32u", "rA,rB",      "0x4 0x8  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
111
{ "h.sfle32u", "rA,rB",      "0x4 0x9  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
112
 
113
{ "h.mov32",   "rA,rB",      "0x4 0xA  AAAA BBBB                    ", {NO_RELOC, NO_RELOC}},
114
 
115
{ "h.ext16s",  "rA",         "0x4 0xB  AAAA -000                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
116
{ "h.ext16z",  "rA",         "0x4 0xB  AAAA -001                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
117
{ "h.ext8s",   "rA",         "0x4 0xB  AAAA -010                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
118
{ "h.ext8z",   "rA",         "0x4 0xB  AAAA -011                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
119
{ "h.nop",     "",           "0x4 0xB  ---- -100                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
120
{ "h.jalr",    "rA",         "0x4 0xB  AAAA -101                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
121
 
122
{ "h.load32u", "rA,N(rB)",   "0x5 NNNN AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
123
{ "h.stor32",  "N(rA),rB",   "0x6 NNNN AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
124
{ "h.add32s",  "rA,rB,rD",   "0x7 DDDD AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
125
{ "h.immch32s","rA,M",       "0x8 MMMM AAAA MMMM                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
126
{ "h.jal",     "X",          "0x9 XXXX XXXX XXXX                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
127
{ "h.bnf",     "X",          "0xA XXXX XXXX XXXX        ", {NO_RELOC, NO_RELOC, NO_RELOC}},
128
{ "h.bf",      "X",          "0xB XXXX XXXX XXXX        ", {NO_RELOC, NO_RELOC, NO_RELOC}},
129
{ "h.movi32",  "rA,M",       "0xC MMMM AAAA MMMM                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
130
 
131
{ "simprintf", "",           "0xE 0000 0000 0001                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
132
{ "simrdtsc",  "rA",         "0xE 0000 AAAA 0002                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
133
{ "h.sched",   "Z",          "0xF ZZZZ ZZZZ ZZZZ                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
134
 
135
{ "", "", "" }    /* Dummy entry, not included in NUM_OPCODES.  This
136
         lets code examine entry i+1 without checking
137
         if we've run off the end of the table.  */
138
};
139
 
140
CONST unsigned int num_opcodes = (((sizeof or32_opcodes) / (sizeof or32_opcodes[0])) - 1);

powered by: WebSVN 2.1.0

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