Now the regression tests could go online again
[fw/sdcc] / src / z80 / gen.c
index 03e5a780d397b86f6b64282228ca52958e5656c9..60e46b11d00da2a1614411a8f3ca74095ff53b08 100644 (file)
 #include <string.h>
 #include <ctype.h>
 
+#if defined(__BORLANDC__) || defined(_MSC_VER)
+#define STRCASECMP stricmp
+#else
+#define STRCASECMP strcasecmp
+#endif
+
 #ifdef HAVE_SYS_ISA_DEFS_H
 #include <sys/isa_defs.h>
 #endif
@@ -469,7 +475,7 @@ _emit2 (const char *inst, const char *fmt,...)
 static void
 _emitMove(const char *to, const char *from)
 {
-  if (strcasecmp(to, from) != 0) 
+  if (STRCASECMP(to, from) != 0) 
     {
       emit2("ld %s,%s", to, from);
     }
@@ -491,6 +497,7 @@ aopDump(const char *plabel, asmop *aop)
       break;
     default:
       /* No information. */
+      break;
     }
 }
 
@@ -5883,9 +5890,19 @@ genRightShiftLiteral (operand * left,
       wassert (0);
     }
 
-  else if (shCount >= (size * 8))
+  else if (shCount >= (size * 8)) {
+    const char *s;
+    if (!SPEC_USIGN(getSpec(operandType(left)))) {
+      _moveA(aopGet (AOP (left), 0, FALSE));
+      emit2 ("rlc a");
+      emit2 ("sbc a,a");
+      s=ACC_NAME;
+    } else {
+      s="!zero";
+    }
     while (size--)
-      aopPut (AOP (result), "!zero", size);
+      aopPut (AOP (result), s, size);
+  }
   else
     {
       switch (size)
@@ -7231,7 +7248,8 @@ genZ80Code (iCode * lic)
 
       if (cln != ic->lineno)
        {
-         emit2 ("; %s %d", ic->filename, ic->lineno);
+         emit2 ("; %s:%d: %s", ic->filename, ic->lineno,
+                printCLine(ic->filename, ic->lineno));
          cln = ic->lineno;
        }
       /* if the result is marked as