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

Subversion Repositories zipcpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /zipcpu
    from Rev 191 to Rev 192
    Reverse comparison

Rev 191 → Rev 192

/trunk/sw/Makefile
122,7 → 122,7
#
#
zasm:
$(MAKE) --no-print-directory --directory=$(ZASMD)
$(MAKE) --no-print-directory --directory=$(ZASMD) all
 
zasm-install: zasm
$(MAKE) --no-print-directory --directory=$(ZASMD) install
/trunk/sw/binutils-2.25.patch
2598,8 → 2598,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-09-15 09:31:15.907749200 -0400
@@ -0,0 +1,2610 @@
+++ binutils-2.25/gas/config/tc-zip.c 2016-11-03 13:48:17.213367383 -0400
@@ -0,0 +1,2756 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: tc-zip.c
2656,7 → 2656,6
+#include "elf/zip.h"
+
+// #define ZIP_DEBUG
+#define LONG_MPY
+
+const char comment_chars[] = ";#";
+const char line_comment_chars[] = ";#";
2711,9 → 2710,17
+ // bytes, which are (must be) octets. Therefore, we align any
+ // data structure to every four octets.
+ //
+ // Actually, we can't do this. This will often be called after a
+ // symbol value is set, but of which symbol value must be aligned.
+ // This function pushes the alignment to the next possible valid
+ // alignment. However, if we already have a valid alignment, this
+ // doesn't work.
+ //
+/*
+ frag_align(2, // Desired alignment is 2^this number
+ 0, // Fill character
+ 3); // Maximum number of characters to emit to get alignment
+*/
+}
+
+const pseudo_typeS md_pseudo_table[] =
2749,6 → 2756,7
+
+#define ZIP_CC_SLEEP 0x010
+#define ZIP_CC_GIE 0x020
+#define ZIP_CC_STEP 0x040
+
+#define NOOP_OPCODE 0x76000000
+
2794,123 → 2802,248
+ return r;
+}
+
+const int MACH_VUNKNOWN = 0, MACH_VKNOWN = 1, MACH_VUPPERKNOWN = 2;
+const int use_machine = 1;
+
+static void
+zip_clear_machine(MACHINEREGS *pzipm) {
+ int i;
+
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, CLEAR\n");
+#endif
+ for(i=0; i<ZIP_USER_REGS; i++)
+ pzipm->r[i].m_known = 0;
+ pzipm->r[i].m_known = MACH_VUNKNOWN;
+ for(i=0; i<ZIP_USER_REGS; i++)
+ pzipm->r[i].m_addsy = 0;
+ pzipm->r[i].m_addsy = NULL;
+ for(i=0; i<ZIP_USER_REGS; i++)
+ pzipm->r[i].m_subsy = 0;
+ pzipm->r[i].m_subsy = NULL;
+}
+
+static void
+zip_advance_machine(MACHINEREGS *pzipm, ZIPIS *insn) {
+ int bval = insn->i_imm;
+ int bknown;
+ int bval = insn->i_imm;
+ int bknown;
+ MACHINEVALUE *av;
+
+ if (ZIP_RNONE == insn->i_breg)
+ bknown = 1;
+ else if (insn->i_breg >= ZIP_USER_REGS)
+ bknown = 0;
+ else
+ if (!use_machine) {
+ zip_clear_machine(pzipm);
+ return;
+ }
+
+ //
+ // What remains to be done is to include symbols into the machine
+ // state. For now, we state that anything with a symbol becomes
+ // unknown.
+ //
+ if (insn->i_rp)
+ bknown = MACH_VUNKNOWN;
+ else if (ZIP_RNONE == insn->i_breg)
+ bknown = MACH_VKNOWN;
+ else if (insn->i_breg >= ZIP_CC)
+ bknown = MACH_VUNKNOWN;
+ else if (insn->i_imm == 0)
+ bknown = (pzipm->r[insn->i_breg].m_known);
+ else // If we have an immediate plus a value, can't know UPPER anymore
+ bknown = (pzipm->r[insn->i_breg].m_known == MACH_VKNOWN)
+ ? MACH_VKNOWN : MACH_VUNKNOWN;
+
+ if (insn->i_breg < ZIP_USER_REGS)
+ bval += pzipm->r[insn->i_breg].m_value;
+
+ if (insn->i_areg >= ZIP_USER_REGS)
+ if (insn->i_areg >= ZIP_USER_REGS) {
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, A-REG[%02x] out of bounds\n", insn->i_areg);
+#endif
+ return; // Nothing to do -- no change to machine
+ } else if ((insn->i_areg == ZIP_PC)&&(insn->i_op != ZIPO_STO)) {
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, CLEAR ON JUMP\n");
+#endif
+ zip_clear_machine(pzipm);
+ return;
+ } else if ((insn->i_areg >= ZIP_CC)&&(insn->i_op == ZIPO_AND)) {
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, CLEAR ON ANDing to CC\n");
+#endif
+ zip_clear_machine(pzipm);
+ } else if ((insn->i_areg >= ZIP_CC)&&(
+ (insn->i_op == ZIPO_LDI)
+ ||(insn->i_op == ZIPO_LOD)
+ ||(insn->i_op == ZIPO_CLR)
+ ||(insn->i_op == ZIPO_CLRF)
+ ||(insn->i_op == ZIPO_LDILO))) {
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, CLEAR ON setting CC\n");
+#endif
+ zip_clear_machine(pzipm);
+ return;
+ } else if (insn->i_areg >= ZIP_CC) {
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, Not tracking CC or PC changes\n");
+#endif
+ pzipm->r[insn->i_areg].m_known = MACH_VUNKNOWN;
+ return;
+ }
+
+ av = &pzipm->r[insn->i_areg];
+
+ if (ZIPC_ALWAYS != insn->i_cnd) {
+ if ((ZIPO_LDILO == insn->i_code)
+ &&((pzipm->r[insn->i_areg].m_known == 1)
+ ||(pzipm->r[insn->i_areg].m_known == 2)))
+ pzipm->r[insn->i_areg].m_known = 2;
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, CONDITIONAL\n");
+#endif
+ if ((ZIPO_LDILO == insn->i_op)
+ &&((av->m_known == MACH_VKNOWN)
+ ||(av->m_known == MACH_VUPPERKNOWN)))
+ av->m_known = MACH_VUPPERKNOWN;
+ else if ((ZIPO_LDI == insn->i_op)||(ZIPO_LDIn == insn->i_op))
+ ; // We'll catch this in a moment
+ else
+ pzipm->r[insn->i_areg].m_known = 0;
+ } else if ((insn->i_rp)&&(insn->i_code != ZIPO_LDI)
+ &&(insn->i_code != ZIPO_MOV)) {
+ av->m_known = MACH_VUNKNOWN;
+ } else if ((insn->i_rp)&&(insn->i_op != ZIPO_LDI)
+ &&(insn->i_op != ZIPO_MOV)) {
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, NOT AN LDI/MOV\n");
+#endif
+ if ((ZIPO_TST != insn->i_op)&&(ZIPO_CMP != insn->i_op))
+ pzipm->r[insn->i_areg].m_known = 0;
+ } switch(insn->i_code) {
+ av->m_known = MACH_VUNKNOWN;
+ } switch(insn->i_op) {
+ case ZIPO_SUB:
+ pzipm->r[insn->i_areg].m_known = (pzipm->r[insn->i_areg].m_known==1)?1:0;
+ pzipm->r[insn->i_areg].m_value -= bval;
+ if (bknown != 1)
+ pzipm->r[insn->i_areg].m_known = 0;
+ av->m_known = (av->m_known==MACH_VKNOWN)
+ ? MACH_VKNOWN:MACH_VUNKNOWN;
+ av->m_value -= bval;
+ if (bknown != MACH_VKNOWN)
+ av->m_known = MACH_VUNKNOWN;
+ break;
+ case ZIPO_AND:
+ pzipm->r[insn->i_areg].m_value &= bval;
+ if ((bknown == 2)&&(insn->i_imm == 0)) {
+ if (pzipm->r[insn->i_areg].m_known == 1)
+ pzipm->r[insn->i_areg].m_known = 2;
+ else if (pzipm->r[insn->i_areg].m_known != 2)
+ pzipm->r[insn->i_areg].m_known = 0;
+ } else if (bknown != 1)
+ pzipm->r[insn->i_areg].m_known = 0;
+ if ((bknown == MACH_VUPPERKNOWN)&&(bval == 0)) {
+ if (av->m_known == MACH_VKNOWN)
+ av->m_known = MACH_VUPPERKNOWN;
+ else if (av->m_known != MACH_VUPPERKNOWN)
+ av->m_known = MACH_VUNKNOWN;
+ } else if (bknown != MACH_VKNOWN)
+ av->m_known = MACH_VUNKNOWN;
+ break;
+ case ZIPO_ADD:
+ pzipm->r[insn->i_areg].m_known = (pzipm->r[insn->i_areg].m_known==1)?1:0;
+ pzipm->r[insn->i_areg].m_value += bval;
+ if (bknown != 1)
+ pzipm->r[insn->i_areg].m_known = 0;
+ av->m_value += bval;
+ if (bknown != MACH_VKNOWN)
+ av->m_known = MACH_VUNKNOWN;
+ break;
+ case ZIPO_OR:
+ pzipm->r[insn->i_areg].m_value |= bval;
+ if ((bknown == 2)&&(insn->i_imm == 0)) {
+ if (pzipm->r[insn->i_areg].m_known == 1)
+ pzipm->r[insn->i_areg].m_known = 2;
+ else if (pzipm->r[insn->i_areg].m_known != 2)
+ pzipm->r[insn->i_areg].m_known = 0;
+ } else if (bknown != 1)
+ pzipm->r[insn->i_areg].m_known = 0;
+ av->m_value |= bval;
+ if (bknown == MACH_VUPPERKNOWN) {
+ if (av->m_known != MACH_VUNKNOWN)
+ av->m_known = MACH_VUPPERKNOWN;
+ } else if (bknown != MACH_VKNOWN)
+ av->m_known = MACH_VUNKNOWN;
+ break;
+ case ZIPO_XOR:
+ pzipm->r[insn->i_areg].m_value ^= bval;
+ if ((bknown == 2)&&(insn->i_imm == 0)) {
+ if (pzipm->r[insn->i_areg].m_known == 1)
+ pzipm->r[insn->i_areg].m_known = 2;
+ else if (pzipm->r[insn->i_areg].m_known != 2)
+ pzipm->r[insn->i_areg].m_known = 0;
+ } else if (bknown != 1)
+ pzipm->r[insn->i_areg].m_known = 0;
+ av->m_value ^= bval;
+ if (bknown == MACH_VUPPERKNOWN) {
+ if (av->m_known != MACH_VUNKNOWN)
+ av->m_known = MACH_VUPPERKNOWN;
+ } else if (bknown != MACH_VKNOWN)
+ av->m_known = MACH_VUNKNOWN;
+ break;
+ case ZIPO_LDI: case ZIPO_LDIn:
+ // Although the h/w instruction has no conditions, our
+ // decoding may have conditions until we finish
+ // working out what the actual result is. Hence, we
+ // need to be aware of any conditions from above.
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, LDI -> %02x\n", insn->i_areg);
+#endif
+ av->m_value = bval;
+ if (insn->i_rp)
+ pzipm->r[insn->i_areg].m_known = 0;
+ else {
+ pzipm->r[insn->i_areg].m_known = 1;
+ pzipm->r[insn->i_areg].m_value = insn->i_imm;
+ av->m_known = MACH_VUNKNOWN;
+ else if (insn->i_cnd != ZIPC_ALWAYS) {
+ // if ((bknown)&&(bvalue == insn->i_imm))
+ // pzipm->r[insn->i_areg].m_known = MACH_VKNOWN;
+ } else {
+ av->m_known = 1;
+ } break;
+ case ZIPO_LDILO:
+ pzipm->r[insn->i_areg].m_value &= ~0x0ffff;
+ pzipm->r[insn->i_areg].m_value |= insn->i_imm &0x0ffff;
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, LDILO -> %02x\n", insn->i_areg);
+#endif
+ av->m_value &= ~0x0ffff;
+ av->m_value |= bval &0x0ffff;
+ if ((av->m_known == MACH_VUPPERKNOWN)
+ &&(bknown == MACH_VKNOWN)
+ &&(ZIPC_ALWAYS == insn->i_cnd))
+ av->m_known = MACH_VKNOWN;
+ break;
+ case ZIPO_BREV:
+ pzipm->r[insn->i_areg].m_value = zip_brev(bval);
+ pzipm->r[insn->i_areg].m_value = (bknown == 1);
+ av->m_value = zip_brev(bval);
+ if (ZIPC_ALWAYS == insn->i_cnd)
+ av->m_known = (bknown == MACH_VKNOWN)?MACH_VKNOWN:MACH_VUNKNOWN;
+ else if ((bknown == MACH_VKNOWN)
+ &&(av->m_known != MACH_VUNKNOWN)
+ &&((((zip_brev(bval)^av->m_value)&0x0ffff)==0)))
+ av->m_known = MACH_VUPPERKNOWN;
+ break;
+ case ZIPO_MOV:
+ pzipm->r[insn->i_areg].m_known = ((insn->i_imm == 0)||(pzipm->r[insn->i_breg].m_known==1))?1:0;
+ pzipm->r[insn->i_areg].m_value = bval;
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, MOV -> %02x\n", insn->i_areg);
+#endif
+ av->m_value = bval;
+ if (ZIPC_ALWAYS == insn->i_cnd)
+ av->m_known = bknown;
+ else if (((ZIPC_ALWAYS == insn->i_cnd)
+ &&(av->m_known != MACH_VUNKNOWN)
+ &&(bknown != MACH_VUNKNOWN))
+ &&(((bval^av->m_value)&0xffff0000)==0))
+ av->m_known = MACH_VUPPERKNOWN;
+ else
+ av->m_known = MACH_VUNKNOWN;
+ av->m_value = bval;
+ break;
+ case ZIPO_CLR: case ZIPO_CLRF:
+ pzipm->r[insn->i_areg].m_known = 1;
+ pzipm->r[insn->i_areg].m_value = 0;
+ if (insn->i_cnd == ZIPC_ALWAYS)
+ av->m_known = MACH_VKNOWN;
+ else if ((av->m_value & 0xffff0000)==0) {
+ if ((av->m_known != MACH_VUNKNOWN)
+ &&(((av->m_value ^ bval)&0xffff0000)==0))
+ av->m_known = MACH_VUPPERKNOWN;
+ else
+ av->m_known = MACH_VUNKNOWN;
+ } av->m_value = 0;
+ break;
+ case ZIPO_STO: // Doesn't change any registers
+ case ZIPO_NOOP: case ZIPO_BREAK: case ZIPO_LOCK:
+ case ZIPO_CMP: case ZIPO_TST:
+ // These don't change any registers
+ break;
+ case ZIPO_LOD: // Result is always unknown
+ default:
+ pzipm->r[insn->i_areg].m_known = 0;
+ // zip_clear_machine(pzipm);
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MACHINE, DEFAULT, %02x -> unknown\n", insn->i_areg);
+#endif
+ av->m_known = MACH_VUNKNOWN;
+ break;
+ }
+
+ pzipm->r[ZIP_CC].m_known = MACH_VUNKNOWN;
+ pzipm->r[ZIP_PC].m_known = MACH_VUNKNOWN;
+}
+
+#ifdef ZIP_DEBUG
+static void
+zip_debug_machine(MACHINEREGS *pzipm) {
+ int i;
+ for(i=0; i<ZIP_USER_REGS; i++) {
+ if (pzipm->r[i].m_known == MACH_VKNOWN)
+ fprintf(stderr, "MACH-KNOW[Y][%2x] = %08x\n",
+ i, pzipm->r[i].m_value);
+ else if (pzipm->r[i].m_known == MACH_VUPPERKNOWN)
+ fprintf(stderr, "MACH-KNOW[U][%2x] = %04x\n",
+ i, (pzipm->r[i].m_value>>16)&0x0ffff);
+ }
+}
+#endif
+
+
+/*
+ * Option processing
+ *
3045,42 → 3178,37
+ case ZIPO_LSL: fprintf(stderr, "%7s", "LSL"); break;
+ case ZIPO_ASR: fprintf(stderr, "%7s", "ASR"); break;
+ case ZIPO_LDI: fprintf(stderr, "%7s", "LDI"); break;
+#ifdef LONG_MPY
+ case ZIPO_MPYUHI:fprintf(stderr, "%7s", "MPYUHI"); break;
+ case ZIPO_MPYSHI:fprintf(stderr, "%7s", "MPYSHI"); break;
+#else // LONG_MPY
+ case ZIPO_LDIHI: fprintf(stderr, "%7s", "LDIHI"); break;
+ case ZIPO_MPYU: fprintf(stderr, "%7s", "MPYU"); break;
+ case ZIPO_MPYS: fprintf(stderr, "%7s", "MPYS"); break;
+#endif
+ case ZIPO_LDILO: fprintf(stderr, "%7s", "LDILO"); break;
+ case ZIPO_BREV: fprintf(stderr, "%7s", "BREV"); break;
+ case ZIPO_POPC: fprintf(stderr, "%7s", "POPC"); break;
+ case ZIPO_ROL: fprintf(stderr, "%7s", "ROL"); break;
+ case ZIPO_MOV: fprintf(stderr, "%7s", "MOV"); break;
+ case ZIPO_CMP: fprintf(stderr, "%7s", "CMP"); break;
+ case ZIPO_TST: fprintf(stderr, "%7s", "TST"); break;
+ case ZIPO_LOD: fprintf(stderr, "%7s", "LOD"); break;
+ case ZIPO_STO: fprintf(stderr, "%7s", "STO"); break;
+ case ZIPO_DIVU: fprintf(stderr, "%7s", "DIVU"); break;
+ case ZIPO_DIVS: fprintf(stderr, "%7s", "DIVS"); break;
+ case ZIPO_BREV: fprintf(stderr, "%7s", "BREV"); break;
+ case ZIPO_POPC: fprintf(stderr, "%7s", "POPC"); break;
+ case ZIPO_ROL: fprintf(stderr, "%7s", "ROL"); break;
+ case ZIPO_MOV: fprintf(stderr, "%7s", "MOV"); break;
+ case ZIPO_CMP: fprintf(stderr, "%7s", "CMP"); break;
+ case ZIPO_TST: fprintf(stderr, "%7s", "TST"); break;
+ case ZIPO_LOD: fprintf(stderr, "%7s", "LOD"); break;
+ case ZIPO_STO: fprintf(stderr, "%7s", "STO"); break;
+ case ZIPO_DIVU: fprintf(stderr, "%7s", "DIVU"); break;
+ case ZIPO_DIVS: fprintf(stderr, "%7s", "DIVS"); break;
+ case ZIPO_FPADD: fprintf(stderr, "%7s", "FPADD"); break;
+ case ZIPO_FPSUB: fprintf(stderr, "%7s", "FPSUB"); break;
+ //
+ case ZIPO_NOOP: fprintf(stderr, "%7s", "NOOP"); break;
+ case ZIPO_NOOP: fprintf(stderr, "%7s", "NOOP"); break;
+ case ZIPO_BREAK: fprintf(stderr, "%7s", "BREAK"); break;
+ case ZIPO_LOCK: fprintf(stderr, "%7s", "LOCK"); break;
+ case ZIPO_TRAP: fprintf(stderr, "%7s", "TRAP"); break;
+ case ZIPO_CLR: fprintf(stderr, "%7s", "CLR"); break;
+ case ZIPO_CLRF: fprintf(stderr, "%7s", "CLRF"); break;
+ case ZIPO_HALT: fprintf(stderr, "%7s", "HALT"); break;
+ case ZIPO_WAIT: fprintf(stderr, "%7s", "WAIT"); break;
+ case ZIPO_RTU: fprintf(stderr, "%7s", "RTU"); break;
+ case ZIPO_BRA: fprintf(stderr, "%7s", "BRA"); break;
+ case ZIPO_BUSY: fprintf(stderr, "%7s", "BUSY"); break;
+ case ZIPO_JMP: fprintf(stderr, "%7s", "JMP"); break;
+ case ZIPO_NOT: fprintf(stderr, "%7s", "NOT"); break;
+ case ZIPO_NEG: fprintf(stderr, "%7s", "NEG"); break;
+ case ZIPO_LOCK: fprintf(stderr, "%7s", "LOCK"); break;
+ case ZIPO_TRAP: fprintf(stderr, "%7s", "TRAP"); break;
+ case ZIPO_CLR: fprintf(stderr, "%7s", "CLR"); break;
+ case ZIPO_CLRF: fprintf(stderr, "%7s", "CLRF"); break;
+ case ZIPO_HALT: fprintf(stderr, "%7s", "HALT"); break;
+ case ZIPO_WAIT: fprintf(stderr, "%7s", "WAIT"); break;
+ case ZIPO_STEP: fprintf(stderr, "%7s", "STEP"); break;
+ case ZIPO_RTU: fprintf(stderr, "%7s", "RTU"); break;
+ case ZIPO_BRA: fprintf(stderr, "%7s", "BRA"); break;
+ case ZIPO_BUSY: fprintf(stderr, "%7s", "BUSY"); break;
+ case ZIPO_JMP: fprintf(stderr, "%7s", "JMP"); break;
+ case ZIPO_NOT: fprintf(stderr, "%7s", "NOT"); break;
+ case ZIPO_NEG: fprintf(stderr, "%7s", "NEG"); break;
+ default:
+ fprintf(stderr, "%d", insn->i_op); break;
+ }
3109,7 → 3237,7
+ fprintf(stderr, "+ R%d", insn->i_breg);
+ fprintf(stderr, "\n");
+ if (insn->i_rp)
+ fprintf(stderr, "\t@%ld\n", insn->i_rp->r_fr_offset);
+ fprintf(stderr, "\t@%ld (offset w/in instruction frag)\n", insn->i_rp->r_fr_offset);
+ fprintf(stderr, "\tINSN:CODE %08x", insn->i_code);
+ {
+ int i;
3139,10 → 3267,16
+ ustr = str+1;
+ userreg = 0x10;
+ }
+
+
+ /*
+ if (strcasecmp(ustr, "GBL")==0) {
+ *regid = userreg + 11;
+ ustr += 3;
+ } else
+ */
+ if (strcasecmp(ustr, "LR")==0) {
+ *regid = userreg + 0;
+ ustr += 2;
+ } else if (strcasecmp(ustr, "FP")==0) {
+ *regid = userreg + 12;
+ ustr += 2;
3584,16 → 3718,9
+ } else if (strcasecmp(opstr, "ASR")==0) {
+ insn->i_op = ZIPO_ASR;
+ insn_form = TWO_OP;
+#ifdef LONG_MPY
+ } else if (strcasecmp(opstr, "MPY")==0) {
+ insn_form = TWO_OP;
+ insn->i_op = ZIPO_MPY;
+#else
+ } else if((strcasecmp(opstr, "LDIHI")==0)
+ ||(strcasecmp(opstr, "LHI")==0)) {
+ insn_form = TWO_OP;
+ insn->i_op = ZIPO_LDIHI;
+#endif
+ } else if((strcasecmp(opstr, "LDILO")==0)
+ ||(strcasecmp(opstr, "LLO")==0)) {
+ insn->i_op = ZIPO_LDILO;
3601,7 → 3728,6
+ // } else if (strcasecmp(opstr, "MPY")==0) {
+ // insn->i_op = ZIPO_MPY;
+ // insn_form = TWO_OP
+#ifdef LONG_MPY
+ } else if (strcasecmp(opstr, "MPYUHI")==0) { // MPUHI
+ insn->i_op = ZIPO_MPYUHI;
+ insn_form = TWO_OP;
3608,14 → 3734,6
+ } else if (strcasecmp(opstr, "MPYSHI")==0) { // MPSHI
+ insn->i_op = ZIPO_MPYSHI;
+ insn_form = TWO_OP;
+#else
+ } else if (strcasecmp(opstr, "MPYU")==0) { // MPUHI
+ insn->i_op = ZIPO_MPYU;
+ insn_form = TWO_OP;
+ } else if (strcasecmp(opstr, "MPYS")==0) { // MPSHI
+ insn->i_op = ZIPO_MPYS;
+ insn_form = TWO_OP;
+#endif
+ } else if (strcasecmp(opstr, "BREV")==0) {
+ insn->i_op = ZIPO_BREV;
+ insn_form = TWO_OP;
3734,6 → 3852,11
+ insn->i_imm = ZIP_CC_SLEEP | ZIP_CC_GIE;
+ insn->i_areg= ZIP_CC;
+ insn_form = NO_OP;
+ } else if (strcasecmp(opstr, "STEP")==0) {
+ insn->i_op = ZIPO_STEP;
+ insn->i_imm = ZIP_CC_STEP | ZIP_CC_GIE;
+ insn->i_areg= ZIP_CC;
+ insn_form = NO_OP;
+ } else if ((strcasecmp(opstr, "RTU")==0)
+ ||(strcasecmp(opstr, "IRET")==0)) {
+ insn->i_op = ZIPO_RTU;
3750,6 → 3873,13
+ insn->i_op = ZIPO_JMP;
+ insn->i_areg = ZIP_PC;
+ insn_form = OP_B;
+ } else if ((strcasecmp(opstr, "RETN")==0)
+ ||(strcasecmp(opstr, "RTN")==0)) {
+ insn->i_op = ZIPO_JMP;
+ insn->i_areg = ZIP_PC;
+ insn->i_breg = ZIP_R0;
+ insn->i_imm = 0;
+ insn_form = NO_OP;
+ } else if (strcasecmp(opstr, "NOT")==0) {
+ insn->i_op = ZIPO_NOT;
+ insn->i_imm = -1;
3919,13 → 4049,8
+ case ZIPO_DIVU: case ZIPO_DIVS:
+ case ZIPO_LDI: case ZIPO_LDIn:
+ case ZIPO_BREV: case ZIPO_POPC: case ZIPO_ROL:
+#ifdef LONG_MPY
+ case ZIPO_MPYUHI: case ZIPO_MPYSHI:
+ case ZIPO_MPY:
+#else
+ case ZIPO_MPYU: case ZIPO_MPYS:
+ case ZIPO_LDIHI:
+#endif
+ break;
+ case ZIPO_MOV:
+ if (insn->i_breg == ZIP_RNONE)
3994,7 → 4119,7
+ insn->i_breg = ZIP_RNONE;
+ insn->i_imm = 0;
+ break;
+ case ZIPO_HALT: case ZIPO_WAIT: case ZIPO_RTU:
+ case ZIPO_HALT: case ZIPO_WAIT: case ZIPO_RTU: case ZIPO_STEP:
+ insn->i_op = ZIPO_OR;
+ break;
+ case ZIPO_BUSY:
4045,6 → 4170,7
+ | ((CND&0x07)<<19)|((B&0x0f)<<14)|(IMM & 0x01fff))
+#define IMMOP(OP,CND,IMM,A) (((OP&0x01f)<<22)|((A&0x0f)<<27) \
+ | ((CND&0x07)<<19)|(IMM & 0x03ffff))
+#define LDIOP(IMM,A) ((ZIPO_LDI<<22)|((A&0x0f)<<27)|(IMM & 0x07fffff))
+
+
+/*
4134,9 → 4260,6
+ break;
+ case ZIPO_LDI: case ZIPO_LDIn:
+ case ZIPO_LDILO:
+#ifndef LONG_MPY
+ case ZIPO_LDIHI: // BREVx would rm LDIHI
+#endif
+ // LDIxx instructions have only immediates. If the
+ // immediate doesn't fit in 5 bits, this won't work.
+ imma = zip_non_vliw_immediate(a);
4167,9 → 4290,6
+ break;
+ case ZIPO_LDI: case ZIPO_LDIn:
+ case ZIPO_LDILO:
+#ifndef LONG_MPY
+ case ZIPO_LDIHI:
+#endif
+ // LDIxx instructions have only immediates. If the
+ // immediate doesn't fit in 5 bits, this won't work.
+ immb = zip_non_vliw_immediate(b);
4434,7 → 4554,6
+ &&(pzipm->r[insn->i_areg].m_known)
+ &&(0==((immv^pzipm->r[insn->i_areg].m_value)
+ & 0x0ffff0000))) {
+fprintf(stderr, "Creating an LDILO\n");
+ // Replace LDI with LDILO
+ insn->i_naux = 0;
+ insn->i_code=IMMOP(ZIPO_LDILO, insn->i_cnd,
4444,9 → 4563,9
+ if (ZIPC_ALWAYS == insn->i_cnd) {
+ // Henceforth, we only know the bottom 16bits
+ // of this register
+ pzipm->r[insn->i_areg].m_known = 2;
+ pzipm->r[insn->i_areg].m_known = MACH_VUPPERKNOWN;
+ } else
+ pzipm->r[insn->i_areg].m_known = 1;
+ pzipm->r[insn->i_areg].m_known = MACH_VKNOWN;
+ } else {
+ //
+ // If the symbol isn't defined, then any immv value
4454,11 → 4573,17
+ //
+ int known_bypass = 0, i;
+
+ if ((pzipm)&&((!insn->i_rp)||(sym_known))) {
+ if ((pzipm)&&(
+ ((!insn->i_rp)
+ &&(!fits_within(4,immv)))
+ ||((insn->i_rp)&&(sym_known)))) {
+ for(i=0; i<14; i++) {
+ int offset = immv-pzipm->r[i].m_value;
+ if ((pzipm->r[i].m_known==1)
+ &&(fits_within(13, offset))) {
+ if ((pzipm->r[i].m_known==MACH_VKNOWN)
+ &&(fits_within(13, offset))
+ &&((insn->i_rp)
+ ||(!fits_within(4, immv)))
+ ) {
+ // Pick the closest value ... if
+ // there's a choice
+ if ((!known_bypass)
4598,6 → 4723,7
+ // offsets.
+ //
+ if (insn->i_rp) {
+ // MOV label(Rb),Ra
+ insn->i_rp->r_pcrel = (insn->i_breg == ZIP_PC);
+ immv += symv;
+ if (insn->i_breg == ZIP_PC) {
4623,6 → 4749,20
+ // address?
+ insn->i_rp->r_type = BFD_RELOC_ZIP_MOV_OFFSET;
+ }
+ } else if ((pzipm)&&(insn->i_breg<ZIP_CC)&&(insn->i_areg<ZIP_CC)
+ &&(ZIPC_ALWAYS == insn->i_cnd)
+ &&(pzipm->r[insn->i_breg].m_known==MACH_VKNOWN)
+ &&(fits_within(4,pzipm->r[insn->i_breg].m_value
+ +immv))) {
+ // MOV Rb,Ra
+ // turn this into an LDI instruction, rather than a
+ // move instruction
+ insn->i_op = ZIPO_LDI;
+ insn->i_imm += pzipm->r[insn->i_breg].m_value;
+ insn->i_breg = ZIP_RNONE;
+
+ insn->i_code = LDIOP(insn->i_imm, insn->i_areg);
+ insn->i_naux = 0;
+ }
+ /*
+ // Handle offsets greater than 13 bits --- up to 32 bits
4643,14 → 4783,17
+ return;
+ }
+ */
+ insn->i_code = SMPLMOV(insn->i_cnd, immv, insn->i_breg,
+ insn->i_areg);
+ //
+ // Now for the extra two register bits only present in move
+ // instructions
+ //
+ insn->i_code |= (insn->i_areg&0x10)?0x40000:0;
+ insn->i_code |= (insn->i_breg&0x10)?0x02000:0;
+
+ if (insn->i_op == ZIPO_MOV) { // If we haven't changed insns,
+ insn->i_code = SMPLMOV(insn->i_cnd, immv, insn->i_breg,
+ insn->i_areg);
+ //
+ // Now for the extra two register bits only present
+ // in move instructions
+ //
+ insn->i_code |= (insn->i_areg&0x10)?0x40000:0;
+ insn->i_code |= (insn->i_breg&0x10)?0x02000:0;
+ }
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "MOV Instruction assembled into %08x\n", insn->i_code);
+#endif
4748,6 → 4891,9
+
+ zip_assemble_insn_words(frag_now, now_seg, insn, 0, 0, &zipm);
+ zip_advance_machine(&zipm, insn);
+#ifdef ZIP_DEBUG
+ zip_debug_machine(&zipm);
+#endif
+
+ // Then, if the instruction is valid we ...
+ // for branches ...
5212,8 → 5358,8
+}
diff -Naur '--exclude=*.swp' binutils-2.25-original/gas/config/tc-zip.h binutils-2.25/gas/config/tc-zip.h
--- binutils-2.25-original/gas/config/tc-zip.h 1969-12-31 19:00:00.000000000 -0500
+++ binutils-2.25/gas/config/tc-zip.h 2016-09-15 08:40:22.608881028 -0400
@@ -0,0 +1,213 @@
+++ binutils-2.25/gas/config/tc-zip.h 2016-11-03 13:50:09.140655412 -0400
@@ -0,0 +1,218 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: tc-zip.h
5320,10 → 5466,15
+
+/* Accept numbers with a suffix, e.g. 0ffffh, 1010b. --- from TI-c4x code */
+// #define NUMBERS_WITH_SUFFIX 1
+
+
+/* md_cons_align ... You may define this macro to do any special alignment
+ * before a data allocation pseudo-op.
+ *
+ * However ... for the ZipCPU forcing alignment (which has already been forced)
+ * breaks things.
+ */
+#define md_cons_align(N) zip_cons_align(N)
+// #define md_cons_align(N) zip_cons_align(N)
+
+/* TI implements the tic4x_do_align --- do we need it? */
+
5417,7 → 5568,7
+ ZIPO_BRA, ZIPO_BZ, ZIPO_BNZ, ZIPO_BGE,
+ ZIPO_BGT, ZIPO_BLT, ZIPO_BC, ZIPO_BV,
+ ZIPO_HALT, ZIPO_WAIT, ZIPO_RTU, ZIPO_BUSY,
+ ZIPO_JMP, ZIPO_NOT, ZIPO_NEG
+ ZIPO_STEP, ZIPO_JMP, ZIPO_NOT, ZIPO_NEG
+} ZIP_OPCODE;
+
+// If LONG_MPY is defined (or not) we then use these opcodes
5449,7 → 5600,7
*-*-freebsd* | *-*-kfreebsd*-gnu) fmt=elf em=freebsd ;;
diff -Naur '--exclude=*.swp' binutils-2.25-original/gas/frags.c binutils-2.25/gas/frags.c
--- binutils-2.25-original/gas/frags.c 2014-10-14 03:32:03.000000000 -0400
+++ binutils-2.25/gas/frags.c 2016-02-20 18:52:07.305435296 -0500
+++ binutils-2.25/gas/frags.c 2016-11-03 13:36:59.201628196 -0400
@@ -125,6 +125,7 @@
/* Not enough room in this frag. Close it and start a new one.
This must be done in a loop because the created frag may not
5557,7 → 5708,7
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xtensa-relax.Tpo $(DEPDIR)/xtensa-relax.Po
diff -Naur '--exclude=*.swp' binutils-2.25-original/gas/read.c binutils-2.25/gas/read.c
--- binutils-2.25-original/gas/read.c 2014-10-14 03:32:03.000000000 -0400
+++ binutils-2.25/gas/read.c 2016-05-06 10:32:11.758653388 -0400
+++ binutils-2.25/gas/read.c 2016-11-03 13:36:47.725698610 -0400
@@ -684,7 +684,8 @@
/* We do this every time rather than just in s_bundle_align_mode
so that we catch any affected section without needing hooks all
6186,7 → 6337,7
+0+05[ ]+[a-zA-Z0-9_]+[ ]+foo6
diff -Naur '--exclude=*.swp' binutils-2.25-original/gas/write.c binutils-2.25/gas/write.c
--- binutils-2.25-original/gas/write.c 2014-11-04 04:54:41.000000000 -0500
+++ binutils-2.25/gas/write.c 2016-05-12 15:52:51.386003347 -0400
+++ binutils-2.25/gas/write.c 2016-11-03 13:37:48.881323382 -0400
@@ -2638,7 +2638,7 @@
case rs_org:
/trunk/sw/gcc-zippatch.patch
138,7 → 138,7
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h gcc-5.3.0-zip/gcc/config/aarch64/aarch64-linux.h
--- gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h 2016-10-19 11:02:11.471843057 -0400
--- gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h 2016-11-03 13:52:45.187664099 -0400
+++ gcc-5.3.0-zip/gcc/config/aarch64/aarch64-linux.h 2015-07-24 12:00:26.000000000 -0400
@@ -21,7 +21,7 @@
#ifndef GCC_AARCH64_LINUX_H
150,7 → 150,7
#undef ASAN_CC1_SPEC
#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/alpha/linux-elf.h gcc-5.3.0-zip/gcc/config/alpha/linux-elf.h
--- gcc-5.3.0-original/gcc/config/alpha/linux-elf.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/alpha/linux-elf.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/alpha/linux-elf.h 2015-01-05 07:33:28.000000000 -0500
@@ -23,8 +23,8 @@
#define EXTRA_SPECS \
164,7 → 164,7
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
#elif DEFAULT_LIBC == LIBC_GLIBC
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/arm/linux-eabi.h gcc-5.3.0-zip/gcc/config/arm/linux-eabi.h
--- gcc-5.3.0-original/gcc/config/arm/linux-eabi.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/arm/linux-eabi.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/arm/linux-eabi.h 2015-01-05 07:33:28.000000000 -0500
@@ -68,8 +68,8 @@
GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
178,7 → 178,7
#define GLIBC_DYNAMIC_LINKER \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/arm/linux-elf.h gcc-5.3.0-zip/gcc/config/arm/linux-elf.h
--- gcc-5.3.0-original/gcc/config/arm/linux-elf.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/arm/linux-elf.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/arm/linux-elf.h 2015-06-23 05:26:54.000000000 -0400
@@ -62,7 +62,7 @@
190,7 → 190,7
#define LINUX_TARGET_LINK_SPEC "%{h*} \
%{static:-Bstatic} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/bfin/linux.h gcc-5.3.0-zip/gcc/config/bfin/linux.h
--- gcc-5.3.0-original/gcc/config/bfin/linux.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/bfin/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/bfin/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -45,7 +45,7 @@
%{shared:-G -Bdynamic} \
202,7 → 202,7
#undef TARGET_SUPPORTS_SYNC_CALLS
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/cris/linux.h gcc-5.3.0-zip/gcc/config/cris/linux.h
--- gcc-5.3.0-original/gcc/config/cris/linux.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/cris/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/cris/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -102,7 +102,7 @@
#undef CRIS_DEFAULT_CPU_VERSION
214,7 → 214,7
#undef CRIS_LINK_SUBTARGET_SPEC
#define CRIS_LINK_SUBTARGET_SPEC \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/freebsd-spec.h gcc-5.3.0-zip/gcc/config/freebsd-spec.h
--- gcc-5.3.0-original/gcc/config/freebsd-spec.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/freebsd-spec.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/freebsd-spec.h 2015-06-25 13:53:14.000000000 -0400
@@ -129,9 +129,9 @@
#endif
229,7 → 229,7
/* NOTE: The freebsd-spec.h header is included also for various
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/frv/linux.h gcc-5.3.0-zip/gcc/config/frv/linux.h
--- gcc-5.3.0-original/gcc/config/frv/linux.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/frv/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/frv/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -34,7 +34,7 @@
#define ENDFILE_SPEC \
241,7 → 241,7
#undef LINK_SPEC
#define LINK_SPEC "\
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/gnu.h gcc-5.3.0-zip/gcc/config/i386/gnu.h
--- gcc-5.3.0-original/gcc/config/i386/gnu.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/i386/gnu.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -22,7 +22,7 @@
#define GNU_USER_LINK_EMULATION "elf_i386"
253,7 → 253,7
#undef STARTFILE_SPEC
#if defined HAVE_LD_PIE
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu64.h
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu64.h 2015-01-05 07:33:28.000000000 -0500
@@ -22,6 +22,6 @@
#define GNU_USER_LINK_EMULATION64 "elf_x86_64_fbsd"
266,7 → 266,7
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1"
+#define GLIBC_DYNAMIC_LINKERX32 "/lib/ld-kfreebsd-x32.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu.h
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -19,4 +19,4 @@
<http://www.gnu.org/licenses/>. */
275,7 → 275,7
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/linux64.h gcc-5.3.0-zip/gcc/config/i386/linux64.h
--- gcc-5.3.0-original/gcc/config/i386/linux64.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/i386/linux64.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/linux64.h 2015-01-05 07:33:28.000000000 -0500
@@ -27,6 +27,6 @@
#define GNU_USER_LINK_EMULATION64 "elf_x86_64"
288,7 → 288,7
+#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/linux.h gcc-5.3.0-zip/gcc/config/i386/linux.h
--- gcc-5.3.0-original/gcc/config/i386/linux.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/i386/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -20,4 +20,4 @@
<http://www.gnu.org/licenses/>. */
297,7 → 297,7
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/ia64/linux.h gcc-5.3.0-zip/gcc/config/ia64/linux.h
--- gcc-5.3.0-original/gcc/config/ia64/linux.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/ia64/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/ia64/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -55,7 +55,7 @@
/* Define this for shared library support because it isn't in the main
309,7 → 309,7
#undef LINK_SPEC
#define LINK_SPEC "\
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/knetbsd-gnu.h gcc-5.3.0-zip/gcc/config/knetbsd-gnu.h
--- gcc-5.3.0-original/gcc/config/knetbsd-gnu.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/knetbsd-gnu.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/knetbsd-gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -32,4 +32,4 @@
318,7 → 318,7
-#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so.1"
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h gcc-5.3.0-zip/gcc/config/kopensolaris-gnu.h
--- gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/kopensolaris-gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -31,5 +31,4 @@
while (0)
328,7 → 328,7
-
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/linux.h gcc-5.3.0-zip/gcc/config/linux.h
--- gcc-5.3.0-original/gcc/config/linux.h 2016-10-19 11:02:11.783840959 -0400
--- gcc-5.3.0-original/gcc/config/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -73,10 +73,10 @@
GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
346,7 → 346,7
#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h gcc-5.3.0-zip/gcc/config/lm32/uclinux-elf.h
--- gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h 2016-10-19 11:02:11.787840932 -0400
--- gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/lm32/uclinux-elf.h 2015-01-05 07:33:28.000000000 -0500
@@ -67,7 +67,7 @@
%{shared:-shared} \
358,7 → 358,7
#define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/m68k/linux.h gcc-5.3.0-zip/gcc/config/m68k/linux.h
--- gcc-5.3.0-original/gcc/config/m68k/linux.h 2016-10-19 11:02:11.787840932 -0400
--- gcc-5.3.0-original/gcc/config/m68k/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/m68k/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -71,7 +71,7 @@
When the -shared link option is used a final link is not being
370,7 → 370,7
#undef LINK_SPEC
#define LINK_SPEC "-m m68kelf %{shared} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/microblaze/linux.h gcc-5.3.0-zip/gcc/config/microblaze/linux.h
--- gcc-5.3.0-original/gcc/config/microblaze/linux.h 2016-10-19 11:02:11.787840932 -0400
--- gcc-5.3.0-original/gcc/config/microblaze/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/microblaze/linux.h 2015-05-28 10:08:19.000000000 -0400
@@ -28,7 +28,7 @@
#undef TLS_NEEDS_GOT
382,7 → 382,7
#define SUBTARGET_EXTRA_SPECS \
{ "dynamic_linker", DYNAMIC_LINKER }
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/mips/linux.h gcc-5.3.0-zip/gcc/config/mips/linux.h
--- gcc-5.3.0-original/gcc/config/mips/linux.h 2016-10-19 11:02:11.787840932 -0400
--- gcc-5.3.0-original/gcc/config/mips/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/mips/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -22,20 +22,20 @@
#define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
412,7 → 412,7
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
#define GNU_USER_DYNAMIC_LINKERN32 \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/mn10300/linux.h gcc-5.3.0-zip/gcc/config/mn10300/linux.h
--- gcc-5.3.0-original/gcc/config/mn10300/linux.h 2016-10-19 11:02:11.787840932 -0400
--- gcc-5.3.0-original/gcc/config/mn10300/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/mn10300/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -32,7 +32,7 @@
#undef ASM_SPEC
424,7 → 424,7
#undef LINK_SPEC
#define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/pa/pa-linux.h gcc-5.3.0-zip/gcc/config/pa/pa-linux.h
--- gcc-5.3.0-original/gcc/config/pa/pa-linux.h 2016-10-19 11:02:11.787840932 -0400
--- gcc-5.3.0-original/gcc/config/pa/pa-linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/pa/pa-linux.h 2015-09-24 20:04:26.000000000 -0400
@@ -37,7 +37,7 @@
/* Define this for shared library support because it isn't in the main
436,7 → 436,7
#undef LINK_SPEC
#define LINK_SPEC "\
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/rs6000/linux64.h gcc-5.3.0-zip/gcc/config/rs6000/linux64.h
--- gcc-5.3.0-original/gcc/config/rs6000/linux64.h 2016-10-19 11:02:11.787840932 -0400
--- gcc-5.3.0-original/gcc/config/rs6000/linux64.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/rs6000/linux64.h 2015-03-09 19:18:57.000000000 -0400
@@ -357,14 +357,14 @@
#undef LINK_OS_DEFAULT_SPEC
459,7 → 459,7
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
#elif DEFAULT_LIBC == LIBC_GLIBC
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/rs6000/sysv4.h gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h
--- gcc-5.3.0-original/gcc/config/rs6000/sysv4.h 2016-10-19 11:02:11.891840233 -0400
--- gcc-5.3.0-original/gcc/config/rs6000/sysv4.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h 2015-09-24 09:46:45.000000000 -0400
@@ -757,8 +757,8 @@
473,7 → 473,7
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/s390/linux.h gcc-5.3.0-zip/gcc/config/s390/linux.h
--- gcc-5.3.0-original/gcc/config/s390/linux.h 2016-10-19 11:02:11.891840233 -0400
--- gcc-5.3.0-original/gcc/config/s390/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/s390/linux.h 2015-05-11 03:14:10.000000000 -0400
@@ -60,8 +60,8 @@
#define MULTILIB_DEFAULTS { "m31" }
487,7 → 487,7
#undef LINK_SPEC
#define LINK_SPEC \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sh/linux.h gcc-5.3.0-zip/gcc/config/sh/linux.h
--- gcc-5.3.0-original/gcc/config/sh/linux.h 2016-10-19 11:02:11.891840233 -0400
--- gcc-5.3.0-original/gcc/config/sh/linux.h 2016-11-03 13:52:45.203663997 -0400
+++ gcc-5.3.0-zip/gcc/config/sh/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -43,7 +43,7 @@
499,7 → 499,7
#undef SUBTARGET_LINK_EMUL_SUFFIX
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sparc/linux64.h gcc-5.3.0-zip/gcc/config/sparc/linux64.h
--- gcc-5.3.0-original/gcc/config/sparc/linux64.h 2016-10-19 11:02:12.023839345 -0400
--- gcc-5.3.0-original/gcc/config/sparc/linux64.h 2016-11-03 13:52:45.207663972 -0400
+++ gcc-5.3.0-zip/gcc/config/sparc/linux64.h 2015-01-05 07:33:28.000000000 -0500
@@ -84,8 +84,8 @@
When the -shared link option is used a final link is not being
522,7 → 522,7
%{!static: \
%{rdynamic:-export-dynamic} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sparc/linux.h gcc-5.3.0-zip/gcc/config/sparc/linux.h
--- gcc-5.3.0-original/gcc/config/sparc/linux.h 2016-10-19 11:02:12.023839345 -0400
--- gcc-5.3.0-original/gcc/config/sparc/linux.h 2016-11-03 13:52:45.207663972 -0400
+++ gcc-5.3.0-zip/gcc/config/sparc/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -83,7 +83,7 @@
When the -shared link option is used a final link is not being
534,7 → 534,7
#undef LINK_SPEC
#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/vax/linux.h gcc-5.3.0-zip/gcc/config/vax/linux.h
--- gcc-5.3.0-original/gcc/config/vax/linux.h 2016-10-19 11:02:12.023839345 -0400
--- gcc-5.3.0-original/gcc/config/vax/linux.h 2016-11-03 13:52:45.207663972 -0400
+++ gcc-5.3.0-zip/gcc/config/vax/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -41,7 +41,7 @@
%{!shared: \
546,7 → 546,7
#undef WCHAR_TYPE
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/xtensa/linux.h gcc-5.3.0-zip/gcc/config/xtensa/linux.h
--- gcc-5.3.0-original/gcc/config/xtensa/linux.h 2016-10-19 11:02:12.023839345 -0400
--- gcc-5.3.0-original/gcc/config/xtensa/linux.h 2016-11-03 13:52:45.207663972 -0400
+++ gcc-5.3.0-zip/gcc/config/xtensa/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -44,7 +44,7 @@
%{mlongcalls:--longcalls} \
706,7 → 706,7
+
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip.c gcc-5.3.0-zip/gcc/config/zip/zip.c
--- gcc-5.3.0-original/gcc/config/zip/zip.c 1969-12-31 19:00:00.000000000 -0500
+++ gcc-5.3.0-zip/gcc/config/zip/zip.c 2016-09-13 15:36:22.342322803 -0400
+++ gcc-5.3.0-zip/gcc/config/zip/zip.c 2016-11-02 10:55:10.906812219 -0400
@@ -0,0 +1,2291 @@
+////////////////////////////////////////////////////////////////////////////////
+//
2042,7 → 2042,7
+ case UNSPEC_VOLATILE: zip_debug_print(pfx, lvl, "(UNSPEC_VOLATILE)"); break;
+ case CODE_LABEL:
+ {
+ char buf[64];
+ char buf[128];
+ sprintf(buf, "(CODE_LABEL *.L%d)", CODE_LABEL_NUMBER(x));
+ zip_debug_print_m(pfx, lvl, buf, GET_MODE(x));
+ } break;
2108,7 → 2108,7
+ zip_debug_print(pfx, lvl, ")");
+ break;
+ case CONST_INT:
+ { char buf[25];
+ { char buf[128];
+ if (GET_MODE(x)==SImode)
+ sprintf(buf, "(CONST_INT:SI %ld)", (long)INTVAL(x));
+ else if (GET_MODE(x)==VOIDmode)
2125,7 → 2125,7
+ break;
+ case SYMBOL_REF:
+ {
+ char buf[64];
+ char buf[128];
+ sprintf(buf, "(SYMBOL: %s)", XSTR(x,0));
+ // fprintf(file, "%s", XSTR(x,0));
+ zip_debug_print(pfx, lvl, buf);
7100,8 → 7100,8
+
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip.md gcc-5.3.0-zip/gcc/config/zip/zip.md
--- gcc-5.3.0-original/gcc/config/zip/zip.md 1969-12-31 19:00:00.000000000 -0500
+++ gcc-5.3.0-zip/gcc/config/zip/zip.md 2016-09-15 11:37:25.730251033 -0400
@@ -0,0 +1,3463 @@
+++ gcc-5.3.0-zip/gcc/config/zip/zip.md 2016-11-02 12:05:18.838341497 -0400
@@ -0,0 +1,3468 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Filename: zip.md
8865,21 → 8865,26
+ [(reg:CC CC_REG) (const_int 0)])
+ (set (match_dup 0) (match_dup 2)))]
+ "" [(set_attr "predicable" "no")])
+(define_insn "add<mode>cc"
+ [(set (match_operand:ZI 0 "register_operand" "=r,r")
+ (if_then_else:ZI (match_operator 1 "ordered_comparison_operator"
+ [(reg:CC CC_REG) (const_int 0)])
+ (plus:ZI (match_operand:ZI 2 "register_operand" "0,r")
+ (match_operand:ZI 3 "nonmemory_operand" "rO,M"))
+ (match_dup 0)))]
+ ""
+ {
+ return zip_addsicc(operands[0], operands[1], operands[2], operands[3]);
+ }
+ [(set_attr "predicable" "no") (set_attr "ccresult" "unchanged")])
+;
+;
+; Dies when trying to do reloads for "ADD.NZ R6,R7,R9"
+;
+;(define_insn "add<mode>cc"
+; [(set (match_operand:ZI 0 "register_operand" "=r,r")
+; (if_then_else:ZI (match_operator 1 "ordered_comparison_operator"
+; [(reg:CC CC_REG) (const_int 0)])
+; (plus:ZI (match_operand:ZI 2 "register_operand" "0,r")
+; (match_operand:ZI 3 "nonmemory_operand" "rO,M"))
+; (match_operand:ZI 4 "register_operand" "0,0")))]
+; ""
+; {
+; return zip_addsicc(operands[0], operands[1], operands[2], operands[3]);
+; }
+; [(set_attr "predicable" "no") (set_attr "ccresult" "unchanged")])
+;
+
+;
+;
+; While an interesting approach, the following suffers from problems when the
+; move amount is constant. At anything less than four, moves should not require
+; the movmemSI instruction. At anything greater, if constant, the initial tests
11655,7 → 11660,7
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/reload1.c gcc-5.3.0-zip/gcc/reload1.c
--- gcc-5.3.0-original/gcc/reload1.c 2015-01-15 08:28:42.000000000 -0500
+++ gcc-5.3.0-zip/gcc/reload1.c 2016-04-20 20:51:38.590252867 -0400
+++ gcc-5.3.0-zip/gcc/reload1.c 2016-11-02 12:07:12.261675054 -0400
@@ -72,6 +72,14 @@
#include "dumpfile.h"
#include "rtl-iter.h"
11715,7 → 11720,7
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/reload.c gcc-5.3.0-zip/gcc/reload.c
--- gcc-5.3.0-original/gcc/reload.c 2015-01-15 08:28:42.000000000 -0500
+++ gcc-5.3.0-zip/gcc/reload.c 2016-04-06 17:49:33.418613170 -0400
+++ gcc-5.3.0-zip/gcc/reload.c 2016-11-02 12:07:03.653725635 -0400
@@ -136,6 +136,15 @@
#include "target.h"
#include "ira.h"

powered by: WebSVN 2.1.0

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