Limit moxie sto/ldo offsets to 16 bits
authorAnthony Green <green@moxielogic.com>
Sat, 27 Dec 2014 15:57:04 +0000 (10:57 -0500)
committerAnthony Green <green@moxielogic.com>
Sat, 27 Dec 2014 15:57:51 +0000 (10:57 -0500)
gas/ChangeLog
gas/config/tc-moxie.c
include/opcode/ChangeLog
include/opcode/moxie.h
opcodes/ChangeLog
opcodes/moxie-dis.c
opcodes/moxie-opc.c

index ef7febf9885f432daf493849ca56c1213c1d3a64..b0d30b2aa0011f1574178c1b2ed7c06d2530b5b1 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-27  Anthony Green  <green@moxielogic.com
+
+       * config/tc-moxie.c (md_assemble): ldo/sto instructions now use a
+       16 bit offset instead of 32.
+
 2014-12-25  Yaakov Selkowitz  <yselkowi@redhat.com>
 
        PR gas/17753
index 02a59b7c7089304340b2b129172d22734c81c62d..fdd100c288f8c37123f1cf9765c56669b72190da 100644 (file)
@@ -404,7 +404,7 @@ md_assemble (char *str)
        iword += (a << 4);
       }
       break;
-    case MOXIE_F1_ABi4:
+    case MOXIE_F1_ABi2:
       iword = opcode->opcode << 8;
       while (ISSPACE (*op_end))
        op_end++;
@@ -426,13 +426,13 @@ md_assemble (char *str)
        op_end++;
 
        op_end = parse_exp_save_ilp (op_end, &arg);
-       offset = frag_more (4);
+       offset = frag_more (2);
        fix_new_exp (frag_now,
                     (offset - frag_now->fr_literal),
-                    4,
+                    2,
                     &arg,
                     0,
-                    BFD_RELOC_32);
+                    BFD_RELOC_16);
 
        if (*op_end != '(')
          {
@@ -458,7 +458,7 @@ md_assemble (char *str)
        iword += (a << 4) + b;
       }
       break;
-    case MOXIE_F1_AiB4:
+    case MOXIE_F1_AiB2:
       iword = opcode->opcode << 8;
       while (ISSPACE (*op_end))
        op_end++;
@@ -468,13 +468,13 @@ md_assemble (char *str)
        int a, b;
 
        op_end = parse_exp_save_ilp (op_end, &arg);
-       offset = frag_more (4);
+       offset = frag_more (2);
        fix_new_exp (frag_now,
                     (offset - frag_now->fr_literal),
-                    4,
+                    2,
                     &arg,
                     0,
-                    BFD_RELOC_32);
+                    BFD_RELOC_16);
 
        if (*op_end != '(')
          {
index a2248dc6bd6b2bd771aa1ee3ad7cf4b864ccc3b0..85fe9ac5b2792984d1dd9f1664532c60c3e5e11a 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-27  Anthony Green  <green@moxielogic.com>
+
+       * moxie.h (MOXIE_F1_AiB2, MOXIE_F1_ABi2): Renamed from
+       MOXIE_F1_AiB4 and MOXIE_F1_ABi2.
+
 2014-12-06  Eric Botcazou  <ebotcazou@adacore.com>
 
        * visium.h: New file.
index 6c5a00397189871c1f03d6db0a20ab1a219b89e9..f220e38f0a8341939e1f625ffdaff2ee33808958 100644 (file)
@@ -28,8 +28,8 @@
     Some use B and an indirect A                    (MOXIE_F1_AiB)
     Some use A and an indirect B                    (MOXIE_F1_ABi)
     Some consume a 4 byte immediate value and use X (MOXIE_F1_4A)
-    Some use B and an indirect A plus 4 bytes       (MOXIE_F1_AiB4)
-    Some use A and an indirect B plus 4 bytes       (MOXIE_F1_ABi4)
+    Some use B and an indirect A plus 2 byte offset (MOXIE_F1_AiB2)
+    Some use A and an indirect B plus 2 byte offset (MOXIE_F1_ABi2)
 
   Form 2 instructions also come in different flavors:
 
@@ -50,8 +50,8 @@
 #define MOXIE_F1_AiB  0x106
 #define MOXIE_F1_ABi  0x107
 #define MOXIE_F1_4A   0x108
-#define MOXIE_F1_AiB4 0x109
-#define MOXIE_F1_ABi4 0x10a
+#define MOXIE_F1_AiB2 0x109
+#define MOXIE_F1_ABi2 0x10a
 #define MOXIE_F1_M    0x10b
 
 #define MOXIE_F2_NARG 0x200
index 8de16f67e7f8f7fb3524899bbe6f013cc9c640ec..dd302b2d3fa17216e4ec8fc21e67a49f04f4d92b 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-27  Anthony Green  <green@moxielofic.com
+
+       * moxie-opc.c (moxie_form1_opc_info): sto/ldo are now encoded with
+       16-bit immediat values instead of 32.
+       * moxie-dis.c (print_insn_moxie): Ditto.
+
 2014-12-24  Anthony Green  <green@moxielogic.com>
 
        * moxie-opc: Define mul.x and umul.x instructions.  Remove
index 90e0464a18a6e5f3d5f48911dc44224178538d15..923dda104908dd194837130dbdd2bcadf6fdf3d9 100644 (file)
@@ -140,37 +140,37 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info)
            length = 6;
          }
          break;
-       case MOXIE_F1_AiB4:
+       case MOXIE_F1_AiB2:
          {
            unsigned imm;
-           if ((status = info->read_memory_func (addr+2, buffer, 4, info)))
+           if ((status = info->read_memory_func (addr+2, buffer, 2, info)))
              goto fail;
            if (info->endian == BFD_ENDIAN_BIG)
-             imm = bfd_getb32 (buffer);
+             imm = bfd_getb16 (buffer);
            else
-             imm = bfd_getl32 (buffer);
+             imm = bfd_getl16 (buffer);
            fpr (stream, "%s\t0x%x(%s), %s", opcode->name,
                 imm,
                 reg_names[OP_A(iword)],
                 reg_names[OP_B(iword)]);
-           length = 6;
+           length = 4;
          }
          break;
-       case MOXIE_F1_ABi4:
+       case MOXIE_F1_ABi2:
          {
            unsigned imm;
-           if ((status = info->read_memory_func (addr+2, buffer, 4, info)))
+           if ((status = info->read_memory_func (addr+2, buffer, 2, info)))
              goto fail;
            if (info->endian == BFD_ENDIAN_BIG)
-             imm = bfd_getb32 (buffer);
+             imm = bfd_getb16 (buffer);
            else
-             imm = bfd_getl32 (buffer);
+             imm = bfd_getl16 (buffer);
            fpr (stream, "%s\t%s, 0x%x(%s)",
                 opcode->name,
                 reg_names[OP_A(iword)],
                 imm,
                 reg_names[OP_B(iword)]);
-           length = 6;
+           length = 4;
          }
          break;
         case MOXIE_BAD:
index a858088aa41b1ddbdb0e9cce6ee28be9160a2793..b3603c9c20b1ed53e951a753f74c6b35e99fd101 100644 (file)
@@ -64,8 +64,8 @@ const moxie_opc_info_t moxie_form1_opc_info[128] =
     { 0x09, MOXIE_F1_4A,   "sta.l" },
     { 0x0a, MOXIE_F1_ABi,  "ld.l" },
     { 0x0b, MOXIE_F1_AiB,  "st.l" },
-    { 0x0c, MOXIE_F1_ABi4, "ldo.l" },
-    { 0x0d, MOXIE_F1_AiB4, "sto.l" },
+    { 0x0c, MOXIE_F1_ABi2, "ldo.l" },
+    { 0x0d, MOXIE_F1_AiB2, "sto.l" },
     { 0x0e, MOXIE_F1_AB,   "cmp" },
     { 0x0f, MOXIE_F1_NARG, "nop" },
     { 0x10, MOXIE_F1_AB,   "sex.b" },
@@ -106,10 +106,10 @@ const moxie_opc_info_t moxie_form1_opc_info[128] =
     { 0x33, MOXIE_F1_AB,   "mod" },
     { 0x34, MOXIE_F1_AB,   "umod" },
     { 0x35, MOXIE_F1_NARG, "brk" },
-    { 0x36, MOXIE_F1_ABi4, "ldo.b" },
-    { 0x37, MOXIE_F1_AiB4, "sto.b" },
-    { 0x38, MOXIE_F1_ABi4, "ldo.s" },
-    { 0x39, MOXIE_F1_AiB4, "sto.s" },
+    { 0x36, MOXIE_F1_ABi2, "ldo.b" },
+    { 0x37, MOXIE_F1_AiB2, "sto.b" },
+    { 0x38, MOXIE_F1_ABi2, "ldo.s" },
+    { 0x39, MOXIE_F1_AiB2, "sto.s" },
     { 0x3a, MOXIE_BAD,     "bad" },
     { 0x3b, MOXIE_BAD,     "bad" },
     { 0x3c, MOXIE_BAD,     "bad" },
This page took 0.031535 seconds and 4 git commands to generate.