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

Subversion Repositories zipcpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /zipcpu/trunk/sw
    from Rev 120 to Rev 121
    Reverse comparison

Rev 120 → Rev 121

/binutils-2.25.patch
2375,8 → 2375,8
optimize the copying in the simple case without using the
diff -Naur '--exclude=*.swp' binutils-2.25-original/gas/config/tc-zip.c binutils-2.25/gas/config/tc-zip.c
--- binutils-2.25-original/gas/config/tc-zip.c 1969-12-31 19:00:00.000000000 -0500
+++ binutils-2.25/gas/config/tc-zip.c 2016-04-02 22:43:38.648289880 -0400
@@ -0,0 +1,2272 @@
+++ binutils-2.25/gas/config/tc-zip.c 2016-04-06 13:07:19.208882461 -0400
@@ -0,0 +1,2283 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: tc-zip.c
2714,17 → 2714,18
+ printf("%d", insn->i_op); break;
+ }
+ switch(insn->i_cnd) {
+ case ZIPC_LT: printf(".LT"); break;
+ case ZIPC_GE: printf(".GE"); break;
+ case ZIPC_GT: printf(".GT"); break;
+ case ZIPC_NZ: printf(".NE"); break;
+ case ZIPC_Z: printf(".Z"); break;
+ case ZIPC_V: printf(".V"); break;
+ case ZIPC_C: printf(".C"); break;
+ case ZIPC_LT: printf("%-3s", ".LT"); break;
+ case ZIPC_GE: printf("%-3s", ".GE"); break;
+ case ZIPC_GT: printf("%-3s", ".GT"); break;
+ case ZIPC_NZ: printf("%-3s", ".NE"); break;
+ case ZIPC_Z: printf("%-3s", ".Z"); break;
+ case ZIPC_V: printf("%-3s", ".V"); break;
+ case ZIPC_C: printf("%-3s", ".C"); break;
+ case ZIPC_ALWAYS:
+ default:
+ break;
+ }
+ } printf(" %d", (int)insn->i_cnd);
+
+ printf("\n\tAREG = %d\n\tB = ", insn->i_areg);
+ if (insn->i_rp) {
+ if (insn->i_imm != 0)
2896,6 → 2897,16
+ // This could still be a register ... can't tell yet
+ if (sgn)
+ return "ERR: Not expecting a signed label!";
+
+ ptr = zip_skip_white_spaces(ptr+1);
+ if ((*ptr)&&(*ptr == '+')&&(isdigit(ptr[1]))) {
+ ptr++;
+ char *end = (char *)ptr;
+ unsigned long v = strtoul(ptr, &end, 0);
+ // We start with a number
+ insn->i_imm += (int)(v);
+ ptr = (const char *)end;
+ }
+ }
+ }
+
6260,8 → 6271,8
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
diff -Naur '--exclude=*.swp' binutils-2.25-original/opcodes/zip-dis.c binutils-2.25/opcodes/zip-dis.c
--- binutils-2.25-original/opcodes/zip-dis.c 1969-12-31 19:00:00.000000000 -0500
+++ binutils-2.25/opcodes/zip-dis.c 2016-04-02 10:28:35.120580722 -0400
@@ -0,0 +1,224 @@
+++ binutils-2.25/opcodes/zip-dis.c 2016-04-06 13:09:18.900143908 -0400
@@ -0,0 +1,230 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: zip-dis.c
6300,6 → 6311,7
+#include "config.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <strings.h>
+#include <string.h>
+#include <assert.h>
6387,15 → 6399,14
+ sprintf(&line[strlen(line)], "@0x%08x", nxtword);
+ // Treat relative jumps (branches) specially as well
+ } else if ((toupper(listp[i].s_opstr[0]=='B'))
+ &&(toupper(listp[i].s_opstr[2])!='S')
+ &&(toupper(listp[i].s_opstr[2])!='E')
+ &&(toupper(listp[i].s_opstr[2])!='K')
+ &&(strcasecmp(listp[i].s_opstr,"BUSY")!=0)
+ &&(strcasecmp(listp[i].s_opstr,"BREV")!=0)
+ &&(strcasecmp(listp[i].s_opstr,"BRK")!=0)
+ &&(addr != 0)) {
+ // Branch instruction: starts with B and isn't
+ // BREV (bit reverse), BRK (break), or
+ // BUSY
+ unsigned target = addr;
+ int imv = 0;
+
+ target += zip_getbits(ins, listp[i].s_i)+1;
+ sprintf(&line[strlen(line)], "@0x%08x", target);
6406,10 → 6417,16
+ int imv = 0;
+
+ imv = zip_getbits(ins, listp[i].s_i);
+ if ((imv != 0)||(listp[i].s_rb == ZIP_OPUNUSED))
+ if((memop)&&(listp[i].s_rb == ZIP_OPUNUSED))
+ sprintf(&line[strlen(line)],
+ "($%d)", imv);
+ else if((memop)&&(imv != 0))
+ sprintf(&line[strlen(line)],
+ "%d", imv);
+ else if((!memop)&&((imv != 0)||(listp[i].s_rb == ZIP_OPUNUSED)))
+ sprintf(&line[strlen(line)],
+ "$%d%s", imv,
+ ((!memop)&&(listp[i].s_rb!=ZIP_OPUNUSED))?"+":"");
+ (listp[i].s_rb!=ZIP_OPUNUSED)?"+":"");
+ } if (listp[i].s_rb != ZIP_OPUNUSED) {
+ int rb = zip_getbits(ins, listp[i].s_rb);
+ if (memop)
6537,7 → 6554,7
+#endif
diff -Naur '--exclude=*.swp' binutils-2.25-original/opcodes/zip-opc.c binutils-2.25/opcodes/zip-opc.c
--- binutils-2.25-original/opcodes/zip-opc.c 1969-12-31 19:00:00.000000000 -0500
+++ binutils-2.25/opcodes/zip-opc.c 2016-03-28 20:00:16.433315009 -0400
+++ binutils-2.25/opcodes/zip-opc.c 2016-04-05 15:39:32.321631782 -0400
@@ -0,0 +1,501 @@
+////////////////////////////////////////////////////////////////////////////////
+//
6606,8 → 6623,8
+ { "BLT", 0xfffc0000, 0x78880000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BZ", 0xfffc0000, 0x78900000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BNZ", 0xfffc0000, 0x78980000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BGE", 0xfffc0000, 0x78a00000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BGT", 0xfffc0000, 0x78a80000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BGT", 0xfffc0000, 0x78a00000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BGE", 0xfffc0000, 0x78a80000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BC", 0xfffc0000, 0x78b00000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ { "BRV", 0xfffc0000, 0x78b80000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(18,0), ZIP_OPUNUSED },
+ // CLRF ... an XOR w/ self instruction
7042,8 → 7059,8
+
diff -Naur '--exclude=*.swp' binutils-2.25-original/opcodes/zip-opc.h binutils-2.25/opcodes/zip-opc.h
--- binutils-2.25-original/opcodes/zip-opc.h 1969-12-31 19:00:00.000000000 -0500
+++ binutils-2.25/opcodes/zip-opc.h 2016-02-04 21:33:27.161347438 -0500
@@ -0,0 +1,66 @@
+++ binutils-2.25/opcodes/zip-opc.h 2016-04-06 13:03:17.106368687 -0400
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: zip-opc.h
7098,9 → 7115,23
+typedef unsigned int ZIPI; // A Zip CPU instruction
+
+typedef struct {
+ char s_opstr[8];
+ ZIPI s_mask, s_val;
+ int s_result, s_ra, s_rb, s_i, s_cf;
+ char s_opstr[8]; // OPCode name
+ ZIPI s_mask, // Bits that must match 4 this pattern to match
+ s_val; // What those masked bits must be
+ //
+ // The following describe not the value, but the bits where there
+ // respective vaules will be found within the instruction. For example,
+ // an instruction with no immediate will have an s_i value of -1
+ // (ZIP_OPUNUSED), whereas an instruction with an immediate value of -1
+ // might have an s_i value of ZIP_BITFIELD(14,0), or 0x0400. The
+ // opcode itself will tell you what the value is--not this structure
+ // describing the opcode.
+ //
+ int s_result, // Register where the result will be placed
+ s_ra, // A register, often the result
+ s_rb, // B register, source operand (if used)
+ s_i, // Immediate value, added to B if B is used
+ s_cf; // Condition flags.
+} ZOPCODE;
+
+extern const char *zip_regstr[49], *zip_ccstr[8];

powered by: WebSVN 2.1.0

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