]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
predicates.md (ax_reg_operand): New predicate.
authorUros Bizjak <uros@kss-loka.si>
Mon, 21 Nov 2005 07:55:31 +0000 (08:55 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 21 Nov 2005 07:55:31 +0000 (08:55 +0100)
* config/i386/predicates.md (ax_reg_operand): New predicate.
(memory_displacement_only_operand): New predicate.
* config/i386/i386.md ("modrm" attribute): Return 0 if one
operand is AX register and the other operand is memory operand
with displacement only.

From-SVN: r107283

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/config/i386/predicates.md

index b4ff1f894458c198c652d880941edad39f77212c..c9e309ad0dd481b2e4118321d7dedaed0f149e78 100644 (file)
@@ -1,3 +1,11 @@
+2005-11-21  Uros Bizjak  <uros@kss-loka.si>
+
+       * config/i386/predicates.md (ax_reg_operand): New predicate.
+       (memory_displacement_only_operand): New predicate.
+       * config/i386/i386.md ("modrm" attribute): Return 0 if one
+       operand is AX register and the other operand is memory operand
+       with displacement only.
+
 2005-11-21  Uros Bizjak  <uros@kss-loka.si>
 
        * fold-const.c (fold_binary) <RDIV_EXPR>: Optimize A / A to 1.0 
index b739e5004971ae9c36d992e63b08a50bd5b4790d..00ba8293e2cc23d90772d739ace09a97e3315e03 100644 (file)
              (not (match_operand 0 "memory_operand" "")))
           (const_int 0)
         (and (eq_attr "type" "imov")
-             (and (match_operand 0 "register_operand" "")
-                  (match_operand 1 "immediate_operand" "")))
+             (ior (and (match_operand 0 "register_operand" "")
+                       (match_operand 1 "immediate_operand" ""))
+                  (ior (and (match_operand 0 "ax_reg_operand" "")
+                            (match_operand 1 "memory_displacement_only_operand" ""))
+                       (and (match_operand 0 "memory_displacement_only_operand" "")
+                            (match_operand 1 "ax_reg_operand" "")))))
           (const_int 0)
         (and (eq_attr "type" "call")
              (match_operand 0 "constant_call_address_operand" ""))
index b61d2d25bde8057b2635f1d2e48a8130ff581a35..4a7d88a7f5d378d7b61a5fda8a757d88ac4ceda3 100644 (file)
   return REGNO (op) > LAST_VIRTUAL_REGISTER || REGNO (op) < 4;
 })
 
+;; Return true if op is the AX register.
+(define_predicate "ax_reg_operand"
+  (and (match_code "reg")
+       (match_test "REGNO (op) == 0")))
+
 ;; Return true if op is the flags register.
 (define_predicate "flags_reg_operand"
   (and (match_code "reg")
   return parts.disp != NULL_RTX;
 })
 
+;; Returns 1 if OP is memory operand with a displacement only.
+(define_predicate "memory_displacement_only_operand"
+  (match_operand 0 "memory_operand")
+{
+  struct ix86_address parts;
+  int ok;
+
+  ok = ix86_decompose_address (XEXP (op, 0), &parts);
+  gcc_assert (ok);
+
+  if (parts.base || parts.index)
+    return 0;
+
+  return parts.disp != NULL_RTX;
+})
+
 ;; Returns 1 if OP is memory operand that cannot be represented
 ;; by the modRM array.
 (define_predicate "long_memory_operand"