[i386] Add minus to list of promotable operators

Message ID CAAe5K+UP9=n5h5GhXaCCocPALYgF2dkmyGK4vkj3X+guWPASOA@mail.gmail.com
State New
Headers show

Commit Message

Teresa Johnson Nov. 2, 2011, 1:27 p.m.
Currently gcc will promote from QI/HI mode to SI mode various
operators but not minus. It will however promote a neg followed by an
add (add is in the current list of promotable operators and neg is
promoted around config/i386/i386.md:16904). This omission can cause
RAT stalls in tight loops.

Successfully bootstrapped and checked with x86_64-unknown-linux-gnu.
Could someone please review the change?


2011-11-02  Teresa Johnson  <tejohnson@google.com>

        * config/i386/predicates.md (promotable_binary_operator): Add minus
        to the list of promotable operators.


Index: config/i386/predicates.md
--- config/i386/predicates.md	(revision 180696)
+++ config/i386/predicates.md	(working copy)
@@ -1162,7 +1162,7 @@ 

 ;; Return true if OP is a binary operator that can be promoted to wider mode.
 (define_predicate "promotable_binary_operator"
-  (ior (match_code "plus,and,ior,xor,ashift")
+  (ior (match_code "plus,minus,and,ior,xor,ashift")
        (and (match_code "mult")
 	    (match_test "TARGET_TUNE_PROMOTE_HIMODE_IMUL"))))