aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/vax
diff options
context:
space:
mode:
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>2002-01-15 22:37:00 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2002-01-15 22:37:00 +0000
commit5c41fdfb418ef48ef2d6d82adacd178bbf77db7f (patch)
tree1b026c2aa4a23dafa1d649ca4beed2195517c7ef /gcc/config/vax
parentde097a2d7d044caf6841fa395bb322d4ef8ba841 (diff)
downloadgcc-5c41fdfb418ef48ef2d6d82adacd178bbf77db7f.zip
gcc-5c41fdfb418ef48ef2d6d82adacd178bbf77db7f.tar.gz
gcc-5c41fdfb418ef48ef2d6d82adacd178bbf77db7f.tar.bz2
vax.c (vax_rtx_cost): Return MAX_COST for unsupported MULT, UDIV and UMOD modes.
* 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. From-SVN: r48882
Diffstat (limited to 'gcc/config/vax')
-rw-r--r--gcc/config/vax/vax.c11
-rw-r--r--gcc/config/vax/vax.h6
-rw-r--r--gcc/config/vax/vax.md26
3 files changed, 22 insertions, 21 deletions
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 669e18b..8be850a 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 288e330..47a0866 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 4280ac6..c194279 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);
}")