OSDN Git Service

* vax.c (vax_rtx_cost): Return MAX_COST for unsupported MULT, UDIV
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Jan 2002 22:37:00 +0000 (22:37 +0000)
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Jan 2002 22:37:00 +0000 (22:37 +0000)
and UMOD modes.

* vax.h (INDEX_TERM_P): Restrict indexing to modes which have a size
less than or equal to eight bytes.

* vax.md (andsi3): Remove constraints and change SET destination
operand type to nonimmediate_operand.
(andhi3, andqi3): Likewise.  Don't clear high order bits of operand 1
when it is a CONST_INT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48882 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/vax/vax.c
gcc/config/vax/vax.h
gcc/config/vax/vax.md

index 2ae5a60..52f1fb4 100644 (file)
@@ -1,3 +1,16 @@
+2002-01-15  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * vax.c (vax_rtx_cost): Return MAX_COST for unsupported MULT, UDIV
+       and UMOD modes.
+
+       * vax.h (INDEX_TERM_P): Restrict indexing to modes which have a size
+       less than or equal to eight bytes.
+
+       * vax.md (andsi3): Remove constraints and change SET destination
+       operand type to nonimmediate_operand.
+       (andhi3, andqi3): Likewise.  Don't clear high order bits of operand 1
+       when it is a CONST_INT.
+
 2002-01-15  Jason Merrill  <jason@redhat.com>
 
        * c-common.def (FILE_STMT): New code.
index 669e18b..8be850a 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines for insn-output.c for VAX.
-   Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000
+   Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of GNU CC.
@@ -521,13 +521,12 @@ vax_rtx_cost (x)
          c = 10;               /* 3-4 on VAX 9000, 20-28 on VAX 2 */
          break;
        default:
-         /* Careful, init_expmed generates arbitrary rtx and
-            computes costs, so we can't abort.  */
-         c = 1000;
-         break;
+         return MAX_COST;      /* Mode is not supported.  */
        }
       break;
     case UDIV:
+      if (mode != SImode)
+       return MAX_COST;        /* Mode is not supported.  */
       c = 17;
       break;
     case DIV:
@@ -543,6 +542,8 @@ vax_rtx_cost (x)
       c = 23;
       break;
     case UMOD:
+      if (mode != SImode)
+       return MAX_COST;        /* Mode is not supported.  */
       c = 29;
       break;
     case FLOAT:
index 288e330..47a0866 100644 (file)
@@ -689,14 +689,14 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
       && GET_CODE (xfoob) == REG && REG_OK_FOR_BASE_P (xfoob))         \
     goto ADDR; }
 
-/* 1 if PROD is either a reg times size of mode MODE
-   or just a reg, if MODE is just one byte.
+/* 1 if PROD is either a reg times size of mode MODE and MODE is less
+   than or equal 8 bytes, or just a reg if MODE is one byte.
    This macro's expansion uses the temporary variables xfoo0 and xfoo1
    that must be declared in the surrounding context.  */
 #define INDEX_TERM_P(PROD, MODE)   \
 (GET_MODE_SIZE (MODE) == 1                                             \
  ? (GET_CODE (PROD) == REG && REG_OK_FOR_BASE_P (PROD))                        \
- : (GET_CODE (PROD) == MULT                                            \
+ : (GET_CODE (PROD) == MULT && GET_MODE_SIZE (MODE) <= 8               \
     &&                                                                 \
     (xfoo0 = XEXP (PROD, 0), xfoo1 = XEXP (PROD, 1),                   \
      ((((GET_CODE (xfoo0) == CONST_INT                                 \
index 4280ac6..c194279 100644 (file)
@@ -1,6 +1,6 @@
 ;; Machine description for GNU compiler, VAX Version
-;; Copyright (C) 1987, 1988, 1991, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1987, 1988, 1991, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+;; 2002 Free Software Foundation, Inc.
 
 ;; This file is part of GNU CC.
 
 \f
 ;; Bit-and on the VAX is done with a clear-bits insn.
 (define_expand "andsi3"
-  [(set (match_operand:SI 0 "general_operand" "=g")
-       (and:SI (not:SI (match_operand:SI 1 "general_operand" "g"))
-               (match_operand:SI 2 "general_operand" "g")))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "")
+       (and:SI (not:SI (match_operand:SI 1 "general_operand" ""))
+               (match_operand:SI 2 "general_operand" "")))]
   ""
   "
 {
 }")
 
 (define_expand "andhi3"
-  [(set (match_operand:HI 0 "general_operand" "=g")
-       (and:HI (not:HI (match_operand:HI 1 "general_operand" "g"))
-               (match_operand:HI 2 "general_operand" "g")))]
+  [(set (match_operand:HI 0 "nonimmediate_operand" "")
+       (and:HI (not:HI (match_operand:HI 1 "general_operand" ""))
+               (match_operand:HI 2 "general_operand" "")))]
   ""
   "
 {
     }
 
   if (GET_CODE (op1) == CONST_INT)
-    operands[1] = GEN_INT (65535 & ~INTVAL (op1));
+    operands[1] = GEN_INT (~INTVAL (op1));
   else
     operands[1] = expand_unop (HImode, one_cmpl_optab, op1, 0, 1);
 }")
 
 (define_expand "andqi3"
-  [(set (match_operand:QI 0 "general_operand" "=g")
-       (and:QI (not:QI (match_operand:QI 1 "general_operand" "g"))
-               (match_operand:QI 2 "general_operand" "g")))]
+  [(set (match_operand:QI 0 "nonimmediate_operand" "")
+       (and:QI (not:QI (match_operand:QI 1 "general_operand" ""))
+               (match_operand:QI 2 "general_operand" "")))]
   ""
   "
 {
    }
 
   if (GET_CODE (op1) == CONST_INT)
-    operands[1] = GEN_INT (255 & ~INTVAL (op1));
+    operands[1] = GEN_INT (~INTVAL (op1));
   else
     operands[1] = expand_unop (QImode, one_cmpl_optab, op1, 0, 1);
 }")