* as/hc08/lkaomf51.c (OutputName),
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 1 Jul 2006 20:59:37 +0000 (20:59 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 1 Jul 2006 20:59:37 +0000 (20:59 +0000)
* as/mcs51/lkaomf51.c (OutputName),
* as/z80/asmain.c (asmbl),
* src/ds390/main.c (asmLineNodeFromLineNode),
* src/hc08/ralloc.c (hc08_assignRegisters),
* src/mcs51/main.c (asmLineNodeFromLineNode),
* src/xa51/ralloc.c (checkRegMask),
* src/xa51/gen.c (emitcode),
* src/z80/gen.c (_emit2),
* src/SDCCast.c (searchLitOp),
* src/SDCCglobl.h,
* support/packihx/packihx.c,
* support/Util/MySystem.c (split_command): fix gcc 4 warnings
* src/ds390/gen.c (aopPutUsesAcc),
* src/ds390/ralloc.c (getRegBitNoSpil): unused, therefore disabled
* support/regression/tests/libmullong.c (mullong_wrapper),
* src/SDCCsymt.c (powof2),
* src/SDCCast.c,
* src/SDCCicode.c: renamed TYPE_WORD by TYPE_TARGET_INT and so on
* src/SDCCsymt.h: added TYPE_TARGET_*
* src/SDCCutil.c (doubleFromFixed16x16, fixed16x16FromDouble),
* src/SDCCutil.h (doubleFromFixed16x16, fixed16x16FromDouble): moved to SDCCast because 1) header problems 2) this is the right place
* src/SDCCast.c (doubleFromFixed16x16, fixed16x16FromDouble): added
* src/SDCCval.h (doubleFromFixed16x16, fixed16x16FromDouble): added prototype

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4254 4a8a32a2-be11-0410-ad9d-d568d2c75423

25 files changed:
ChangeLog
as/hc08/lkaomf51.c
as/mcs51/lkaomf51.c
as/z80/asmain.c
sim/ucsim/libtool
src/SDCCast.c
src/SDCCglobl.h
src/SDCCicode.c
src/SDCCsymt.c
src/SDCCsymt.h
src/SDCCutil.c
src/SDCCutil.h
src/SDCCval.c
src/SDCCval.h
src/ds390/gen.c
src/ds390/main.c
src/ds390/ralloc.c
src/hc08/ralloc.c
src/mcs51/main.c
src/xa51/gen.c
src/xa51/ralloc.c
src/z80/gen.c
support/Util/MySystem.c
support/packihx/packihx.c
support/regression/tests/libmullong.c

index 168b52d70fb1e7a048ce0fd76b973e6fa19d662d..8d5c6c3e1930ee02c8ef429d00dc0c999240a8a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2006-07-01 Bernhard Held <bernhard AT bernhardheld.de>
+
+       * as/hc08/lkaomf51.c (OutputName),
+       * as/mcs51/lkaomf51.c (OutputName),
+       * as/z80/asmain.c (asmbl),
+       * src/ds390/main.c (asmLineNodeFromLineNode),
+       * src/hc08/ralloc.c (hc08_assignRegisters),
+       * src/mcs51/main.c (asmLineNodeFromLineNode),
+       * src/xa51/ralloc.c (checkRegMask),
+       * src/xa51/gen.c (emitcode),
+       * src/z80/gen.c (_emit2),
+       * src/SDCCast.c (searchLitOp),
+       * src/SDCCglobl.h,
+       * support/packihx/packihx.c,
+       * support/Util/MySystem.c (split_command): fix gcc 4 warnings
+       * src/ds390/gen.c (aopPutUsesAcc),
+       * src/ds390/ralloc.c (getRegBitNoSpil): unused, therefore disabled
+       * support/regression/tests/libmullong.c (mullong_wrapper),
+       * src/SDCCsymt.c (powof2),
+       * src/SDCCast.c,
+       * src/SDCCicode.c: renamed TYPE_WORD by TYPE_TARGET_INT and so on
+       * src/SDCCsymt.h: added TYPE_TARGET_*
+       * src/SDCCutil.c (doubleFromFixed16x16, fixed16x16FromDouble),
+       * src/SDCCutil.h (doubleFromFixed16x16, fixed16x16FromDouble): moved to
+       SDCCast because 1) header problems 2) this is the right place
+       * src/SDCCast.c (doubleFromFixed16x16, fixed16x16FromDouble): added
+       * src/SDCCval.h (doubleFromFixed16x16, fixed16x16FromDouble): added
+       prototype
+
 2006-06-29 Bernhard Held <bernhard AT bernhardheld.de>
 
        * src/SDCCicode.h: removed buggy semicolon in unused macro
index f1477e794195e69a048e7dc70d1f946492f567bd..f81a96a99068d3ced7f50fc014ed8fbf9d613dbf 100644 (file)
@@ -203,7 +203,7 @@ void OutputWord(int value)
        OutputByte((unsigned char)(value/0x100));
 }
 
-void OutputName(unsigned char * name)
+void OutputName(char * name)
 {
        int k;
        OutputByte((unsigned char)strlen(name));
index 37462eb514fe0f309473d6b734a41595c9e19408..7e6503177c03f09a5ad32888e43d073f4be411ac 100644 (file)
@@ -209,7 +209,7 @@ void OutputWord(int value)
        OutputByte((unsigned char)(value/0x100));
 }
 
-void OutputName(unsigned char * name)
+void OutputName(char * name)
 {
        int k;
        OutputByte((unsigned char)strlen(name));
index 3972b0df3546841a41bbd3603765b3cc5eb19911..50ccb2b22e55cee6ccd5279f8a959521134bcd00 100644 (file)
@@ -493,7 +493,7 @@ asmbl()
 #ifdef SDK
        double f1, f2;
        unsigned int mantissa, exponent;
-       const signed char readbuffer[80];
+       const char readbuffer[80];
 #endif
        laddr = dot.s_addr;
        lmode = SLIST;
index 0530d16134c3c4b16daa57e15bc20798fc79374e..22321aa9779ff647e5d507aa7b255e4cbfc630d3 100755 (executable)
@@ -35,7 +35,7 @@ if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
 
 # ### BEGIN LIBTOOL CONFIG
 
-# Libtool was configured on host toto.private.network:
+# Libtool was configured on host viktoria:
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -54,7 +54,7 @@ fast_install=yes
 
 # The host system.
 host_alias=
-host=x86_64-unknown-linux-gnu
+host=i686-pc-linux-gnu
 
 # An echo program that does not interpret backslashes.
 echo="echo"
@@ -70,7 +70,7 @@ CC="gcc"
 with_gcc=yes
 
 # The linker used to build libraries.
-LD="/usr/bin/ld"
+LD="/usr/i586-suse-linux/bin/ld"
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -82,7 +82,7 @@ NM="/usr/bin/nm -B"
 STRIP=strip
 
 # Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=/usr/bin/file
+MAGIC_CMD=file
 
 # Used on cygwin: DLL creation program.
 DLLTOOL="dlltool"
@@ -191,7 +191,7 @@ old_striplib="strip --strip-debug"
 striplib="strip --strip-unneeded"
 
 # Method to check whether dependent libraries are shared objects.
-deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )"
+deplibs_check_method="pass_all"
 
 # Command to use when deplibs_check_method == file_magic.
 file_magic_cmd="\$MAGIC_CMD"
index d607641a39d978a0837532d06d4de8e0bcc3d569..f57bc1489db9bd8de82c98f483d28b920f2a1b94 100644 (file)
@@ -2123,7 +2123,7 @@ reverseLoop (ast * loop, symbol * sym, ast * init, ast * end)
 /* searchLitOp - search tree (*ops only) for an ast with literal */
 /*-----------------------------------------------------------------*/
 static ast *
-searchLitOp (ast *tree, ast **parent, const unsigned char *ops)
+searchLitOp (ast *tree, ast **parent, const char *ops)
 {
   ast *ret;
 
@@ -3093,7 +3093,7 @@ decorateType (ast * tree, RESULT_TYPE resultType)
       /* rearrange the tree */
       if (IS_LITERAL (RTYPE (tree))
           /* avoid infinite loop */
-          && (TYPE_UDWORD) floatFromVal (tree->right->opval.val) != 1)
+          && (TYPE_TARGET_ULONG) floatFromVal (tree->right->opval.val) != 1)
         {
           ast *parent;
           ast *litTree = searchLitOp (tree, &parent, "/");
@@ -3537,7 +3537,7 @@ decorateType (ast * tree, RESULT_TYPE resultType)
       /* rearrange the tree */
       if (IS_LITERAL (RTYPE (tree))
           /* avoid infinite loop */
-          && (TYPE_UDWORD) floatFromVal (tree->right->opval.val) != 0)
+          && (TYPE_TARGET_ULONG) floatFromVal (tree->right->opval.val) != 0)
         {
           ast *litTree, *litParent;
           litTree = searchLitOp (tree, &litParent, "+-");
@@ -3759,7 +3759,7 @@ decorateType (ast * tree, RESULT_TYPE resultType)
       /* if only the right side is a literal & we are
          shifting more than size of the left operand then zero */
       if (IS_LITERAL (RTYPE (tree)) &&
-          ((TYPE_UDWORD) floatFromVal (valFromType (RETYPE (tree)))) >=
+          ((TYPE_TARGET_ULONG) floatFromVal (valFromType (RETYPE (tree)))) >=
           (getSize (TETYPE (tree)) * 8))
         {
           if (tree->opval.op==LEFT_OP ||
@@ -5324,7 +5324,7 @@ isBitAndPow2 (ast * tree)
   if (!IS_AST_LIT_VALUE (tree->right))
     return -1;
 
-  return powof2 ((TYPE_UDWORD)AST_LIT_VALUE (tree->right));
+  return powof2 ((TYPE_TARGET_ULONG)AST_LIT_VALUE (tree->right));
 }
 
 /*-----------------------------------------------------------------*/
@@ -6118,10 +6118,10 @@ void ast_print (ast * tree, FILE *outfile, int indent)
                 if (IS_LITERAL (tree->opval.val->etype)) {
                         fprintf(outfile,"CONSTANT (%p) value = ", tree);
                         if (SPEC_USIGN (tree->opval.val->etype))
-                                fprintf(outfile,"%u", (TYPE_UDWORD) floatFromVal(tree->opval.val));
+                                fprintf(outfile,"%u", (TYPE_TARGET_ULONG) floatFromVal(tree->opval.val));
                         else
-                                fprintf(outfile,"%d", (TYPE_DWORD) floatFromVal(tree->opval.val));
-                        fprintf(outfile,", 0x%x, %f", (TYPE_UDWORD) floatFromVal(tree->opval.val),
+                                fprintf(outfile,"%d", (TYPE_TARGET_LONG) floatFromVal(tree->opval.val));
+                        fprintf(outfile,", 0x%x, %f", (TYPE_TARGET_ULONG) floatFromVal(tree->opval.val),
                                                       floatFromVal(tree->opval.val));
                 } else if (tree->opval.val->sym) {
                         /* if the undefined flag is set then give error message */
index 1b34d11a8e4654a53e69e890eb6da576be8bd370..48198effe7c9b0d99ae9542606792308bddecb7c 100644 (file)
@@ -146,18 +146,18 @@ typedef int bool;
  */
 struct optimize
   {
-    unsigned global_cse;
-    unsigned ptrArithmetic;
-    unsigned label1;
-    unsigned label2;
-    unsigned label3;
-    unsigned label4;
-    unsigned loopInvariant;
-    unsigned loopInduction;
-    unsigned noJTabBoundary;
-    unsigned noLoopReverse;
-    unsigned codeSpeed;
-    unsigned codeSize;
+    int global_cse;
+    int ptrArithmetic;
+    int label1;
+    int label2;
+    int label3;
+    int label4;
+    int loopInvariant;
+    int loopInduction;
+    int noJTabBoundary;
+    int noLoopReverse;
+    int codeSpeed;
+    int codeSize;
   };
 
 /** Build model.
index bc5bf842316a868183fe0d0b31d3c2a958529432..4eeeab56a121f9dc2b255107bb942a74300313e4 100644 (file)
@@ -1156,26 +1156,26 @@ operandOperation (operand * left, operand * right,
           /* signed and unsigned mul are the same, as long as the precision
              of the result isn't bigger than the precision of the operands. */
             retval = operandFromValue (valCastLiteral (type,
-                     (TYPE_UDWORD) operandLitValue (left) *
-                     (TYPE_UDWORD) operandLitValue (right)));
+                     (TYPE_TARGET_ULONG) operandLitValue (left) *
+                     (TYPE_TARGET_ULONG) operandLitValue (right)));
           else if (IS_UNSIGNED (type)) /* unsigned int */
             {
               /* unsigned int is handled here in order to detect overflow */
-              TYPE_UDWORD ul = (TYPE_UWORD) operandLitValue (left) *
-                               (TYPE_UWORD) operandLitValue (right);
+              TYPE_TARGET_ULONG ul = (TYPE_TARGET_UINT) operandLitValue (left) *
+                                     (TYPE_TARGET_UINT) operandLitValue (right);
 
-              retval = operandFromValue (valCastLiteral (type, (TYPE_UWORD) ul));
-              if (ul != (TYPE_UWORD) ul)
+              retval = operandFromValue (valCastLiteral (type, (TYPE_TARGET_UINT) ul));
+              if (ul != (TYPE_TARGET_UINT) ul)
                 werror (W_INT_OVL);
             }
           else /* signed int */
             {
               /* signed int is handled here in order to detect overflow */
-              TYPE_DWORD l = (TYPE_WORD) operandLitValue (left) *
-                             (TYPE_WORD) operandLitValue (right);
+              TYPE_TARGET_LONG l = (TYPE_TARGET_INT) operandLitValue (left) *
+                                   (TYPE_TARGET_INT) operandLitValue (right);
 
-              retval = operandFromValue (valCastLiteral (type, (TYPE_WORD) l));
-              if (l != (TYPE_WORD) l)
+              retval = operandFromValue (valCastLiteral (type, (TYPE_TARGET_INT) l));
+              if (l != (TYPE_TARGET_INT) l)
                 werror (W_INT_OVL);
             }
         }
@@ -1186,7 +1186,7 @@ operandOperation (operand * left, operand * right,
                                                    operandLitValue (right)));
       break;
     case '/':
-      if ((TYPE_UDWORD) operandLitValue (right) == 0)
+      if ((TYPE_TARGET_ULONG) operandLitValue (right) == 0)
         {
           werror (E_DIVIDE_BY_ZERO);
           retval = right;
@@ -1199,8 +1199,8 @@ operandOperation (operand * left, operand * right,
               SPEC_USIGN (let) = 1;
               SPEC_USIGN (ret) = 1;
               retval = operandFromValue (valCastLiteral (type,
-                                        (TYPE_UDWORD) operandLitValue (left) /
-                                        (TYPE_UDWORD) operandLitValue (right)));
+                                        (TYPE_TARGET_ULONG) operandLitValue (left) /
+                                        (TYPE_TARGET_ULONG) operandLitValue (right)));
             }
           else
             {
@@ -1211,7 +1211,7 @@ operandOperation (operand * left, operand * right,
         }
       break;
     case '%':
-      if ((TYPE_UDWORD) operandLitValue (right) == 0)
+      if ((TYPE_TARGET_ULONG) operandLitValue (right) == 0)
         {
           werror (E_DIVIDE_BY_ZERO);
           retval = right;
@@ -1219,31 +1219,31 @@ operandOperation (operand * left, operand * right,
       else
         {
           if (IS_UNSIGNED (type))
-            retval = operandFromLit ((TYPE_UDWORD) operandLitValue (left) %
-                                     (TYPE_UDWORD) operandLitValue (right));
+            retval = operandFromLit ((TYPE_TARGET_ULONG) operandLitValue (left) %
+                                     (TYPE_TARGET_ULONG) operandLitValue (right));
           else
-            retval = operandFromLit ((TYPE_DWORD) operandLitValue (left) %
-                                     (TYPE_DWORD) operandLitValue (right));
+            retval = operandFromLit ((TYPE_TARGET_LONG) operandLitValue (left) %
+                                     (TYPE_TARGET_LONG) operandLitValue (right));
         }
       break;
     case LEFT_OP:
       /* The number of left shifts is always unsigned. Signed doesn't make
          sense here. Shifting by a negative number is impossible. */
       retval = operandFromValue (valCastLiteral (type,
-                                 ((TYPE_UDWORD) operandLitValue (left) <<
-                                  (TYPE_UDWORD) operandLitValue (right))));
+                                 ((TYPE_TARGET_ULONG) operandLitValue (left) <<
+                                  (TYPE_TARGET_ULONG) operandLitValue (right))));
       break;
     case RIGHT_OP:
       /* The number of right shifts is always unsigned. Signed doesn't make
          sense here. Shifting by a negative number is impossible. */
       if (IS_UNSIGNED(let))
         /* unsigned: logic shift right */
-        retval = operandFromLit ((TYPE_UDWORD) operandLitValue (left) >>
-                                 (TYPE_UDWORD) operandLitValue (right));
+        retval = operandFromLit ((TYPE_TARGET_ULONG) operandLitValue (left) >>
+                                 (TYPE_TARGET_ULONG) operandLitValue (right));
       else
         /* signed: arithmetic shift right */
-        retval = operandFromLit ((TYPE_DWORD ) operandLitValue (left) >>
-                                 (TYPE_UDWORD) operandLitValue (right));
+        retval = operandFromLit ((TYPE_TARGET_LONG ) operandLitValue (left) >>
+                                 (TYPE_TARGET_ULONG) operandLitValue (right));
       break;
     case EQ_OP:
       if (IS_FLOAT (let) || IS_FLOAT (ret))
@@ -1259,10 +1259,10 @@ operandOperation (operand * left, operand * right,
       else
         {
           /* this op doesn't care about signedness */
-          TYPE_UDWORD l, r;
+          TYPE_TARGET_ULONG l, r;
 
-          l = (TYPE_UDWORD) operandLitValue (left);
-          r = (TYPE_UDWORD) operandLitValue (right);
+          l = (TYPE_TARGET_ULONG) operandLitValue (left);
+          r = (TYPE_TARGET_ULONG) operandLitValue (right);
           /* In order to correctly compare 'signed int' and 'unsigned int' it's
              neccessary to strip them to 16 bit.
              Literals are reduced to their cheapest type, therefore left and
@@ -1271,8 +1271,8 @@ operandOperation (operand * left, operand * right,
           if (!IS_LONG (let) &&
               !IS_LONG (ret))
             {
-              r = (TYPE_UWORD) r;
-              l = (TYPE_UWORD) l;
+              r = (TYPE_TARGET_UINT) r;
+              l = (TYPE_TARGET_UINT) l;
             }
           retval = operandFromLit (l == r);
         }
@@ -1299,18 +1299,18 @@ operandOperation (operand * left, operand * right,
       break;
     case BITWISEAND:
       retval = operandFromValue (valCastLiteral (type,
-                                                 (TYPE_UDWORD)operandLitValue(left) &
-                                                 (TYPE_UDWORD)operandLitValue(right)));
+                                                 (TYPE_TARGET_ULONG)operandLitValue(left) &
+                                                 (TYPE_TARGET_ULONG)operandLitValue(right)));
       break;
     case '|':
       retval = operandFromValue (valCastLiteral (type,
-                                                 (TYPE_UDWORD)operandLitValue(left) |
-                                                 (TYPE_UDWORD)operandLitValue(right)));
+                                                 (TYPE_TARGET_ULONG)operandLitValue(left) |
+                                                 (TYPE_TARGET_ULONG)operandLitValue(right)));
       break;
     case '^':
       retval = operandFromValue (valCastLiteral (type,
-                                                 (TYPE_UDWORD)operandLitValue(left) ^
-                                                 (TYPE_UDWORD)operandLitValue(right)));
+                                                 (TYPE_TARGET_ULONG)operandLitValue(left) ^
+                                                 (TYPE_TARGET_ULONG)operandLitValue(right)));
       break;
     case AND_OP:
       retval = operandFromLit (operandLitValue (left) &&
@@ -1322,7 +1322,7 @@ operandOperation (operand * left, operand * right,
       break;
     case RRC:
       {
-        TYPE_UDWORD i = (TYPE_UDWORD) operandLitValue (left);
+        TYPE_TARGET_ULONG i = (TYPE_TARGET_ULONG) operandLitValue (left);
 
         retval = operandFromLit ((i >> (getSize (operandType (left)) * 8 - 1)) |
                                  (i << 1));
@@ -1330,27 +1330,27 @@ operandOperation (operand * left, operand * right,
       break;
     case RLC:
       {
-        TYPE_UDWORD i = (TYPE_UDWORD) operandLitValue (left);
+        TYPE_TARGET_ULONG i = (TYPE_TARGET_ULONG) operandLitValue (left);
 
         retval = operandFromLit ((i << (getSize (operandType (left)) * 8 - 1)) |
                                  (i >> 1));
       }
       break;
     case GETABIT:
-      retval = operandFromLit (((TYPE_UDWORD)operandLitValue(left) >>
-                                (TYPE_UDWORD)operandLitValue(right)) & 1);
+      retval = operandFromLit (((TYPE_TARGET_ULONG)operandLitValue(left) >>
+                                (TYPE_TARGET_ULONG)operandLitValue(right)) & 1);
       break;
     case GETBYTE:
-      retval = operandFromLit (((TYPE_UDWORD)operandLitValue(left) >>
-                                (TYPE_UDWORD)operandLitValue(right)) & 0xFF);
+      retval = operandFromLit (((TYPE_TARGET_ULONG)operandLitValue(left) >>
+                                (TYPE_TARGET_ULONG)operandLitValue(right)) & 0xFF);
       break;
     case GETWORD:
-      retval = operandFromLit (((TYPE_UDWORD)operandLitValue(left) >>
-                                (TYPE_UDWORD)operandLitValue(right)) & 0xFFFF);
+      retval = operandFromLit (((TYPE_TARGET_ULONG)operandLitValue(left) >>
+                                (TYPE_TARGET_ULONG)operandLitValue(right)) & 0xFFFF);
       break;
 
     case GETHBIT:
-      retval = operandFromLit (((TYPE_UDWORD)operandLitValue(left) >>
+      retval = operandFromLit (((TYPE_TARGET_ULONG)operandLitValue(left) >>
                                 ((getSize (let) * 8) - 1)) & 1);
       break;
 
@@ -1361,7 +1361,7 @@ operandOperation (operand * left, operand * right,
 
     case '~':
       retval = operandFromValue (valCastLiteral (type,
-                                                 ~((TYPE_UDWORD)
+                                                 ~((TYPE_TARGET_ULONG)
                                                    operandLitValue (left))));
       break;
 
@@ -2098,7 +2098,7 @@ geniCodeMultiply (operand * left, operand * right, RESULT_TYPE resultType)
                                       right->operand.valOperand));
 
   if (IS_LITERAL(retype)) {
-    p2 = powof2 ((TYPE_UDWORD) floatFromVal (right->operand.valOperand));
+    p2 = powof2 ((TYPE_TARGET_ULONG) floatFromVal (right->operand.valOperand));
   }
 
   resType = usualBinaryConversions (&left, &right, resultType, '*');
@@ -2165,7 +2165,7 @@ geniCodeDivision (operand * left, operand * right, RESULT_TYPE resultType)
       !IS_FLOAT (letype) &&
       !IS_FIXED (letype) &&
       IS_UNSIGNED(letype) &&
-      ((p2 = powof2 ((TYPE_UDWORD)
+      ((p2 = powof2 ((TYPE_TARGET_ULONG)
                     floatFromVal (right->operand.valOperand))) > 0)) {
     ic = newiCode (RIGHT_OP, left, operandFromLit (p2)); /* right shift */
   }
index 6e2b7aed87d039adef6bdc1b8cd4822d5a203e13..e86314e249c577ce9def84216ca7f2ffca63735c 100644 (file)
@@ -3125,7 +3125,7 @@ printTypeChainRaw (sym_link * start, FILE * of)
 /* powof2 - returns power of two for the number if number is pow 2 */
 /*-----------------------------------------------------------------*/
 int
-powof2 (TYPE_UDWORD num)
+powof2 (TYPE_TARGET_ULONG num)
 {
   int nshifts = 0;
   int n1s = 0;
index 1d54708f3f1a80ae38d87ac3fb1cba33a2d4f571..aae73278c3a7b010a976fa5209a3b72d800f3245 100644 (file)
@@ -136,6 +136,13 @@ typedef enum
   }
 STORAGE_CLASS;
 
+#define TYPE_TARGET_CHAR  TYPE_BYTE
+#define TYPE_TARGET_INT   TYPE_WORD
+#define TYPE_TARGET_LONG  TYPE_DWORD
+#define TYPE_TARGET_UCHAR TYPE_UBYTE
+#define TYPE_TARGET_UINT  TYPE_UWORD
+#define TYPE_TARGET_ULONG TYPE_UDWORD
+
 /* specifier is the last in the type-chain */
 typedef struct specifier
   {
@@ -161,14 +168,14 @@ typedef struct specifier
     int argreg;                         /* reg no for regparm         */
     union
       {                                 /* Values if constant or enum */
-        TYPE_WORD   v_int;              /* 2 bytes: int and char values           */
-        char       *v_char;             /*          character string              */
-        TYPE_UWORD  v_uint;             /* 2 bytes: unsigned int const value      */
-        TYPE_DWORD  v_long;             /* 4 bytes: long constant value           */
-        TYPE_UDWORD v_ulong;            /* 4 bytes: unsigned long constant value  */
-        double      v_float;            /*          floating point constant value */
-        TYPE_UDWORD v_fixed16x16;       /* 4 bytes: fixed floating point constant value */
-        struct symbol *v_enum;          /* ptr to enum_list if enum==1            */
+        TYPE_TARGET_INT   v_int;        /* 2 bytes: int and char values           */
+        TYPE_TARGET_CHAR *v_char;       /*          character string              */
+        TYPE_TARGET_UINT  v_uint;       /* 2 bytes: unsigned int const value      */
+        TYPE_TARGET_LONG  v_long;       /* 4 bytes: long constant value           */
+        TYPE_TARGET_ULONG v_ulong;      /* 4 bytes: unsigned long constant value  */
+        double            v_float;      /*          floating point constant value */
+        TYPE_TARGET_ULONG v_fixed16x16; /* 4 bytes: fixed floating point constant value */
+        struct symbol    *v_enum;       /* ptr to enum_list if enum==1            */
       }
     const_val;
     struct structdef *v_struct;         /* structure pointer      */
@@ -601,7 +608,7 @@ sym_link *computeType (sym_link *, sym_link *, RESULT_TYPE, int);
 void processFuncPtrArgs (sym_link *);
 void processFuncArgs (symbol *);
 int isSymbolEqual (symbol *, symbol *);
-int powof2 (TYPE_UDWORD);
+int powof2 (TYPE_TARGET_ULONG);
 void printTypeChain (sym_link *, FILE *);
 void printTypeChainRaw (sym_link *, FILE *);
 void initCSupport ();
index a08cd115abe74ce9aea81c81de8c9e013cd6d361..da0223f6f6b67c36715ac3f119ed2a4fefffd4d0 100644 (file)
@@ -298,57 +298,6 @@ const char *getBuildNumber(void)
   return (SDCC_BUILD_NUMBER);
 }
 
-/*-----------------------------------------------------------------*/
-/* doubleFromFixed16x16 - convert a fixed16x16 to double           */
-/*-----------------------------------------------------------------*/
-double doubleFromFixed16x16(TYPE_UDWORD value)
-{
-#if 0
-  /* This version is incorrect negative values. */
-  double tmp=0, exp=2;
-
-    tmp = (value & 0xffff0000) >> 16;
-    
-    while(value) {
-      value &= 0xffff;
-      if(value & 0x8000)tmp += 1/exp;
-      exp *= 2;
-      value <<= 1;
-    }
-  
-  return (tmp);
-#else
-  return ((double)(value * 1.0) / (double)(1UL << 16));
-#endif
-}
-
-TYPE_UDWORD fixed16x16FromDouble(double value)
-{
-#if 0
-  /* This version is incorrect negative values. */
-  unsigned int tmp=0, pos=16;
-  TYPE_UDWORD res;
-
-    tmp = floor( value );
-    res = tmp << 16;
-    value -= tmp;
-    
-    tmp = 0;
-    while(pos--) {
-      value *= 2;
-      if(value >= 1.0)tmp |= (1 << pos);
-      value -= floor( value );
-    }
-  
-    res |= tmp;
-
-  return (res);
-#else
-  return  (TYPE_UDWORD)(value * (double)(1UL << 16));
-#endif
-}
-
-
 #if defined(HAVE_VSNPRINTF) || defined(HAVE_VSPRINTF)
 size_t SDCCsnprintf(char *dst, size_t n, const char *fmt, ...)
 {
index c939868a38534a09c5d277a12c5bb64ccc314d62..d8956d49322aa078b6daed1a9f4f3b7eb00b0eaf 100644 (file)
@@ -88,12 +88,6 @@ char *strncatz(char *dest, const char *src, size_t n);
 /* return SDCC build number */
 const char *getBuildNumber(void);
 
-/* convert a fixed16x16 type to double */
-double doubleFromFixed16x16(TYPE_UDWORD value);
-
-/* convert a double type to fixed16x16 */
-TYPE_UDWORD fixed16x16FromDouble(double value);
-
 /* snprintf, by hook or by crook. */
 size_t SDCCsnprintf(char *, size_t, const char *, ...);
 
index d8271ba8dc2288a2b52a0fe7d05f998f0bff8b51..e0821e1e45129eba22c1d4b2c1979665437b8e71 100644 (file)
@@ -400,7 +400,7 @@ checkConstantRange (sym_link *var, sym_link *lit, int op, bool exchangeLeftRight
         {
           if (SPEC_USIGN (var))
             {
-              TYPE_UDWORD maxVal = 0xffffffffu >> (32 - varBits);
+              TYPE_TARGET_ULONG maxVal = 0xffffffffu >> (32 - varBits);
 
               if (   litVal < 0
                   || litVal > maxVal)
@@ -409,8 +409,8 @@ checkConstantRange (sym_link *var, sym_link *lit, int op, bool exchangeLeftRight
             }
           else
             {
-              TYPE_DWORD minVal = 0xffffffff << (varBits - 1);
-              TYPE_DWORD maxVal = 0x7fffffff >> (32 - varBits);
+              TYPE_TARGET_LONG minVal = 0xffffffff << (varBits - 1);
+              TYPE_TARGET_LONG maxVal = 0x7fffffff >> (32 - varBits);
 
               if (   litVal < minVal
                   || litVal > maxVal)
@@ -422,8 +422,8 @@ checkConstantRange (sym_link *var, sym_link *lit, int op, bool exchangeLeftRight
         {
           /* ignore signedness, e.g. allow everything
              from -127...+255 for (unsigned) char */
-          TYPE_DWORD  minVal = 0xffffffff  << (varBits - 1);
-          TYPE_UDWORD maxVal = 0xffffffffu >> (32 - varBits);
+          TYPE_TARGET_LONG  minVal = 0xffffffff  << (varBits - 1);
+          TYPE_TARGET_ULONG maxVal = 0xffffffffu >> (32 - varBits);
 
           if (   litVal < minVal
               || litVal > maxVal)
@@ -449,8 +449,8 @@ checkConstantRange (sym_link *var, sym_link *lit, int op, bool exchangeLeftRight
   if (SPEC_USIGN (reType))
     {
       /* unsigned operation */
-      TYPE_UDWORD minValP, maxValP, minValM, maxValM;
-      TYPE_UDWORD opBitsMask = 0xffffffffu >> (32 - bitsForType (reType));
+      TYPE_TARGET_ULONG minValP, maxValP, minValM, maxValM;
+      TYPE_TARGET_ULONG opBitsMask = 0xffffffffu >> (32 - bitsForType (reType));
 
       if (SPEC_USIGN (lit) && SPEC_USIGN (var))
         {
@@ -480,7 +480,7 @@ checkConstantRange (sym_link *var, sym_link *lit, int op, bool exchangeLeftRight
             {
               /* make signed literal unsigned and
                  limit no of bits to size of return type */
-              litVal = (TYPE_UDWORD) litVal & opBitsMask;
+              litVal = (TYPE_TARGET_ULONG) litVal & opBitsMask;
             }
         }
       else /* SPEC_USIGN (lit) */
@@ -560,7 +560,7 @@ checkConstantRange (sym_link *var, sym_link *lit, int op, bool exchangeLeftRight
   else
     {
       /* signed operation */
-      TYPE_DWORD minVal, maxVal;
+      TYPE_TARGET_LONG minVal, maxVal;
 
       if (SPEC_USIGN (var))
         {
@@ -627,9 +627,9 @@ valueFromLit (double lit)
 {
   char buffer[50];
 
-  if ((((TYPE_DWORD) lit) - lit) == 0)
+  if ((((TYPE_TARGET_LONG) lit) - lit) == 0)
     {
-      SNPRINTF (buffer, sizeof(buffer), "%d", (TYPE_DWORD) lit);
+      SNPRINTF (buffer, sizeof(buffer), "%d", (TYPE_TARGET_LONG) lit);
       return constVal (buffer);
     }
 
@@ -783,22 +783,22 @@ value *constVal (char *s)
     {
       if (SPEC_USIGN (val->type))
         {
-          SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD)dval;
+          SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG)dval;
         }
       else
         {
-          SPEC_CVAL (val->type).v_long = (TYPE_DWORD)dval;
+          SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG)dval;
         }
     }
   else
     {
       if (SPEC_USIGN (val->type))
         {
-          SPEC_CVAL (val->type).v_uint = (TYPE_UWORD)dval;
+          SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT)dval;
         }
       else
         {
-          SPEC_CVAL (val->type).v_int = (TYPE_WORD)dval;
+          SPEC_CVAL (val->type).v_int = (TYPE_TARGET_INT)dval;
         }
     }
 
@@ -1215,6 +1215,56 @@ floatFromVal (value * val)
   return 0;
 }
 
+/*-----------------------------------------------------------------*/
+/* doubleFromFixed16x16 - convert a fixed16x16 to double           */
+/*-----------------------------------------------------------------*/
+double doubleFromFixed16x16(TYPE_TARGET_ULONG value)
+{
+#if 0
+  /* This version is incorrect negative values. */
+  double tmp=0, exp=2;
+
+    tmp = (value & 0xffff0000) >> 16;
+    
+    while(value) {
+      value &= 0xffff;
+      if(value & 0x8000)tmp += 1/exp;
+      exp *= 2;
+      value <<= 1;
+    }
+  
+  return (tmp);
+#else
+  return ((double)(value * 1.0) / (double)(1UL << 16));
+#endif
+}
+
+TYPE_TARGET_ULONG fixed16x16FromDouble(double value)
+{
+#if 0
+  /* This version is incorrect negative values. */
+  unsigned int tmp=0, pos=16;
+  TYPE_TARGET_ULONG res;
+
+    tmp = floor( value );
+    res = tmp << 16;
+    value -= tmp;
+    
+    tmp = 0;
+    while(pos--) {
+      value *= 2;
+      if(value >= 1.0)tmp |= (1 << pos);
+      value -= floor( value );
+    }
+  
+    res |= tmp;
+
+  return (res);
+#else
+  return  (TYPE_TARGET_ULONG)(value * (double)(1UL << 16));
+#endif
+}
+
 /*------------------------------------------------------------------*/
 /* valUnaryPM - does the unary +/- operation on a constant          */
 /*------------------------------------------------------------------*/
@@ -1340,24 +1390,24 @@ valMult (value * lval, value * rval)
       /* signed and unsigned mul are the same, as long as the precision of the
          result isn't bigger than the precision of the operands. */
   else if (SPEC_LONG (val->type))
-    SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) *
-                                    (TYPE_UDWORD) floatFromVal (rval);
+    SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) *
+                                    (TYPE_TARGET_ULONG) floatFromVal (rval);
   else if (SPEC_USIGN (val->type)) /* unsigned int */
     {
-      TYPE_UDWORD ul = (TYPE_UWORD) floatFromVal (lval) *
-                       (TYPE_UWORD) floatFromVal (rval);
+      TYPE_TARGET_ULONG ul = (TYPE_TARGET_UINT) floatFromVal (lval) *
+                             (TYPE_TARGET_UINT) floatFromVal (rval);
 
-      SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) ul;
-      if (ul != (TYPE_UWORD) ul)
+      SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) ul;
+      if (ul != (TYPE_TARGET_UINT) ul)
         werror (W_INT_OVL);
     }
   else /* signed int */
     {
-      TYPE_DWORD l = (TYPE_WORD) floatFromVal (lval) *
-                     (TYPE_WORD) floatFromVal (rval);
+      TYPE_TARGET_LONG l = (TYPE_TARGET_INT) floatFromVal (lval) *
+                           (TYPE_TARGET_INT) floatFromVal (rval);
 
-      SPEC_CVAL (val->type).v_int = (TYPE_WORD) l;
-      if (l != (TYPE_WORD) l)
+      SPEC_CVAL (val->type).v_int = (TYPE_TARGET_INT) l;
+      if (l != (TYPE_TARGET_INT) l)
         werror (W_INT_OVL);
     }
   return cheapestVal (val);
@@ -1393,20 +1443,20 @@ valDiv (value * lval, value * rval)
   else if (SPEC_LONG (val->type))
     {
       if (SPEC_USIGN (val->type))
-        SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) /
-          (TYPE_UDWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) /
+          (TYPE_TARGET_ULONG) floatFromVal (rval);
       else
-        SPEC_CVAL (val->type).v_long = (TYPE_DWORD) floatFromVal (lval) /
-          (TYPE_DWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG) floatFromVal (lval) /
+          (TYPE_TARGET_LONG) floatFromVal (rval);
     }
   else
     {
       if (SPEC_USIGN (val->type))
-        SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) floatFromVal (lval) /
-          (TYPE_UWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) floatFromVal (lval) /
+          (TYPE_TARGET_UINT) floatFromVal (rval);
       else
-        SPEC_CVAL (val->type).v_int = (TYPE_WORD) floatFromVal (lval) /
-          (TYPE_WORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_int = (TYPE_TARGET_INT) floatFromVal (lval) /
+          (TYPE_TARGET_INT) floatFromVal (rval);
     }
   return cheapestVal (val);
 }
@@ -1430,20 +1480,20 @@ valMod (value * lval, value * rval)
   if (SPEC_LONG (val->type))
     {
       if (SPEC_USIGN (val->type))
-        SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) %
-          (TYPE_UDWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) %
+          (TYPE_TARGET_ULONG) floatFromVal (rval);
       else
-        SPEC_CVAL (val->type).v_long = (TYPE_DWORD) floatFromVal (lval) %
-          (TYPE_DWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG) floatFromVal (lval) %
+          (TYPE_TARGET_LONG) floatFromVal (rval);
     }
   else
     {
       if (SPEC_USIGN (val->type))
-        SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) floatFromVal (lval) %
-          (TYPE_UWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) floatFromVal (lval) %
+          (TYPE_TARGET_UINT) floatFromVal (rval);
       else
-        SPEC_CVAL (val->type).v_int = (TYPE_WORD) floatFromVal (lval) %
-          (TYPE_WORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_int = (TYPE_TARGET_INT) floatFromVal (lval) %
+          (TYPE_TARGET_INT) floatFromVal (rval);
     }
   return cheapestVal (val);
 }
@@ -1472,20 +1522,20 @@ valPlus (value * lval, value * rval)
   else  if (SPEC_LONG (val->type))
     {
       if (SPEC_USIGN (val->type))
-        SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) +
-         (TYPE_UDWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) +
+         (TYPE_TARGET_ULONG) floatFromVal (rval);
       else
-        SPEC_CVAL (val->type).v_long = (TYPE_DWORD) floatFromVal (lval) +
-          (TYPE_DWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG) floatFromVal (lval) +
+          (TYPE_TARGET_LONG) floatFromVal (rval);
     }
   else
     {
       if (SPEC_USIGN (val->type))
-        SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) floatFromVal (lval) +
-          (TYPE_UWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) floatFromVal (lval) +
+          (TYPE_TARGET_UINT) floatFromVal (rval);
       else
-        SPEC_CVAL (val->type).v_int = (TYPE_WORD) floatFromVal (lval) +
-          (TYPE_WORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_int = (TYPE_TARGET_INT) floatFromVal (lval) +
+          (TYPE_TARGET_INT) floatFromVal (rval);
     }
   return cheapestVal (val);
 }
@@ -1514,20 +1564,20 @@ valMinus (value * lval, value * rval)
   else  if (SPEC_LONG (val->type))
     {
       if (SPEC_USIGN (val->type))
-        SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) -
-          (TYPE_UDWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) -
+          (TYPE_TARGET_ULONG) floatFromVal (rval);
       else
-        SPEC_CVAL (val->type).v_long = (TYPE_DWORD) floatFromVal (lval) -
-          (TYPE_DWORD) floatFromVal (rval);
+        SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG) floatFromVal (lval) -
+          (TYPE_TARGET_LONG) floatFromVal (rval);
     }
   else
    {
      if (SPEC_USIGN (val->type))
-       SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) floatFromVal (lval) -
-         (TYPE_UWORD) floatFromVal (rval);
+       SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) floatFromVal (lval) -
+         (TYPE_TARGET_UINT) floatFromVal (rval);
      else
-       SPEC_CVAL (val->type).v_int = (TYPE_WORD) floatFromVal (lval) -
-         (TYPE_WORD) floatFromVal (rval);
+       SPEC_CVAL (val->type).v_int = (TYPE_TARGET_INT) floatFromVal (lval) -
+         (TYPE_TARGET_INT) floatFromVal (rval);
     }
   return cheapestVal (val);
 }
@@ -1548,7 +1598,7 @@ valShift (value * lval, value * rval, int lr)
                                         'S');
   SPEC_SCLS (val->etype) = S_LITERAL; /* will remain literal */
 
-  if (getSize (val->type) * 8 <= (TYPE_UDWORD) floatFromVal (rval) &&
+  if (getSize (val->type) * 8 <= (TYPE_TARGET_ULONG) floatFromVal (rval) &&
        /* left shift */
       (lr ||
         /* right shift and unsigned */
@@ -1562,14 +1612,14 @@ valShift (value * lval, value * rval, int lr)
       if (SPEC_USIGN (val->type))
         {
           SPEC_CVAL (val->type).v_ulong = lr ?
-            (TYPE_UDWORD) floatFromVal (lval) << (TYPE_UDWORD) floatFromVal (rval) : \
-            (TYPE_UDWORD) floatFromVal (lval) >> (TYPE_UDWORD) floatFromVal (rval);
+            (TYPE_TARGET_ULONG) floatFromVal (lval) << (TYPE_TARGET_ULONG) floatFromVal (rval) : \
+            (TYPE_TARGET_ULONG) floatFromVal (lval) >> (TYPE_TARGET_ULONG) floatFromVal (rval);
         }
       else
         {
           SPEC_CVAL (val->type).v_long = lr ?
-            (TYPE_DWORD) floatFromVal (lval) << (TYPE_UDWORD) floatFromVal (rval) : \
-            (TYPE_DWORD) floatFromVal (lval) >> (TYPE_UDWORD) floatFromVal (rval);
+            (TYPE_TARGET_LONG) floatFromVal (lval) << (TYPE_TARGET_ULONG) floatFromVal (rval) : \
+            (TYPE_TARGET_LONG) floatFromVal (lval) >> (TYPE_TARGET_ULONG) floatFromVal (rval);
         }
     }
   else
@@ -1577,14 +1627,14 @@ valShift (value * lval, value * rval, int lr)
       if (SPEC_USIGN (val->type))
         {
           SPEC_CVAL (val->type).v_uint = lr ?
-            (TYPE_UWORD) floatFromVal (lval) << (TYPE_UDWORD) floatFromVal (rval) : \
-            (TYPE_UWORD) floatFromVal (lval) >> (TYPE_UDWORD) floatFromVal (rval);
+            (TYPE_TARGET_UINT) floatFromVal (lval) << (TYPE_TARGET_ULONG) floatFromVal (rval) : \
+            (TYPE_TARGET_UINT) floatFromVal (lval) >> (TYPE_TARGET_ULONG) floatFromVal (rval);
         }
       else
         {
           SPEC_CVAL (val->type).v_int = lr ?
-            (TYPE_WORD) floatFromVal (lval) << (TYPE_UDWORD) floatFromVal (rval) : \
-            (TYPE_WORD) floatFromVal (lval) >> (TYPE_UDWORD) floatFromVal (rval);
+            (TYPE_TARGET_INT) floatFromVal (lval) << (TYPE_TARGET_ULONG) floatFromVal (rval) : \
+            (TYPE_TARGET_INT) floatFromVal (lval) >> (TYPE_TARGET_ULONG) floatFromVal (rval);
         }
     }
   return cheapestVal (val);
@@ -1639,10 +1689,10 @@ valCompare (value * lval, value * rval, int ctype)
       else
         {
           /* integrals: ignore signedness */
-          TYPE_UDWORD l, r;
+          TYPE_TARGET_ULONG l, r;
 
-          l = (TYPE_UDWORD) floatFromVal (lval);
-          r = (TYPE_UDWORD) floatFromVal (rval);
+          l = (TYPE_TARGET_ULONG) floatFromVal (lval);
+          r = (TYPE_TARGET_ULONG) floatFromVal (rval);
           /* In order to correctly compare 'signed int' and 'unsigned int' it's
              neccessary to strip them to 16 bit.
              Literals are reduced to their cheapest type, therefore left and
@@ -1651,8 +1701,8 @@ valCompare (value * lval, value * rval, int ctype)
           if (!IS_LONG (lval->etype) &&
               !IS_LONG (rval->etype))
             {
-              r = (TYPE_UWORD) r;
-              l = (TYPE_UWORD) l;
+              r = (TYPE_TARGET_UINT) r;
+              l = (TYPE_TARGET_UINT) l;
             }
           SPEC_CVAL (val->type).v_int = l == r;
         }
@@ -1672,10 +1722,10 @@ valCompare (value * lval, value * rval, int ctype)
       else
         {
           /* integrals: ignore signedness */
-          TYPE_UDWORD l, r;
+          TYPE_TARGET_ULONG l, r;
 
-          l = (TYPE_UDWORD) floatFromVal (lval);
-          r = (TYPE_UDWORD) floatFromVal (rval);
+          l = (TYPE_TARGET_ULONG) floatFromVal (lval);
+          r = (TYPE_TARGET_ULONG) floatFromVal (rval);
           /* In order to correctly compare 'signed int' and 'unsigned int' it's
              neccessary to strip them to 16 bit.
              Literals are reduced to their cheapest type, therefore left and
@@ -1684,8 +1734,8 @@ valCompare (value * lval, value * rval, int ctype)
           if (!IS_LONG (lval->etype) &&
               !IS_LONG (rval->etype))
             {
-              r = (TYPE_UWORD) r;
-              l = (TYPE_UWORD) l;
+              r = (TYPE_TARGET_UINT) r;
+              l = (TYPE_TARGET_UINT) l;
             }
           SPEC_CVAL (val->type).v_int = l != r;
         }
@@ -1716,19 +1766,20 @@ valBitwise (value * lval, value * rval, int op)
       if (SPEC_LONG (val->type))
         {
           if (SPEC_USIGN (val->type))
-            SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) &
-              (TYPE_UDWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) &
+              (TYPE_TARGET_ULONG) floatFromVal (rval);
           else
-            SPEC_CVAL (val->type).v_long = (TYPE_DWORD) floatFromVal (lval) &
-              (TYPE_DWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG) floatFromVal (lval) &
+              (TYPE_TARGET_LONG) floatFromVal (rval);
         }
       else
         {
           if (SPEC_USIGN (val->type))
-            SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) floatFromVal (lval) &
-              (TYPE_UWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) floatFromVal (lval) &
+              (TYPE_TARGET_UINT) floatFromVal (rval);
           else
-            SPEC_CVAL (val->type).v_int = (TYPE_WORD) floatFromVal (lval) & (TYPE_WORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_int = (TYPE_TARGET_INT) floatFromVal (lval) &
+              (TYPE_TARGET_INT) floatFromVal (rval);
         }
       break;
 
@@ -1736,20 +1787,20 @@ valBitwise (value * lval, value * rval, int op)
       if (SPEC_LONG (val->type))
         {
           if (SPEC_USIGN (val->type))
-            SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) |
-              (TYPE_UDWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) |
+              (TYPE_TARGET_ULONG) floatFromVal (rval);
           else
-            SPEC_CVAL (val->type).v_long = (TYPE_DWORD) floatFromVal (lval) |
-              (TYPE_DWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG) floatFromVal (lval) |
+              (TYPE_TARGET_LONG) floatFromVal (rval);
         }
       else
         {
           if (SPEC_USIGN (val->type))
-            SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) floatFromVal (lval) |
-              (TYPE_UWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) floatFromVal (lval) |
+              (TYPE_TARGET_UINT) floatFromVal (rval);
           else
             SPEC_CVAL (val->type).v_int =
-              (TYPE_WORD) floatFromVal (lval) | (TYPE_WORD) floatFromVal (rval);
+              (TYPE_TARGET_INT) floatFromVal (lval) | (TYPE_TARGET_INT) floatFromVal (rval);
         }
 
       break;
@@ -1758,20 +1809,20 @@ valBitwise (value * lval, value * rval, int op)
       if (SPEC_LONG (val->type))
         {
           if (SPEC_USIGN (val->type))
-            SPEC_CVAL (val->type).v_ulong = (TYPE_UDWORD) floatFromVal (lval) ^
-              (TYPE_UDWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_ulong = (TYPE_TARGET_ULONG) floatFromVal (lval) ^
+              (TYPE_TARGET_ULONG) floatFromVal (rval);
           else
-            SPEC_CVAL (val->type).v_long = (TYPE_DWORD) floatFromVal (lval) ^
-              (TYPE_DWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_long = (TYPE_TARGET_LONG) floatFromVal (lval) ^
+              (TYPE_TARGET_LONG) floatFromVal (rval);
         }
       else
         {
           if (SPEC_USIGN (val->type))
-            SPEC_CVAL (val->type).v_uint = (TYPE_UWORD) floatFromVal (lval) ^
-              (TYPE_UWORD) floatFromVal (rval);
+            SPEC_CVAL (val->type).v_uint = (TYPE_TARGET_UINT) floatFromVal (lval) ^
+              (TYPE_TARGET_UINT) floatFromVal (rval);
           else
             SPEC_CVAL (val->type).v_int =
-              (TYPE_WORD) floatFromVal (lval) ^ (TYPE_WORD) floatFromVal (rval);
+              (TYPE_TARGET_INT) floatFromVal (lval) ^ (TYPE_TARGET_INT) floatFromVal (rval);
         }
       break;
     }
@@ -1816,7 +1867,7 @@ value *
 valCastLiteral (sym_link * dtype, double fval)
 {
   value *val;
-  TYPE_UDWORD l = (TYPE_UDWORD)fval;
+  TYPE_TARGET_ULONG l = (TYPE_TARGET_ULONG)fval;
 
   if (!dtype)
     return NULL;
@@ -1856,14 +1907,14 @@ valCastLiteral (sym_link * dtype, double fval)
   } else {
       if (SPEC_LONG (val->etype)) {
           if (SPEC_USIGN (val->etype))
-              SPEC_CVAL (val->etype).v_ulong = (TYPE_UDWORD) l;
+              SPEC_CVAL (val->etype).v_ulong = (TYPE_TARGET_ULONG) l;
           else
-              SPEC_CVAL (val->etype).v_long = (TYPE_DWORD) l;
+              SPEC_CVAL (val->etype).v_long = (TYPE_TARGET_LONG) l;
       } else {
           if (SPEC_USIGN (val->etype))
-              SPEC_CVAL (val->etype).v_uint = (TYPE_UWORD)l;
+              SPEC_CVAL (val->etype).v_uint = (TYPE_TARGET_UINT)l;
           else
-              SPEC_CVAL (val->etype).v_int = (TYPE_WORD)l;
+              SPEC_CVAL (val->etype).v_int = (TYPE_TARGET_INT)l;
       }
   }
   return val;
index 700540286db6c1acc0c0914aaadcf495272dbdc5..27950882065d6d31391d0ec78c9920b0d20a5906 100644 (file)
@@ -95,6 +95,13 @@ value *charVal (char *);
 value *symbolVal (symbol *);
 void printVal (value *);
 double floatFromVal (value *);
+
+/* convert a fixed16x16 type to double */
+double doubleFromFixed16x16(TYPE_TARGET_ULONG value);
+
+/* convert a double type to fixed16x16 */
+TYPE_TARGET_ULONG fixed16x16FromDouble(double value);
+
 CCR_RESULT checkConstantRange (sym_link *var, sym_link *lit, int op, bool exchangeOps);
 value *array2Ptr (value *);
 value *valUnaryPM (value *);
index ae25d32950f3694444beb4802b53a59722dfbf11..64b0109a34a77296a46ded98d57eec6e93da9172 100644 (file)
@@ -1662,6 +1662,7 @@ aopGet (operand * oper,
 /* aopPutUsesAcc - indicates ahead of time whether aopPut() will   */
 /*                 clobber the accumulator                         */
 /*-----------------------------------------------------------------*/
+#if 0
 static bool
 aopPutUsesAcc (operand * oper, const char *s, int offset)
 {
@@ -1700,6 +1701,7 @@ aopPutUsesAcc (operand * oper, const char *s, int offset)
       return FALSE;
     }
 }
+#endif
 
 /*-----------------------------------------------------------------*/
 /* aopPut - puts a string for a aop and indicates if acc is in use */
index f39dbc62cc14f7c465e0b5903ed55ff666a5b133..d05c2ad08a9a94ec6fec91ee6ba9fbf2c824ed66 100644 (file)
@@ -707,7 +707,7 @@ asmLineNodeFromLineNode (lineNode *ln, int currentDPS)
   asmLineNode *aln = ds390newAsmLineNode(currentDPS);
   char *op, op1[256], op2[256];
   int opsize;
-  const unsigned char *p;
+  const char *p;
   char inst[8];
   ds390opcodedata *opdat;
 
index 7cd5870cc0935184d7fb2af5b77a60b74de5f3aa..f69b12c2f29f1385bc897c1d74ed0f9ce0e7e009 100644 (file)
@@ -959,6 +959,7 @@ static regs *getRegGprNoSpil()
 /*-----------------------------------------------------------------*/
 /* getRegBitNoSpil - get it cannot be spilt                        */
 /*-----------------------------------------------------------------*/
+#if 0
 static regs *getRegBitNoSpil()
 {
   regs *reg;
@@ -976,6 +977,7 @@ static regs *getRegBitNoSpil()
   /* just to make the compiler happy */
   return 0;
 }
+#endif
 
 /*-----------------------------------------------------------------*/
 /* symHasReg - symbol has a given register                         */
index 2c40c925ee4f206d5a715b4582a9200467adb2c1..995b78763b3f8a0353d4d2b566ee7da231868015 100644 (file)
@@ -3141,8 +3141,8 @@ hc08_assignRegisters (ebbIndex * ebbi)
   /* free up any _G.stackSpil locations allocated */
   applyToSet (_G.stackSpil, deallocStackSpil);
   _G.slocNum = 0;
-  setToNull ((void **) &_G.stackSpil);
-  setToNull ((void **) &_G.spiltSet);
+  setToNull ((void *) &_G.stackSpil);
+  setToNull ((void *) &_G.spiltSet);
   /* mark all registers as free */
   freeAllRegs ();
 
index 40dcc69e5c3291711f5de13b724e2264d8287f29..71277b9a25d5c8fcfacdeb9c24caaecd6b692f9e 100644 (file)
@@ -590,7 +590,7 @@ asmLineNodeFromLineNode (lineNode *ln)
   asmLineNode *aln = newAsmLineNode();
   char *op, op1[256], op2[256];
   int opsize;
-  const unsigned char *p;
+  const char *p;
   char inst[8];
   mcs51opcodedata *opdat;
 
index ecd1867ca027f20796cd0b5f98707af236b2902d..508d890fbb7669c4b40e458229bc78e758fc60a0 100755 (executable)
@@ -97,7 +97,7 @@ void bailOut (char *mesg) {
 static void emitcode (char *inst, char *fmt,...) {
   va_list ap;
   char lb[INITIAL_INLINEASM];
-  unsigned char *lbp = lb;
+  char *lbp = lb;
 
   va_start (ap, fmt);
 
index c9e326c6ab8886e6230fb2599da447ee174d01be..ac0d124b5685e071839b972532f723ae18037250 100755 (executable)
@@ -127,7 +127,7 @@ regs *xa51_regWithMask (unsigned long mask) {
 /* checkRegsMask - check the consistancy of the regMask redundancy */
 /*-----------------------------------------------------------------*/
 
-void checkRegMask(char *f) { // for debugging purposes only
+void checkRegMask(const char *f) { // for debugging purposes only
   int i;
   unsigned long regMask=0;
   
index f1c6a241a5471ea7a6c2d56861d2b7ab6335e33a..30d500eb8eed3f0427ca013ffa2b9fd4b18c9548 100644 (file)
@@ -463,7 +463,7 @@ _emit2 (const char *inst, const char *fmt,...)
 {
   va_list ap;
   char lb[INITIAL_INLINEASM];
-  unsigned char *lbp = lb;
+  char *lbp = lb;
 
   va_start (ap, fmt);
 
index 004a2f7c38f627358f380365c792e49773f5d0b2..b78d99aac17b20736a6e3eda39af189a3cfd3fe8 100644 (file)
@@ -45,9 +45,9 @@ set *binPathSet = NULL; /* set of binary paths */
  */
 
 static void
-split_command(const unsigned char *cmd_line, char **command, char **params)
+split_command(const char *cmd_line, char **command, char **params)
 {
-  const unsigned char *p, *cmd_start;
+  const char *p, *cmd_start;
   char delim;
   char *str;
   unsigned len;
index 779966a5190acc7f0fef803aafd771baaf94717e..5e41925e4c98e8f9ad5547d3d45658007bd98b1e 100644 (file)
@@ -261,7 +261,7 @@ int writeRecord(unsigned len, unsigned offset, unsigned type,
 #define OUTPUT_CHUNK 16                
 static unsigned pendingLen = 0;
 static unsigned pendingOffset = 0;
-static char    pending[MAX_INPUT_COOKED + OUTPUT_CHUNK];
+static Uint8   pending[MAX_INPUT_COOKED + OUTPUT_CHUNK];
 
 /* Buffer up a data record. */
 int bufferOutput(Line *line)
index a469b93af99936c2528ed1042359fff2620f75c1..2445c4f39e7245dc652edc156562f9b09af8f7a0 100644 (file)
@@ -36,8 +36,8 @@ struct
   char c2;
 } pack_test;
 
-TYPE_DWORD
-mullong_wrapper (TYPE_DWORD a, TYPE_DWORD b)
+TYPE_TARGET_LONG
+mullong_wrapper (TYPE_TARGET_LONG a, TYPE_TARGET_LONG b)
 {
   if (sizeof(pack_test) == 4)
     /* length of struct ok: use SDCC library */
@@ -51,8 +51,8 @@ mullong_wrapper (TYPE_DWORD a, TYPE_DWORD b)
 
 #else
 
-TYPE_DWORD
-mullong_wrapper (TYPE_DWORD a, TYPE_DWORD b)
+TYPE_TARGET_LONG
+mullong_wrapper (TYPE_TARGET_LONG a, TYPE_TARGET_LONG b)
 {
     return a * b;
 }