Commit 1c287121 by Uros Bizjak Committed by Uros Bizjak

predicates.md (ax_reg_operand): New predicate.

	* 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
parent ffbc33cc
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.
......
......@@ -314,8 +314,12 @@
(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" ""))
......
......@@ -75,6 +75,11 @@
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")
......@@ -741,6 +746,22 @@
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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment