summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-15 22:37:00 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-15 22:37:00 +0000
commit10d15e22d582553b7a8afce0b654c6357d569e17 (patch)
tree1b026c2aa4a23dafa1d649ca4beed2195517c7ef
parent204ca66e9757c09e16bd375a5831abafc1c8f111 (diff)
downloadgcc-10d15e22d582553b7a8afce0b654c6357d569e17.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48882 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/vax/vax.c11
-rw-r--r--gcc/config/vax/vax.h6
-rw-r--r--gcc/config/vax/vax.md26
4 files changed, 35 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2ae5a60871d..52f1fb4287e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 669e18b79b4..8be850a0030 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -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:
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 288e330d1ba..47a086650b9 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -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 \
diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md
index 4280ac67893..c19427908df 100644
--- a/gcc/config/vax/vax.md
+++ b/gcc/config/vax/vax.md
@@ -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.
@@ -896,9 +896,9 @@
;; 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" "")))]
""
"
{
@@ -919,9 +919,9 @@
}")
(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" "")))]
""
"
{
@@ -935,15 +935,15 @@
}
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" "")))]
""
"
{
@@ -957,7 +957,7 @@
}
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);
}")