]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Remove TARGET_SHIFT1 tuning feature
authorUros Bizjak <ubizjak@gmail.com>
Thu, 14 May 2026 16:38:46 +0000 (18:38 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Wed, 20 May 2026 09:58:14 +0000 (11:58 +0200)
All supported versions of GNU as automatically encode "sal $1, reg"
using the shorter implicit-count-1 form (opcode D1), making the
compiler-side i486 TARGET_SHIFT1 / X86_TUNE_SHIFT1 logic redundant.

Remove the tuning feature and simplify all affected shift instruction
patterns by unconditionally emitting the explicit-immediate form and
relying on the assembler to produce the optimal encoding.  Update the
length_immediate attributes accordingly to report 0 for const-1 shift
counts, correctly reflecting the assembled output.

gcc/ChangeLog:

* config/i386/x86-tune.def (X86_TUNE_SHIFT1): Remove.
* config/i386/i386.h (TARGET_SHIFT1): Remove.
* config/i386/i386.md (*ashl<mode>3_1<nf_name>): Remove
TARGET_SHIFT1-gated implicit-1 encoding and simplify
length_immediate attribute.
(*ashlsi3_1_zext): Likewise.
(*ashlhi3_1<nf_name>): Likewise.
(*ashlqi3_1<nf_name>): Likewise.
(*ashl<mode>3_1_slp): Likewise.
(*ashl<mode>3_cmp): Likewise.
(*ashlsi3_cmp): Likewise.
(*<any_shiftrt:insn><mode>3_1<nf_name>): Likewise.
(*<any_shiftrt:insn>si3_1_zext): Likewise.
(*<any_shiftrt:insn><mode>3_1_slp): Likewise.
(*<any_shiftrt:insn><mode>3_cconly): Likewise.
(*<any_shiftrt:insn>qi_ext<mode>_1): Likewise.
(<any_shiftrt:insn><mode>3_carry): Likewise.

gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/config/i386/x86-tune.def

index 21108f39938444b2bea2d18eaf0eba475e506bee..ac3f2213e78132007c97fcec668d5e743cb350c3 100644 (file)
@@ -401,7 +401,6 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
        ix86_tune_features[X86_TUNE_PROLOGUE_USING_MOVE]
 #define TARGET_EPILOGUE_USING_MOVE \
        ix86_tune_features[X86_TUNE_EPILOGUE_USING_MOVE]
-#define TARGET_SHIFT1          ix86_tune_features[X86_TUNE_SHIFT1]
 #define TARGET_USE_FFREEP      ix86_tune_features[X86_TUNE_USE_FFREEP]
 #define TARGET_INTER_UNIT_MOVES_TO_VEC \
        ix86_tune_features[X86_TUNE_INTER_UNIT_MOVES_TO_VEC]
index 7faff1e851383a0d81ff29916bec337b78ce5541..063e14cb2c179111728d642c5f8d824417d57492 100644 (file)
       return "<nf_prefix>add{<imodesuffix>}\t%0, %0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         /* For NDD form instructions related to TARGET_SHIFT1, the $1
-            immediate do not need to be omitted as assembler will map it
-            to use shorter encoding. */
-         && !use_ndd && !<nf_applied>)
-       return "sal{<imodesuffix>}\t%0";
-      else
-       return use_ndd ? "<nf_prefix>sal{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                      : "<nf_prefix>sal{<imodesuffix>}\t{%2, %0|%0, %2}";
+      return use_ndd ? "<nf_prefix>sal{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                    : "<nf_prefix>sal{<imodesuffix>}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,*,bmi2,avx512bw,apx_ndd")
              (const_string "lea")
            (eq_attr "alternative" "2")
              (const_string "ishiftx")
+           (eq_attr "alternative" "3")
+             (const_string "msklog")
            (eq_attr "alternative" "4")
              (const_string "ishift")
-            (and (and (match_test "TARGET_DOUBLE_WITH_ADD")
+           (and (and (match_test "TARGET_DOUBLE_WITH_ADD")
                      (match_operand 0 "register_operand"))
                 (match_operand 2 "const1_operand"))
              (const_string "alu")
-           (eq_attr "alternative" "3")
-             (const_string "msklog")
           ]
           (const_string "ishift")))
    (set (attr "length_immediate")
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
       return "add{l}\t%k0, %k0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd)
-       return "sal{l}\t%k0";
-      else
-       return use_ndd ? "sal{l}\t{%2, %1, %k0|%k0, %1, %2}"
-                      : "sal{l}\t{%2, %k0|%k0, %2}";
+      return use_ndd ? "sal{l}\t{%2, %1, %k0|%k0, %1, %2}"
+                    : "sal{l}\t{%2, %k0|%k0, %2}";
     }
 }
   [(set_attr "isa" "*,*,bmi2,apx_ndd")
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "SI")])
       return "<nf_prefix>add{w}\t%0, %0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd && !<nf_applied>)
-       return "sal{w}\t%0";
-      else
-       return use_ndd ? "<nf_prefix>sal{w}\t{%2, %1, %0|%0, %1, %2}"
-                      : "<nf_prefix>sal{w}\t{%2, %0|%0, %2}";
+      return use_ndd ? "<nf_prefix>sal{w}\t{%2, %1, %0|%0, %1, %2}"
+                    : "<nf_prefix>sal{w}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,*,avx512f,apx_ndd")
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
        return "<nf_prefix>add{b}\t%0, %0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd && !<nf_applied>)
-       {
-         if (get_attr_mode (insn) == MODE_SI)
-           return "sal{l}\t%k0";
-         else
-           return "sal{b}\t%0";
-       }
+      if (get_attr_mode (insn) == MODE_SI)
+       return "<nf_prefix>sal{l}\t{%2, %k0|%k0, %2}";
       else
-       {
-         if (get_attr_mode (insn) == MODE_SI)
-           return "<nf_prefix>sal{l}\t{%2, %k0|%k0, %2}";
-         else
-           return use_ndd ? "<nf_prefix>sal{b}\t{%2, %1, %0|%0, %1, %2}"
-                          : "<nf_prefix>sal{b}\t{%2, %0|%0, %2}";
-       }
+       return use_ndd ? "<nf_prefix>sal{b}\t{%2, %1, %0|%0, %1, %2}"
+                      : "<nf_prefix>sal{b}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,*,*,avx512dq,apx_ndd")
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
       return "add{<imodesuffix>}\t%0, %0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
-       return "sal{<imodesuffix>}\t%0";
-      else
-       return "sal{<imodesuffix>}\t{%2, %0|%0, %2}";
+      return "sal{<imodesuffix>}\t{%2, %0|%0, %2}";
     }
 }
   "&& reload_completed
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "<MODE>")])
        (ashift:SWI (match_dup 1) (match_dup 2)))]
   "(optimize_function_for_size_p (cfun)
     || !TARGET_PARTIAL_FLAG_REG_STALL
-    || (operands[2] == const1_rtx
-       && (TARGET_SHIFT1
-           || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))
+    || operands[2] == const1_rtx)
    && ix86_match_ccmode (insn, CCGOCmode)
    && ix86_binary_operator_ok (ASHIFT, <MODE>mode, operands, TARGET_APX_NDD)"
 {
       return "add{<imodesuffix>}\t%0, %0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd)
-       return "sal{<imodesuffix>}\t%0";
-      else
-       return use_ndd ? "sal{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                      : "sal{<imodesuffix>}\t{%2, %0|%0, %2}";
+      return use_ndd ? "sal{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                    : "sal{<imodesuffix>}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,apx_ndd")
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "<MODE>")])
   "TARGET_64BIT
    && (optimize_function_for_size_p (cfun)
        || !TARGET_PARTIAL_FLAG_REG_STALL
-       || (operands[2] == const1_rtx
-          && (TARGET_SHIFT1
-              || TARGET_DOUBLE_WITH_ADD)))
+       || operands[2] == const1_rtx)
    && ix86_match_ccmode (insn, CCGOCmode)
    && ix86_binary_operator_ok (ASHIFT, SImode, operands, TARGET_APX_NDD)"
 {
       return "add{l}\t%k0, %k0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd)
-       return "sal{l}\t%k0";
-      else
-       return use_ndd ? "sal{l}\t{%2, %1, %k0|%k0, %1, %2}"
-                      : "sal{l}\t{%2, %k0|%k0, %2}";
+      return use_ndd ? "sal{l}\t{%2, %1, %k0|%k0, %1, %2}"
+                    : "sal{l}\t{%2, %k0|%k0, %2}";
     }
 }
   [(set_attr "isa" "*,apx_ndd")
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "SI")])
    (clobber (match_scratch:SWI 0 "=<r>,r"))]
   "(optimize_function_for_size_p (cfun)
     || !TARGET_PARTIAL_FLAG_REG_STALL
-    || (operands[2] == const1_rtx
-       && (TARGET_SHIFT1
-           || TARGET_DOUBLE_WITH_ADD)))
+    || operands[2] == const1_rtx)
    && ix86_match_ccmode (insn, CCGOCmode)"
 {
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
       gcc_assert (operands[2] == const1_rtx);
       return "add{<imodesuffix>}\t%0, %0";
 
-  default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd)
-       return "sal{<imodesuffix>}\t%0";
-      else
-       return use_ndd ? "sal{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                      : "sal{<imodesuffix>}\t{%2, %0|%0, %2}";
+    default:
+      return use_ndd ? "sal{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                    : "sal{<imodesuffix>}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,apx_ndd")
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "<MODE>")])
       return "add{b}\t%h0, %h0";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
-       return "sal{b}\t%h0";
-      else
-       return "sal{b}\t{%2, %h0|%h0, %2}";
+      return "sal{b}\t{%2, %h0|%h0, %2}";
     }
 }
   "reload_completed
      (if_then_else
        (ior (eq_attr "type" "alu")
            (and (eq_attr "type" "ishift")
-                (and (match_operand 2 "const1_operand")
-                     (ior (match_test "TARGET_SHIFT1")
-                          (match_test "optimize_function_for_size_p (cfun)")))))
+                (match_operand 2 "const1_operand")))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "QI")])
       return "#";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd && !<nf_applied>)
-       return "sar{<imodesuffix>}\t%0";
-      else
-       return use_ndd ? "<nf_prefix>sar{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                      : "<nf_prefix>sar{<imodesuffix>}\t{%2, %0|%0, %2}";
+      return use_ndd ? "<nf_prefix>sar{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                    : "<nf_prefix>sar{<imodesuffix>}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,bmi2,apx_ndd")
    (set_attr "type" "ishift,ishiftx,ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
       return "#";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd && !<nf_applied>)
-       return "shr{<imodesuffix>}\t%0";
-      else
-       return use_ndd ? "<nf_prefix>shr{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                      : "<nf_prefix>shr{<imodesuffix>}\t{%2, %0|%0, %2}";
+      return use_ndd ? "<nf_prefix>shr{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                    : "<nf_prefix>shr{<imodesuffix>}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,bmi2,avx512bw,apx_ndd")
    (set_attr "type" "ishift,ishiftx,msklog,ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (and (match_operand 2 "const1_operand")
-                (eq_attr "alternative" "0"))
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (and (eq_attr "type" "ishift")
+           (match_operand 2 "const1_operand"))
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
   switch (get_attr_type (insn))
     {
     case TYPE_ISHIFTX:
-      return "#";
-
     case TYPE_MSKLOG:
       return "#";
+
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd)
-       return "<shift>{l}\t%k0";
-      else
-       return use_ndd ? "<shift>{l}\t{%2, %1, %k0|%k0, %1, %2}"
-                      : "<shift>{l}\t{%2, %k0|%k0, %2}";
+      return use_ndd ? "<shift>{l}\t{%2, %1, %k0|%k0, %1, %2}"
+                    : "<shift>{l}\t{%2, %k0|%k0, %2}";
     }
 }
   [(set_attr "isa" "*,bmi2,apx_ndd,avx512bw")
    (set_attr "type" "ishift,ishiftx,ishift,msklog")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (and (eq_attr "type" "ishift")
+           (match_operand 2 "const1_operand"))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "SI")
    && <nf_condition>"
 {
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-      && !use_ndd && !<nf_applied>)
-    return "sar{<imodesuffix>}\t%0";
-  else
-    return use_ndd ? "<nf_prefix>sar{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                  : "<nf_prefix>sar{<imodesuffix>}\t{%2, %0|%0, %2}";
+
+  return use_ndd ? "<nf_prefix>sar{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                : "<nf_prefix>sar{<imodesuffix>}\t{%2, %0|%0, %2}";
 }
   [(set_attr "isa" "*, apx_ndd")
    (set_attr "type" "ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
   switch (get_attr_type (insn))
     {
-    case TYPE_ISHIFT:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd && !<nf_applied>)
-       return "shr{b}\t%0";
-      else
-       return use_ndd ? "<nf_prefix>shr{b}\t{%2, %1, %0|%0, %1, %2}"
-                      : "<nf_prefix>shr{b}\t{%2, %0|%0, %2}";
     case TYPE_MSKLOG:
       return "#";
+
     default:
-      gcc_unreachable ();
+      return use_ndd ? "<nf_prefix>shr{b}\t{%2, %1, %0|%0, %1, %2}"
+                    : "<nf_prefix>shr{b}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,avx512dq,apx_ndd")
    (set_attr "type" "ishift,msklog,ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (and (match_operand 2 "const1_operand")
-                (eq_attr "alternative" "0"))
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (and (eq_attr "type" "ishift")
+           (match_operand 2 "const1_operand"))
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
   switch (get_attr_type (insn))
     {
-    case TYPE_ISHIFT:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd && !<nf_applied>)
-       return "shr{w}\t%0";
-      else
-       return use_ndd ? "<nf_prefix>shr{w}\t{%2, %1, %0|%0, %1, %2}"
-                      : "<nf_prefix>shr{w}\t{%2, %0|%0, %2}";
     case TYPE_MSKLOG:
       return "#";
+
     default:
-      gcc_unreachable ();
+      return use_ndd ? "<nf_prefix>shr{w}\t{%2, %1, %0|%0, %1, %2}"
+                    : "<nf_prefix>shr{w}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*, avx512f, apx_ndd")
    (set_attr "type" "ishift,msklog,ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (and (match_operand 2 "const1_operand")
-                (eq_attr "alternative" "0"))
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (and (eq_attr "type" "ishift")
+           (match_operand 2 "const1_operand"))
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
   if (which_alternative)
     return "#";
 
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
-    return "<shift>{<imodesuffix>}\t%0";
-  else
-    return "<shift>{<imodesuffix>}\t{%2, %0|%0, %2}";
+  return "<shift>{<imodesuffix>}\t{%2, %0|%0, %2}";
 }
   "&& reload_completed
    && !(rtx_equal_p (operands[0], operands[1]))"
   [(set_attr "type" "ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "<MODE>")])
        (any_shiftrt:SWI (match_dup 1) (match_dup 2)))]
   "(optimize_function_for_size_p (cfun)
     || !TARGET_PARTIAL_FLAG_REG_STALL
-    || (operands[2] == const1_rtx
-       && TARGET_SHIFT1))
+    || operands[2] == const1_rtx)
    && ix86_match_ccmode (insn, CCGOCmode)
    && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands, TARGET_APX_NDD)"
 {
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-      && !use_ndd)
-    return "<shift>{<imodesuffix>}\t%0";
-  else
-    return use_ndd ? "<shift>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                  : "<shift>{<imodesuffix>}\t{%2, %0|%0, %2}";
+  return use_ndd ? "<shift>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                : "<shift>{<imodesuffix>}\t{%2, %0|%0, %2}";
 }
   [(set_attr "isa" "*,apx_ndd")
    (set_attr "type" "ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "<MODE>")])
   "TARGET_64BIT
    && (optimize_function_for_size_p (cfun)
        || !TARGET_PARTIAL_FLAG_REG_STALL
-       || (operands[2] == const1_rtx
-          && TARGET_SHIFT1))
+       || operands[2] == const1_rtx)
    && ix86_match_ccmode (insn, CCGOCmode)
    && ix86_binary_operator_ok (<CODE>, SImode, operands, TARGET_APX_NDD)"
 {
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-      && !use_ndd)
-    return "<shift>{l}\t%k0";
-  else
-    return use_ndd ? "<shift>{l}\t{%2, %1, %k0|%k0, %1, %2}"
-                  : "<shift>{l}\t{%2, %k0|%k0, %2}";
+  return use_ndd ? "<shift>{l}\t{%2, %1, %k0|%k0, %1, %2}"
+                : "<shift>{l}\t{%2, %k0|%k0, %2}";
 }
   [(set_attr "isa" "*,apx_ndd")
    (set_attr "type" "ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "SI")])
    (clobber (match_scratch:SWI 0 "=<r>,r"))]
   "(optimize_function_for_size_p (cfun)
     || !TARGET_PARTIAL_FLAG_REG_STALL
-    || (operands[2] == const1_rtx
-       && TARGET_SHIFT1))
+    || operands[2] == const1_rtx)
    && ix86_match_ccmode (insn, CCGOCmode)"
 {
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-      && !use_ndd)
-    return "<shift>{<imodesuffix>}\t%0";
-  else
-    return use_ndd
-          ? "<shift>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-          : "<shift>{<imodesuffix>}\t{%2, %0|%0, %2}";
+  return use_ndd ? "<shift>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                : "<shift>{<imodesuffix>}\t{%2, %0|%0, %2}";
 }
   [(set_attr "isa" "*,apx_ndd")
    (set_attr "type" "ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "<MODE>")])
   if (which_alternative)
     return "#";
 
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
-    return "<shift>{b}\t%h0";
-  else
-    return "<shift>{b}\t{%2, %h0|%h0, %2}";
+  return "<shift>{b}\t{%2, %h0|%h0, %2}";
 }
   "reload_completed
    && !(rtx_equal_p (operands[0], operands[1]))"
   [(set_attr "type" "ishift")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "QI")])
        return "#";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd && !<nf_applied>)
-       return "<rotate>{<imodesuffix>}\t%0";
-      else
-       return use_ndd ? "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-                      : "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %0|%0, %2}";
+      return use_ndd ? "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                    : "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %0|%0, %2}";
     }
 }
   [(set_attr "isa" "*,bmi2,apx_ndd")
    (set (attr "length_immediate")
      (if_then_else
        (and (eq_attr "type" "rotate")
-           (and (match_operand 2 "const1_operand")
-                (ior (match_test "TARGET_SHIFT1")
-                     (match_test "optimize_function_for_size_p (cfun)"))))
+           (match_operand 2 "const1_operand"))
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
       return "#";
 
     default:
-      if (operands[2] == const1_rtx
-         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-         && !use_ndd)
-       return "<rotate>{l}\t%k0";
-      else
-       return use_ndd ? "<rotate>{l}\t{%2, %1, %k0|%k0, %1, %2}"
-                      : "<rotate>{l}\t{%2, %k0|%k0, %2}";
+      return use_ndd ? "<rotate>{l}\t{%2, %1, %k0|%k0, %1, %2}"
+                    : "<rotate>{l}\t{%2, %k0|%k0, %2}";
     }
 }
   [(set_attr "isa" "*,bmi2,apx_ndd")
    (set (attr "length_immediate")
      (if_then_else
        (and (eq_attr "type" "rotate")
-           (and (match_operand 2 "const1_operand")
-                (ior (match_test "TARGET_SHIFT1")
-                     (match_test "optimize_function_for_size_p (cfun)"))))
+           (match_operand 2 "const1_operand"))
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "SI")])
    && <nf_condition>"
 {
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-      && !use_ndd && !<nf_applied>)
-    return "<rotate>{<imodesuffix>}\t%0";
-  else
-    return use_ndd
-          ? "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
-          : "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %0|%0, %2}";
+  return use_ndd ? "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+                : "<nf_prefix><rotate>{<imodesuffix>}\t{%2, %0|%0, %2}";
 }
   [(set_attr "isa" "*,apx_ndd")
    (set_attr "type" "rotate")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "has_nf" "1")
   if (which_alternative)
     return "#";
 
-  if (operands[2] == const1_rtx
-      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
-    return "<rotate>{<imodesuffix>}\t%0";
-  else
-    return "<rotate>{<imodesuffix>}\t{%2, %0|%0, %2}";
+  return "<rotate>{<imodesuffix>}\t{%2, %0|%0, %2}";
 }
   "&& reload_completed
    && !(rtx_equal_p (operands[0], operands[1]))"
   [(set_attr "type" "rotate")
    (set (attr "length_immediate")
      (if_then_else
-       (and (match_operand 2 "const1_operand")
-           (ior (match_test "TARGET_SHIFT1")
-                (match_test "optimize_function_for_size_p (cfun)")))
+       (match_operand 2 "const1_operand")
        (const_string "0")
        (const_string "*")))
    (set_attr "mode" "<MODE>")])
   ""
 {
   bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
-  if ((TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
-      && !use_ndd)
-    return "<shift>{<imodesuffix>}\t%0";
   return use_ndd ? "<shift>{<imodesuffix>}\t{$1, %1, %0|%0, %1, 1}"
                 : "<shift>{<imodesuffix>}\t{$1, %0|%0, 1}";
 }
   [(set_attr "isa" "*, apx_ndd")
    (set_attr "type" "ishift1")
-   (set (attr "length_immediate")
-     (if_then_else
-       (ior (match_test "TARGET_SHIFT1")
-           (match_test "optimize_function_for_size_p (cfun)"))
-       (const_string "0")
-       (const_string "*")))
+   (set_attr "length_immediate" "0")
    (set_attr "mode" "<MODE>")])
 \f
 ;; Bit set / bit test instructions
index f5d9cd601c7d59ee038cdad9101637680d7128b1..04036ff04b538583b1e69dac2539f765fdfd6d5d 100644 (file)
@@ -682,10 +682,6 @@ DEF_TUNE (X86_TUNE_ALWAYS_FANCY_MATH_387, "always_fancy_math_387",
    is bad.  */
 DEF_TUNE (X86_TUNE_UNROLL_STRLEN, "unroll_strlen", ~m_386)
 
-/* X86_TUNE_SHIFT1: Enables use of short encoding of "sal reg" instead of
-   longer "sal $1, reg".  */
-DEF_TUNE (X86_TUNE_SHIFT1, "shift1", ~m_486)
-
 /* X86_TUNE_ZERO_EXTEND_WITH_AND: Use AND instruction instead
    of mozbl/movwl.  */
 DEF_TUNE (X86_TUNE_ZERO_EXTEND_WITH_AND, "zero_extend_with_and",