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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [binutils-2.20.1/] [opcodes/] [or32-dis.c] - Diff between revs 205 and 673

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 205 Rev 673
Line 26... Line 26...
#include "opcode/or32.h"
#include "opcode/or32.h"
#include "safe-ctype.h"
#include "safe-ctype.h"
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
 
 
#define EXTEND28(x) ((x) & (unsigned long) 0x08000000 ? ((x) | (unsigned long) 0xf0000000) : ((x)))
#define EXTEND28(x) ((x) & 0x08000000UL ? ((x) | ~0x0fffffffUL) : ((x)))
 
 
/* Now find the four bytes of INSN_CH and put them in *INSN.  */
/* Now find the four bytes of INSN_CH and put them in *INSN.  */
 
 
static void
static void
find_bytes_big (unsigned char *insn_ch, unsigned long *insn)
find_bytes_big (unsigned char *insn_ch, unsigned long *insn)
Line 98... Line 98...
      }
      }
    else if ((*enc == '0') || (*enc == '1'))
    else if ((*enc == '0') || (*enc == '1'))
      {
      {
        opc_pos--;
        opc_pos--;
        if (param_ch == *enc)
        if (param_ch == *enc)
          ret |= 1 << opc_pos;
          ret |= 1UL << opc_pos;
        enc++;
        enc++;
      }
      }
    else if (*enc == param_ch)
    else if (*enc == param_ch)
      {
      {
        opc_pos--;
        opc_pos--;
Line 118... Line 118...
          {
          {
#if DEBUG
#if DEBUG
            printf ("\n  ret=%x opc_pos=%x, param_pos=%x\n",
            printf ("\n  ret=%x opc_pos=%x, param_pos=%x\n",
                    ret, opc_pos, param_pos);
                    ret, opc_pos, param_pos);
#endif
#endif
            ret |= 0xffffffff << letter_range(param_ch);
            ret |= -1L << letter_range(param_ch);
#if DEBUG
#if DEBUG
            printf ("\n  after conversion to signed: ret=%x\n", ret);
            printf ("\n  after conversion to signed: ret=%x\n", ret);
#endif
#endif
          }
          }
        enc++;
        enc++;
Line 155... Line 155...
  printf ("or32_opcode_match: %.8lx\n", insn);
  printf ("or32_opcode_match: %.8lx\n", insn);
#endif    
#endif    
  ones  = or32_extract ('1', encoding, insn);
  ones  = or32_extract ('1', encoding, insn);
  zeros = or32_extract ('0', encoding, insn);
  zeros = or32_extract ('0', encoding, insn);
 
 
  // Added 090430 - jb - fixed problem where upper 4 bytes of a 64-bit long weren't getting setup properly for comparison
 
  // As a result, instructions weren't getting decoded properly
 
  insn &= 0xffffffff;
 
  ones &= 0xffffffff;
 
  zeros &= 0xffffffff;
 
 
 
#if DEBUG
#if DEBUG
  printf ("ones: %x \n", ones);
  printf ("ones: %x \n", ones);
  printf ("zeros: %x \n", zeros);
  printf ("zeros: %x \n", zeros);
#endif
#endif
  if ((insn & ones) != ones)
  if ((insn & ones) != ones)

powered by: WebSVN 2.1.0

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