]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - opcodes/csky-dis.c
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / opcodes / csky-dis.c
index 67fb4ee87ed669d639060d961decf6b512f52e20..399c180a8dd0c7b9c407bb623dee948f2235896c 100644 (file)
@@ -1,5 +1,5 @@
 /* C-SKY disassembler.
-   Copyright (C) 1988-2020 Free Software Foundation, Inc.
+   Copyright (C) 1988-2021 Free Software Foundation, Inc.
    Contributed by C-SKY Microsystems and Mentor Graphics.
 
    This file is part of the GNU opcodes library.
@@ -287,14 +287,14 @@ parse_csky_dis_options (const char *opts_in)
 static const char *
 get_gr_name (int regno)
 {
-  return csky_get_general_reg_name (mach_flag & CSKY_ABI_MASK, regno, using_abi);
+  return csky_get_general_reg_name (mach_flag, regno, using_abi);
 }
 
 /* Get control register name.  */
 static const char *
 get_cr_name (unsigned int regno, int bank)
 {
-  return csky_get_control_reg_name (mach_flag & CSKY_ABI_MASK, bank, regno, using_abi);
+  return csky_get_control_reg_name (mach_flag, bank, regno, using_abi);
 }
 
 static int
@@ -415,6 +415,15 @@ csky_output_operand (char *str, struct operand const *oprnd,
       strcat (str, buf);
       ret = 0;
       break;
+    case OPRND_TYPE_IMM5b_VSH:
+      {
+       char num[128];
+       value = ((value & 0x1) << 4) | (value >> 1);
+       sprintf (num, "%d", (int)value);
+       strcat (str, num);
+       ret = 0;
+       break;
+      }
     case OPRND_TYPE_MSB2SIZE:
     case OPRND_TYPE_LSB2SIZE:
       {
@@ -837,7 +846,7 @@ csky_output_operand (char *str, struct operand const *oprnd,
       else if ((value & 0x3) == 0x3)
        strcat (str, "3");
       break;
-    case OPRND_TYPE_FREG_WITH_INDEX:
+    case OPRND_TYPE_VREG_WITH_INDEX:
       {
        unsigned freg_val = value & 0xf;
        unsigned index_val = (value >> 4) & 0xf;
@@ -845,10 +854,20 @@ csky_output_operand (char *str, struct operand const *oprnd,
        strcat(str, buf);
        break;
       }
+    case OPRND_TYPE_FREG_WITH_INDEX:
+      {
+       unsigned freg_val = value & 0xf;
+       unsigned index_val = (value >> 4) & 0xf;
+       sprintf (buf, "fr%d[%d]", freg_val, index_val);
+       strcat(str, buf);
+       break;
+      }
     case OPRND_TYPE_REGr4_r7:
       if (IS_CSKY_V1 (mach_flag))
-       sprintf (buf, "%s-%s", get_gr_name (4), get_gr_name (7));
-       strcat (str, buf);
+       {
+         sprintf (buf, "%s-%s", get_gr_name (4), get_gr_name (7));
+         strcat (str, buf);
+       }
       break;
     case OPRND_TYPE_CONST1:
       strcat (str, "1");