[Patch, i386] Add minus to list of promotable operators

2011-11-02 Thread Teresa Johnson
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?

Thanks,
Teresa

2011-11-02  Teresa Johnson  tejohn...@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



-- 
Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413


Re: [Patch, i386] Add minus to list of promotable operators

2011-11-02 Thread Uros Bizjak
Hello!

 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.

 2011-11-02  Teresa Johnson  tejohn...@google.com

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

OK for mainline.

Thanks,
Uros.