This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix another typo in i386.md cmpqi_minus_1
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Fix another typo in i386.md cmpqi_minus_1
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 17 Jan 2001 13:42:16 +0100
- Cc: jh at suse dot cz
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
Hi!
I'm sorry I have not done this together with the last patch, there was
another typo in cmpqi_minus_1 constraints, which I've commited a fix for
under obvious bugfix rule.
2001-01-17 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.md (cmpqi_minus_1): Use q constraints instead of r.
* gcc.c-torture/compile/20010117-2.c: New test.
--- gcc/config/i386/i386.md.jj Wed Jan 17 13:45:34 2001
+++ gcc/config/i386/i386.md Wed Jan 17 14:24:28 2001
@@ -1154,8 +1154,8 @@
(define_insn "*cmpqi_minus_1"
[(set (reg 17)
- (compare (minus:QI (match_operand:QI 0 "nonimmediate_operand" "rm,r")
- (match_operand:QI 1 "general_operand" "ri,mr"))
+ (compare (minus:QI (match_operand:QI 0 "nonimmediate_operand" "qm,q")
+ (match_operand:QI 1 "general_operand" "qi,mq"))
(const_int 0)))]
"ix86_match_ccmode (insn, CCGOCmode)"
"cmp{b}\\t{%1, %0|%0, %1}"
--- gcc/testsuite/gcc.c-torture/compile/20010117-2.c.jj Wed Jan 17 14:26:45 2001
+++ gcc/testsuite/gcc.c-torture/compile/20010117-2.c Wed Jan 17 14:18:13 2001
@@ -0,0 +1,20 @@
+unsigned char a, b;
+
+void baz (void)
+{
+ if (b & 0x08)
+ {
+ int g = 0;
+ int c = (b & 0x01);
+ int d = a - g - c;
+ int e = (a & 0x0f) - (g & 0x0f);
+ int f = (a & 0xf0) - (g & 0xf0);
+ int h = (a & 0x0f) - (g & 0x0f);
+
+ if ((a ^ g) & (a ^ d) & 0x80) b |= 0x40;
+ if ((d & 0xff00) == 0) b |= 0x01;
+ if (!((a - h - c) & 0xff)) b |= 0x02;
+ if ((a - g - c) & 0x80) b |= 0x80;
+ a = (e & 0x0f) | (f & 0xf0);
+ }
+}
Jakub