OSDN Git Service

* config/i386/i386.md (extendsidi2 splitter): Also check for DX_REG
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / i386.md
index 411feaf..b879996 100644 (file)
 
   /* Generate a cltd if possible and doing so it profitable.  */
   if ((optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)
 
   /* Generate a cltd if possible and doing so it profitable.  */
   if ((optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)
-      && true_regnum (operands[3]) == AX_REG)
+      && true_regnum (operands[3]) == AX_REG
+      && true_regnum (operands[4]) == DX_REG)
     {
       emit_insn (gen_ashrsi3_cvt (operands[4], operands[3], GEN_INT (31)));
       DONE;
     {
       emit_insn (gen_ashrsi3_cvt (operands[4], operands[3], GEN_INT (31)));
       DONE;
 {
   switch (get_attr_type (insn))
     {
 {
   switch (get_attr_type (insn))
     {
+    case TYPE_LEA:
+      return "#";
+
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       gcc_assert (rtx_equal_p (operands[0], operands[1]));
       return "add{<imodesuffix>}\t%0, %0";
 
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       gcc_assert (rtx_equal_p (operands[0], operands[1]));
       return "add{<imodesuffix>}\t%0, %0";
 
-    case TYPE_LEA:
-      return "#";
-
     default:
     default:
-      if (REG_P (operands[2]))
-       return "sal{<imodesuffix>}\t{%b2, %0|%0, %b2}";
-      else if (operands[2] == const1_rtx
-              && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+      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%0";
       else
        return "sal{<imodesuffix>}\t{%2, %0|%0, %2}";
 {
   switch (get_attr_type (insn))
     {
 {
   switch (get_attr_type (insn))
     {
+    case TYPE_LEA:
+      return "#";
+
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       return "add{l}\t%k0, %k0";
 
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       return "add{l}\t%k0, %k0";
 
-    case TYPE_LEA:
-      return "#";
-
     default:
     default:
-      if (REG_P (operands[2]))
-       return "sal{l}\t{%b2, %k0|%k0, %b2}";
-      else if (operands[2] == const1_rtx
-              && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+      if (operands[2] == const1_rtx
+         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
        return "sal{l}\t%k0";
       else
        return "sal{l}\t{%2, %k0|%k0, %2}";
        return "sal{l}\t%k0";
       else
        return "sal{l}\t{%2, %k0|%k0, %2}";
       return "add{w}\t%0, %0";
 
     default:
       return "add{w}\t%0, %0";
 
     default:
-      if (REG_P (operands[2]))
-       return "sal{w}\t{%b2, %0|%0, %b2}";
-      else if (operands[2] == const1_rtx
-              && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+      if (operands[2] == const1_rtx
+         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
        return "sal{w}\t%0";
       else
        return "sal{w}\t{%2, %0|%0, %2}";
        return "sal{w}\t%0";
       else
        return "sal{w}\t{%2, %0|%0, %2}";
     {
     case TYPE_LEA:
       return "#";
     {
     case TYPE_LEA:
       return "#";
+
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       return "add{w}\t%0, %0";
 
     default:
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       return "add{w}\t%0, %0";
 
     default:
-      if (REG_P (operands[2]))
-       return "sal{w}\t{%b2, %0|%0, %b2}";
-      else if (operands[2] == const1_rtx
-              && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+      if (operands[2] == const1_rtx
+         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
        return "sal{w}\t%0";
       else
        return "sal{w}\t{%2, %0|%0, %2}";
        return "sal{w}\t%0";
       else
        return "sal{w}\t{%2, %0|%0, %2}";
         return "add{b}\t%0, %0";
 
     default:
         return "add{b}\t%0, %0";
 
     default:
-      if (REG_P (operands[2]))
-       {
-         if (get_attr_mode (insn) == MODE_SI)
-           return "sal{l}\t{%b2, %k0|%k0, %b2}";
-         else
-           return "sal{b}\t{%b2, %0|%0, %b2}";
-       }
-      else if (operands[2] == const1_rtx
-              && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+      if (operands[2] == const1_rtx
+         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
        {
          if (get_attr_mode (insn) == MODE_SI)
        {
          if (get_attr_mode (insn) == MODE_SI)
-           return "sal{l}\t%0";
+           return "sal{l}\t%k0";
          else
            return "sal{b}\t%0";
        }
          else
            return "sal{b}\t%0";
        }
     {
     case TYPE_LEA:
       return "#";
     {
     case TYPE_LEA:
       return "#";
+
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1]))
     case TYPE_ALU:
       gcc_assert (operands[2] == const1_rtx);
       if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1]))
         return "add{b}\t%0, %0";
 
     default:
         return "add{b}\t%0, %0";
 
     default:
-      if (REG_P (operands[2]))
-       {
-         if (get_attr_mode (insn) == MODE_SI)
-           return "sal{l}\t{%b2, %k0|%k0, %b2}";
-         else
-           return "sal{b}\t{%b2, %0|%0, %b2}";
-       }
-      else if (operands[2] == const1_rtx
-              && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+      if (operands[2] == const1_rtx
+         && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
        {
          if (get_attr_mode (insn) == MODE_SI)
        {
          if (get_attr_mode (insn) == MODE_SI)
-           return "sal{l}\t%0";
+           return "sal{l}\t%k0";
          else
            return "sal{b}\t%0";
        }
          else
            return "sal{b}\t%0";
        }
    (clobber (reg:CC FLAGS_REG))]
   "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
 {
    (clobber (reg:CC FLAGS_REG))]
   "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
 {
-  if (REG_P (operands[2]))
-    return "<shiftrt>{<imodesuffix>}\t{%b2, %0|%0, %b2}";
-  else if (operands[2] == const1_rtx
-          && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+  if (operands[2] == const1_rtx
+      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
     return "<shiftrt>{<imodesuffix>}\t%0";
   else
     return "<shiftrt>{<imodesuffix>}\t{%2, %0|%0, %2}";
     return "<shiftrt>{<imodesuffix>}\t%0";
   else
     return "<shiftrt>{<imodesuffix>}\t{%2, %0|%0, %2}";
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
 {
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
 {
-  if (REG_P (operands[2]))
-    return "<shiftrt>{l}\t{%b2, %k0|%k0, %b2}";
-  else if (operands[2] == const1_rtx
-          && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+  if (operands[2] == const1_rtx
+      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
     return "<shiftrt>{l}\t%k0";
   else
     return "<shiftrt>{l}\t{%2, %k0|%k0, %2}";
     return "<shiftrt>{l}\t%k0";
   else
     return "<shiftrt>{l}\t{%2, %k0|%k0, %2}";
     || (operands[1] == const1_rtx
        && TARGET_SHIFT1))"
 {
     || (operands[1] == const1_rtx
        && TARGET_SHIFT1))"
 {
-  if (REG_P (operands[1]))
-    return "<shiftrt>{b}\t{%b1, %0|%0, %b1}";
-  else if (operands[1] == const1_rtx
-          && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+  if (operands[1] == const1_rtx
+      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
     return "<shiftrt>{b}\t%0";
   else
     return "<shiftrt>{b}\t{%1, %0|%0, %1}";
     return "<shiftrt>{b}\t%0";
   else
     return "<shiftrt>{b}\t{%1, %0|%0, %1}";
    (clobber (reg:CC FLAGS_REG))]
   "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
 {
    (clobber (reg:CC FLAGS_REG))]
   "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
 {
-  if (REG_P (operands[2]))
-    return "<rotate>{<imodesuffix>}\t{%b2, %0|%0, %b2}";
-  else if (operands[2] == const1_rtx
-          && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+  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%0";
   else
     return "<rotate>{<imodesuffix>}\t{%2, %0|%0, %2}";
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
 {
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
 {
-  if (REG_P (operands[2]))
-    return "<rotate>{l}\t{%b2, %k0|%k0, %b2}";
-  else if (operands[2] == const1_rtx
-          && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+    if (operands[2] == const1_rtx
+       && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
     return "<rotate>{l}\t%k0";
   else
     return "<rotate>{l}\t{%2, %k0|%k0, %2}";
     return "<rotate>{l}\t%k0";
   else
     return "<rotate>{l}\t{%2, %k0|%k0, %2}";
     || (operands[1] == const1_rtx
        && TARGET_SHIFT1))"
 {
     || (operands[1] == const1_rtx
        && TARGET_SHIFT1))"
 {
-  if (REG_P (operands[1]))
-    return "<rotate>{b}\t{%b1, %0|%0, %b1}";
-  else if (operands[1] == const1_rtx
-          && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
+  if (operands[1] == const1_rtx
+      && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
     return "<rotate>{b}\t%0";
   else
     return "<rotate>{b}\t{%1, %0|%0, %1}";
     return "<rotate>{b}\t%0";
   else
     return "<rotate>{b}\t{%1, %0|%0, %1}";