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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [opcodes/] [score-dis.c] - Rev 332

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

/* Instruction printing code for Score
   Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
   Contributed by:
   Brain.lin (brain.lin@sunplusct.com)
   Mei Ligang (ligang@sunnorth.com.cn)
   Pei-Lin Tsai (pltsai@sunplus.com)
 
   This file is part of the GNU opcodes library.
 
   This library 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 3, or (at your option)
   any later version.
 
   It 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 file; see the file COPYING.  If not, write to the
   Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */
 
#include "sysdep.h"
#include "dis-asm.h"
#define DEFINE_TABLE
#include "opintl.h"
#include "bfd.h"
 
/* FIXME: This shouldn't be done here.  */
#include "elf-bfd.h"
#include "elf/internal.h"
#include "elf/score.h"
 
#ifdef BFD64
/* s3_s7: opcodes and export prototypes.  */
extern int 
s7_print_insn (bfd_vma pc, struct disassemble_info *info, bfd_boolean little);
 
struct score_opcode
{
  bfd_vma value;
  bfd_vma mask;           /* Recognise instruction if (op & mask) == value.  */
  char *assembler;        /* Disassembly string.  */
};
 
/* Note: There is a partial ordering in this table - it must be searched from
   the top to obtain a correct match.  */
 
static struct score_opcode score_opcodes[] =
{
  /* Score Instructions.  */
  {0x3800000a, 0x3e007fff, "abs\t\t%20-24r, %15-19r"},
  {0x3800004b, 0x3e007fff, "abs.s\t\t%20-24r, %15-19r"},        
  {0x00000010, 0x3e0003ff, "add\t\t%20-24r, %15-19r, %10-14r"},
  {0x00000011, 0x3e0003ff, "add.c\t\t%20-24r, %15-19r, %10-14r"},
  {0x38000048, 0x3e0003ff, "add.s\t\t%20-24r, %15-19r, %10-14r"},
  {0x00000012, 0x3e0003ff, "addc\t\t%20-24r, %15-19r, %10-14r"},
  {0x00000013, 0x3e0003ff, "addc.c\t\t%20-24r, %15-19r, %10-14r"},
  {0x02000000, 0x3e0e0001, "addi\t\t%20-24r, %1-16i"},
  {0x02000001, 0x3e0e0001, "addi.c\t\t%20-24r, %1-16i"},
  {0x0a000000, 0x3e0e0001, "addis\t\t%20-24r, %1-16d(0x%1-16x)"},
  {0x0a000001, 0x3e0e0001, "addis.c\t\t%20-24r, %1-16d(0x%1-16x)"},
  {0x10000000, 0x3e000001, "addri\t\t%20-24r, %15-19r, %1-14i"},
  {0x10000001, 0x3e000001, "addri.c\t\t%20-24r, %15-19r, %1-14i"},
  {0x00004800, 0x00007f00, "add!\t\t%4-7r, %0-3r"},
  {0x00005c00, 0x00007c00, "addi!\t\t%6-9r, %0-5i"},
  {0x00000020, 0x3e0003ff, "and\t\t%20-24r, %15-19r, %10-14r"},
  {0x00000021, 0x3e0003ff, "and.c\t\t%20-24r, %15-19r, %10-14r"},
  {0x040000000000LL, 0x1c0000000003LL, "andri48\t\t%38-41r,%34-37r, 0x%2-33x"},
  {0x040000000001LL, 0x1c0000000003LL, "andri48.c\t\t%38-41r,%34-37r, 0x%2-33x"},
  {0x02080000, 0x3e0e0001, "andi\t\t%20-24r, 0x%1-16x"},
  {0x02080001, 0x3e0e0001, "andi.c\t\t%20-24r, 0x%1-16x"},
  {0x0a080000, 0x3e0e0001, "andis\t\t%20-24r, 0x%1-16x"},
  {0x0a080001, 0x3e0e0001, "andis.c\t\t%20-24r, 0x%1-16x"},
  {0x18000000, 0x3e000001, "andri\t\t%20-24r, %15-19r, 0x%1-14x"},
  {0x18000001, 0x3e000001, "andri.c\t\t%20-24r, %15-19r,0x%1-14x"},
  {0x00004b00, 0x00007f00, "and!\t\t%4-7r, %0-3r"},
  {0x08000000, 0x3e007c01, "bcs\t\t%b"},
  {0x08000400, 0x3e007c01, "bcc\t\t%b"},
  {0x08003800, 0x3e007c01, "bcnz\t\t%b"},
  {0x08000001, 0x3e007c01, "bcsl\t\t%b"},
  {0x08000401, 0x3e007c01, "bccl\t\t%b"},
  {0x08003801, 0x3e007c01, "bcnzl\t\t%b"},
  {0x0000004c, 0x3e00007e, "bcmpeqz\t\t%15-19r, %z"},
  {0x0000004c, 0x3e00007e, "bcmpeq\t\t%15-19r,  %z"},
  {0x0000004e, 0x3e00007e, "bcmpnez\t\t%15-19r, %z"},
  {0x0000004e, 0x3e00007e, "bcmpne\t\t%15-19r,  %z"},
  {0x00003200, 0x00007e00, "bcnz!\t\t%b"},
  {0x08001000, 0x3e007c01, "beq\t\t%b"},
  {0x08001001, 0x3e007c01, "beql\t\t%b"},
  {0x00003800, 0x00007e00, "beq!\t\t%b"},
  {0x08000800, 0x3e007c01, "bgtu\t\t%b"},
  {0x08001800, 0x3e007c01, "bgt\t\t

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

powered by: WebSVN 2.1.0

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