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 118 to Rev 119
    Reverse comparison

Rev 118 → Rev 119

/trunk/sw/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-01 16:12:24.012795897 -0400
@@ -0,0 +1,2299 @@
+++ binutils-2.25/gas/config/tc-zip.c 2016-04-02 21:51:19.792662781 -0400
@@ -0,0 +1,2271 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: tc-zip.c
2538,7 → 2538,7
+
+static unsigned int
+zip_brev(unsigned int v) {
+ int r=0, b;
+ unsigned r=0, b;
+
+ for(b=0; b<32; b++, v>>=1)
+ r = (r<<1)|(v&1);
2863,46 → 2863,13
+ ptr = zip_skip_white_spaces(ptr+1);
+
+ if ((*ptr)&&(isdigit(*ptr))) {
+ char *end = (char *)ptr;
+ unsigned long v = strtoul(ptr, &end, 0);
+ // We start with a number
+ // printf("OP-B ( \'%s\' ) starts with a number (%c%c)\n",
+ // bop, (sgn)?'-':' ', *ptr);
+ if (('0'==*ptr)&&(ptr[1])
+ &&(('x' == ptr[1])||('X'==ptr[1]))) {
+ // Hexadecimal number
+ // printf("Parsing hexadecimal number, %s\n", ptr);
+ ptr+=2;
+ while((*ptr)&&(
+ (isdigit(*ptr))
+ ||((*ptr <= 'f')&&(*ptr >= 'a'))
+ ||((*ptr <= 'F')&&(*ptr >= 'A')))) {
+ insn->i_imm <<= 4;
+ if (isdigit(*ptr))
+ insn->i_imm += (*ptr-'0');
+ else if ((*ptr <= 'f')&&(*ptr >= 'a'))
+ insn->i_imm += (*ptr-'a')+10;
+ else
+ insn->i_imm += (*ptr-'A')+10;
+ ptr++;
+ }
+ } else if ('0'==*ptr) {
+ // Octal number
+ ptr++;
+ while((*ptr)&&(*ptr >= '0')&&(*ptr <= '7')) {
+ insn->i_imm <<= 3;
+ insn->i_imm += (*ptr-'0');
+ ptr++;
+ }
+ } else {
+ // Decimal (normal) number
+ while((*ptr)&&(isdigit(*ptr))) {
+ insn->i_imm *= 10;
+ insn->i_imm += (*ptr-'0');
+ ptr++;
+ }
+ }
+
+ if (sgn)
+ insn->i_imm = -insn->i_imm;
+ insn->i_imm = (int)(-v);
+ else
+ insn->i_imm = (int)(v);
+ } else if ((*ptr)&&(
+ (isalpha(*ptr))
+ ||('*'==*ptr)
3046,10 → 3013,15
+}
+
+static int fits_within(int nbits, int value) {
+ // -2 fits_within two bits
+ // -1 fits_within two bits
+ // 1 fits_within two bits
+ // 2 does not
+ //
+ if (value > 0)
+ return ( value < (1<<(nbits-1))) ? 1:0;
+ return (value < (1l<<(nbits-1))) ? 1:0;
+ else
+ return ((-value)<=(1<<(nbits-1))) ? 1:0;
+ return (value >= -(1l<<(nbits-1))) ? 1:0;
+}
+
+static const char *zip_parse(const char *line, ZIPIS *insn) {

powered by: WebSVN 2.1.0

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