This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix "and" patterns on VAX
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Jan 2002 17:52:56 -0500 (EST)
- Subject: Fix "and" patterns on VAX
The following patch cleans up the "and" expanders on the VAX. The
principal fix is to not clear the high order bits of operand 1 in
andhi3 and andqi3. These cause invalid insns to be generated in
compile/981010-1.c and compile/20010423-1.c at -O0. Tested on
vax-dec-ultrix4.3.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2002-01-15 John David Anglin <dave@hiauly1.hia.nrc.ca>
* 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.
--- vax.md.orig Fri Nov 16 17:26:39 2001
+++ vax.md Tue Dec 11 16:15:33 2001
@@ -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);
}")