Patchwork [i386] Add minus to list of promotable operators

mail settings
Submitter Teresa Johnson
Date Nov. 2, 2011, 1:27 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/123266/
State New
Headers show


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/ 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  <>

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


Index: config/i386/
--- config/i386/	(revision 180696)
+++ config/i386/	(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"))))