+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.
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));
}
+/* 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;
{"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}}, \
(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))])]
""
(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)"
(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)"
"@
(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))]
""
"#"
; 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))