(cmpstrsi): Rewrite expander to handle operands correctly.
authorJames Van Artsdalen <jrv@gnu.org>
Sun, 6 Sep 1992 10:36:53 +0000 (10:36 +0000)
committerJames Van Artsdalen <jrv@gnu.org>
Sun, 6 Sep 1992 10:36:53 +0000 (10:36 +0000)
From-SVN: r2060

gcc/config/i386/i386.md

index e2121260747b70f4af1da72a578ef3d7dd745b36..3edce9fa1784f986f5a80e7aee91741dc02d83b0 100644 (file)
 
 (define_expand "cmpstrsi"
   [(parallel [(set (match_operand:QI 0 "general_operand" "")
-                  (compare:CC
-                   (mem:BLK (match_operand:BLK 1 "address_operand" ""))
-                   (mem:BLK (match_operand:BLK 2 "address_operand" ""))))
+                  (compare:CC (match_operand:BLK 1 "general_operand" "")
+                              (match_operand:BLK 2 "general_operand" "")))
              (use (match_operand:SI 3 "general_operand" ""))
              (use (match_operand:SI 4 "immediate_operand" ""))
-             (clobber (match_dup 1))
-             (clobber (match_dup 2))
+             (clobber (match_dup 5))
+             (clobber (match_dup 6))
              (clobber (match_dup 3))])]
   ""
   "
 {
-  operands[1] = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
-  operands[2] = copy_to_mode_reg (SImode, XEXP (operands[2], 0));
+  rtx addr1, addr2;
+
+  addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
+  addr2 = copy_to_mode_reg (Pmode, XEXP (operands[2], 0));
   operands[3] = copy_to_mode_reg (SImode, operands[3]);
+
+  operands[5] = addr1;
+  operands[6] = addr2;
+
+  operands[1] = gen_rtx (MEM, BLKmode, addr1);
+  operands[2] = gen_rtx (MEM, BLKmode, addr2);
+
 }")
 
 ;; memcmp recognizers.  The `cmpsb' opcode does nothing if the count is