From patchwork Wed Nov 2 13:27:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [i386] Add minus to list of promotable operators Date: Wed, 02 Nov 2011 03:27:20 -0000 From: Teresa Johnson X-Patchwork-Id: 123266 Message-Id: To: gcc-patches@gcc.gnu.org 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 * 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"))))