]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vax.c (vax_address_cost, [...]): Correct casts.
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Tue, 28 Dec 2004 05:29:25 +0000 (05:29 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 28 Dec 2004 05:29:25 +0000 (05:29 +0000)
* vax.c (vax_address_cost, vax_rtx_cost): Correct casts.
(vax_rtx_cost): Handle small offsets for both PLUS and MINUS.

From-SVN: r92663

gcc/ChangeLog
gcc/config/vax/vax.c

index da7a7a6258808361e867f99799537d5ea403f7a4..8b04dbf5641b018cf09cda4188c5a1fa56204629 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-27 John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * vax.c (vax_address_cost, vax_rtx_cost): Correct casts.
+       (vax_rtx_cost): Handle small offsets for both PLUS and MINUS.
+
 2004-12-27  Steven Bosscher  <stevenb@suse.de>
            John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
index f572652fadee77b330cb3d3886560f0509809c7e..5ff0856116906a1093f90b5effbc83454d3ddaf2 100644 (file)
@@ -467,7 +467,7 @@ vax_address_cost_1 (register rtx addr)
     case CONST_INT:
       /* byte offsets cost nothing (on a VAX 2, they cost 1 cycle) */
       if (offset == 0)
-       offset = (unsigned)(INTVAL(addr)+128) > 256;
+       offset = (unsigned HOST_WIDE_INT)(INTVAL(addr)+128) > 256;
       break;
     case CONST:
     case SYMBOL_REF:
@@ -637,13 +637,13 @@ vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code)
        fmt = "e";      /* all constant rotate counts are short */
       break;
     case PLUS:
-      /* Check for small negative integer operand: subl2 can be used with
-        a short positive constant instead.  */
-      if (GET_CODE (XEXP (x, 1)) == CONST_INT)
-       if ((unsigned)(INTVAL (XEXP (x, 1)) + 63) < 127)
-         fmt = "e";
     case MINUS:
       c = (mode == DFmode) ? 13 : 8;   /* 6/8 on VAX 9000, 16/15 on VAX 2 */
+      /* Small integer operands can use subl2 and addl2.  */
+      if ((GET_CODE (XEXP (x, 1)) == CONST_INT)
+         && (unsigned HOST_WIDE_INT)(INTVAL (XEXP (x, 1)) + 63) < 127)
+       fmt = "e";
+      break;
     case IOR:
     case XOR:
       c = 3;
@@ -653,7 +653,7 @@ vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code)
       c = 3;
       if (GET_CODE (XEXP (x, 0)) == CONST_INT)
        {
-         if ((unsigned)~INTVAL (XEXP (x, 0)) > 63)
+         if ((unsigned HOST_WIDE_INT)~INTVAL (XEXP (x, 0)) > 63)
            c = 4;
          fmt = "e";
          i = 1;
@@ -706,7 +706,8 @@ vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code)
       switch (code)
        {
        case CONST_INT:
-         if ((unsigned)INTVAL (op) > 63 && GET_MODE (x) != QImode)
+         if ((unsigned HOST_WIDE_INT)INTVAL (op) > 63
+             && GET_MODE (x) != QImode)
            c += 1;             /* 2 on VAX 2 */
          break;
        case CONST: