(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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107283
138bc75d-0d04-0410-961f-
82ee72b054a4
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
if we don't care about NaNs or Infinities.
(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" ""))
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"