aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/c4x/c4x-protos.h4
-rw-r--r--gcc/config/c4x/c4x.c28
-rw-r--r--gcc/config/c4x/c4x.h2
-rw-r--r--gcc/config/c4x/c4x.md22
5 files changed, 54 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 792843c..e374165 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-04 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+ * c4x-protos.h, c4x.h, c4x.c, c4x.md: Add new functions
+ nonimmediate_src_operand and nonimmediate_lsrc_operand to
+ disallow ZERO_EXTEND with CONST_INT or CONST_DOUBLE.
+
2002-03-03 Richard Henderson <rth@redhat.com>
* toplev.c (rest_of_decl_compilation): Revert last two changes.
diff --git a/gcc/config/c4x/c4x-protos.h b/gcc/config/c4x/c4x-protos.h
index d24a1f1..10ed818 100644
--- a/gcc/config/c4x/c4x-protos.h
+++ b/gcc/config/c4x/c4x-protos.h
@@ -157,6 +157,10 @@ extern int lsrc_operand PARAMS ((rtx, enum machine_mode));
extern int tsrc_operand PARAMS ((rtx, enum machine_mode));
+extern int nonimmediate_src_operand PARAMS ((rtx, enum machine_mode));
+
+extern int nonimmediate_lsrc_operand PARAMS ((rtx, enum machine_mode));
+
extern int addr_reg_operand PARAMS ((rtx, enum machine_mode));
extern int index_reg_operand PARAMS ((rtx, enum machine_mode));
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 6743990..e34ed5c 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -3465,6 +3465,34 @@ tsrc_operand (op, mode)
}
+/* Check src operand of two operand non immedidate instructions. */
+
+int
+nonimmediate_src_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT || GET_CODE (op) == CONST_DOUBLE)
+ return 0;
+
+ return src_operand (op, mode);
+}
+
+
+/* Check logical src operand of two operand non immedidate instructions. */
+
+int
+nonimmediate_lsrc_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT || GET_CODE (op) == CONST_DOUBLE)
+ return 0;
+
+ return lsrc_operand (op, mode);
+}
+
+
int
reg_or_const_operand (op, mode)
rtx op;
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index d9cd3da..9ada032 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -2288,6 +2288,8 @@ if (final_sequence != NULL_RTX) \
{"src_hi_operand", {SUBREG, REG, MEM, CONST_DOUBLE}}, \
{"lsrc_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE}}, \
{"tsrc_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE}}, \
+ {"nonimmediate_src_operand", {SUBREG, REG, MEM}}, \
+ {"nonimmediate_lsrc_operand", {SUBREG, REG, MEM}}, \
{"any_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE}}, \
{"par_ind_operand", {MEM}}, \
{"parallel_operand", {SUBREG, REG, MEM}}, \
diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md
index 242ed15..f7e44b1 100644
--- a/gcc/config/c4x/c4x.md
+++ b/gcc/config/c4x/c4x.md
@@ -2354,8 +2354,10 @@
(truncate:QI
(lshiftrt:HI
(mult:HI
- (zero_extend:HI (match_operand:QI 1 "src_operand" ""))
- (zero_extend:HI (match_operand:QI 2 "lsrc_operand" "")))
+ (zero_extend:HI (match_operand:QI 1
+ "nonimmediate_src_operand" ""))
+ (zero_extend:HI (match_operand:QI 2
+ "nonimmediate_lsrc_operand" "")))
(const_int 32))))
(clobber (reg:CC_NOOV 21))])]
""
@@ -2372,8 +2374,10 @@
(truncate:QI
(lshiftrt:HI
(mult:HI
- (zero_extend:HI (match_operand:QI 1 "src_operand" "%0,rR,rS<>,0,rR,rS<>"))
- (zero_extend:HI (match_operand:QI 2 "lsrc_operand" "rLm,JR,rS<>,rLm,JR,rS<>")))
+ (zero_extend:HI (match_operand:QI 1
+ "nonimmediate_src_operand" "%0,rR,rS<>,0,rR,rS<>"))
+ (zero_extend:HI (match_operand:QI 2
+ "nonimmediate_lsrc_operand" "rm,R,rS<>,rm,R,rS<>")))
(const_int 32))))
(clobber (reg:CC_NOOV 21))]
"! TARGET_C3X && valid_operands (MULT, operands, QImode)"
@@ -2392,8 +2396,10 @@
(truncate:QI
(lshiftrt:HI
(mult:HI
- (zero_extend:HI (match_operand:QI 1 "src_operand" "0,rR,rS<>"))
- (zero_extend:HI (match_operand:QI 2 "lsrc_operand" "rLm,JR,rS<>")))
+ (zero_extend:HI (match_operand:QI 1
+ "nonimmediate_src_operand" "0,rR,rS<>"))
+ (zero_extend:HI (match_operand:QI 2
+ "nonimmediate_lsrc_operand" "rm,R,rS<>")))
(const_int 32))))]
"! TARGET_C3X && valid_operands (MULT, operands, QImode)"
"@
@@ -6450,7 +6456,7 @@
(define_insn "zero_extendqihi2"
[(set (match_operand:HI 0 "reg_operand" "=?dc")
- (zero_extend:HI (match_operand:QI 1 "src_operand" "rIm")))
+ (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "rm")))
(clobber (reg:CC 21))]
""
"#"
@@ -6460,7 +6466,7 @@
; the first set.
(define_split
[(set (match_operand:HI 0 "reg_operand" "")
- (zero_extend:HI (match_operand:QI 1 "src_operand" "")))
+ (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "")))
(clobber (reg:CC 21))]
"reload_completed"
[(set (match_dup 2) (match_dup 1))