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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [insight/] [include/] [opcode/] [or1k.h] - Rev 1782

Compare with Previous | Blame | View Log

/* Table of opcodes for the OpenRISC 1000 family.
   Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
   Contributed by Damjan Lampret <lampret@opencores.org>.
 
This file is part of GDB and GAS.
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
struct or32_opcode {
  /* Name of the instruction.  */
  char *name;
 
  /* A string of characters which describe the operands.
     Ranges for I..O can be wrong (I change them the time ;-).
     Valid characters are:
     ,   Itself.  The character appears in the assembly code.
     rA  Register operand.
     rB  Register operand.
     rC  Register operand.
     rD  Register operand.
     I   An immediate operand, range -32768 to 32767.
     J   An immediate operand, range -65536 to 65535.
     K   An immediate operand, range -131072 to 131071.
     L   An immediate operand, range 0 to 31.
     M   An immediate operand, range -128 to 127.
     N   An immediate operand, range -8 to 7.
     O   An immediate operand, unused at the moment. */
 
  char *args;
 
  /* Opcode and operand encoding. */
  char *encoding;
 
  /* This will go out. */
  int reloc[5];
};
 
#ifndef CONST
#define CONST
#endif /* CONST */
 
static CONST struct or32_opcode or32_opcodes[] =
{
 
{ "l.illegal", "",           "0x0 0000 0000 0000 0000 0000 0000 0000", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.j",       "X",          "0x0 00XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.jal",     "X",          "0x0 01XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.bnf",     "X",          "0x0 10XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.bf",      "X",          "0x0 11XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.bfnez",   "X",          "0x0 11XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}}, /* x*/
{ "l.bfeqz",   "X",          "0x0 10XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}}, /* x*/
{ "l.jmp",     "X",          "0x0 00XX XXXX XXXX XXXX XXXX XXXX XXXX", {NO_RELOC, NO_RELOC, NO_RELOC}}, /* x*/
 
{ "l.load32u", "rA,J(rB)",   "0x1 000J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.load16u", "rA,J(rB)",   "0x1 001J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.load16s", "rA,J(rB)",   "0x1 010J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.load8u",  "rA,J(rB)",   "0x1 011J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.load8s",  "rA,J(rB)",   "0x1 100J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.stor32",  "J(rA),rB",   "0x1 101J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.stor16",  "J(rA),rB",   "0x1 110J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.stor8",   "J(rA),rB",   "0x1 111J AAAA BBBB JJJJ JJJJ JJJJ JJJJ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.addi32s", "rA,rB,K",    "0x2 00KK AAAA BBBB KKKK KKKK KKKK KKKK", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.subi32s", "rA,rB,K",    "0x2 01KK AAAA BBBB KKKK KKKK KKKK KKKK", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.muli32s", "rA,rB,I",    "0x2 1000 AAAA BBBB IIII IIII IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.xori16",  "rA,rB,I",    "0x2 1001 AAAA BBBB IIII IIII IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.immlo16u","rA,lo(I)",   "0x2 1010 AAAA ---- IIII IIII IIII IIII", {NO_RELOC, RELOC_CONST}},
{ "l.immhi16u","rA,hi(I)",   "0x2 1011 AAAA ---- IIII IIII IIII IIII", {NO_RELOC, RELOC_CONSTH}},
 
{ "l.sub32s",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x0  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.shla32",  "rA,rB,rC,L", "0x2 0xC  AAAA BBBB CCCC 0x1  LLLL L---", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.shra32",  "rA,rB,rC,L", "0x2 0xC  AAAA BBBB CCCC 0x2  LLLL L---", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.shrl32",  "rA,rB,rC,L", "0x2 0xC  AAAA BBBB CCCC 0x3  LLLL L---", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.and32",   "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x4  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.or32",    "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x5  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.xor32",   "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x6  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.mul32s",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x7  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.mul32u",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x8  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.div32s",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0x9  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.div32u",  "rA,rB,rC",   "0x2 0xC  AAAA BBBB CCCC 0xA  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
 
{ "l.dcbf",    "J(rA)",      "0x3 0x0  AAAA IIII IIII 0x0  IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.dcbt",    "J(rA)",      "0x3 0x0  AAAA IIII IIII 0x1  IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.dcbi",    "J(rA)",      "0x3 0x0  AAAA IIII IIII 0x2  IIII IIII", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.dcia",    "",           "0x3 0x0  AAAA ---- ---- 0x3  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.dcfa",    "",           "0x3 0x0  AAAA ---- ---- 0x4  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.tlbia",   "",           "0x3 0x0  AAAA ---- ---- 0x5  ---- ----", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.mtsr",    "rS,rA",      "0x3 0x0  AAAA SSSS SSSS 0x6  SSSS SSSS", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "l.mfsr",    "rA,rS",      "0x3 0x0  AAAA SSSS SSSS 0x7  SSSS SSSS", {NO_RELOC, NO_RELOC, NO_RELOC}},
 
{ "h.sfeq32",  "rA,rB",      "0x4 0x0  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sfne32",  "rA,rB",      "0x4 0x1  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sfgt32s", "rA,rB",      "0x4 0x2  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sfge32s", "rA,rB",      "0x4 0x3  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sflt32s", "rA,rB",      "0x4 0x4  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sfle32s", "rA,rB",      "0x4 0x5  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sfgt32u", "rA,rB",      "0x4 0x6  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sfge32u", "rA,rB",      "0x4 0x7  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sflt32u", "rA,rB",      "0x4 0x8  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sfle32u", "rA,rB",      "0x4 0x9  AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
 
{ "h.mov32",   "rA,rB",      "0x4 0xA  AAAA BBBB                    ", {NO_RELOC, NO_RELOC}},
 
{ "h.ext16s",  "rA",         "0x4 0xB  AAAA -000                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.ext16z",  "rA",         "0x4 0xB  AAAA -001                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.ext8s",   "rA",         "0x4 0xB  AAAA -010                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.ext8z",   "rA",         "0x4 0xB  AAAA -011                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.nop",     "",           "0x4 0xB  ---- -100                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.jalr",    "rA",         "0x4 0xB  AAAA -101                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
 
{ "h.load32u", "rA,N(rB)",   "0x5 NNNN AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.stor32",  "N(rA),rB",   "0x6 NNNN AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.add32s",  "rA,rB,rD",   "0x7 DDDD AAAA BBBB                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.immch32s","rA,M",       "0x8 MMMM AAAA MMMM                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.jal",     "X",          "0x9 XXXX XXXX XXXX                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.bnf",     "X",          "0xA XXXX XXXX XXXX        ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.bf",      "X",          "0xB XXXX XXXX XXXX        ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.movi32",  "rA,M",       "0xC MMMM AAAA MMMM                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
 
{ "simprintf", "",           "0xE 0000 0000 0001                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "simrdtsc",  "rA",         "0xE 0000 AAAA 0002                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
{ "h.sched",   "Z",          "0xF ZZZZ ZZZZ ZZZZ                    ", {NO_RELOC, NO_RELOC, NO_RELOC}},
 
{ "", "", "" }    /* Dummy entry, not included in NUM_OPCODES.  This
         lets code examine entry i+1 without checking
         if we've run off the end of the table.  */
};
 
CONST unsigned int num_opcodes = (((sizeof or32_opcodes) / (sizeof or32_opcodes[0])) - 1);
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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