mips.c (mips_case_values_threshold): New.
authorSteve Ellcey <sellcey@mips.com>
Tue, 23 Jul 2013 22:34:10 +0000 (22:34 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Tue, 23 Jul 2013 22:34:10 +0000 (22:34 +0000)
2013-07-23  Steve Ellcey  <sellcey@mips.com>

* config/mips/mips.c (mips_case_values_threshold): New.
(TARGET_CASE_VALUES_THRESHOLD): Define.

From-SVN: r201194

gcc/ChangeLog
gcc/config/mips/mips.c

index 0eed895e65a0f5fbfca8a58f9b75488de4e172b9..20b6b5385efd6a1b9d3ab0eafc592d813da2be6b 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-23  Steve Ellcey  <sellcey@mips.com>
+
+       * config/mips/mips.c (mips_case_values_threshold): New.
+       (TARGET_CASE_VALUES_THRESHOLD): Define.
+
 2013-07-23  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            Anton Blanchard <anton@au1.ibm.com>
 
index a3735dc598d4c1d99203ed972f0cfc9a0c8b7eb6..a56757c877f8d4e3375af76146048b546f241070 100644 (file)
@@ -18613,6 +18613,18 @@ mips_expand_vec_minmax (rtx target, rtx op0, rtx op1,
   x = gen_rtx_IOR (vmode, t0, t1);
   emit_insn (gen_rtx_SET (VOIDmode, target, x));
 }
+
+/* Implement TARGET_CASE_VALUES_THRESHOLD.  */
+
+unsigned int
+mips_case_values_threshold (void)
+{
+  /* In MIPS16 mode using a larger case threshold generates smaller code.  */
+  if (TARGET_MIPS16 && optimize_size)
+    return 10;
+  else
+    return default_case_values_threshold ();
+}
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -18844,6 +18856,9 @@ mips_expand_vec_minmax (rtx target, rtx op0, rtx op1,
 #undef TARGET_VECTORIZE_VEC_PERM_CONST_OK
 #define TARGET_VECTORIZE_VEC_PERM_CONST_OK mips_vectorize_vec_perm_const_ok
 
+#undef TARGET_CASE_VALUES_THRESHOLD
+#define TARGET_CASE_VALUES_THRESHOLD mips_case_values_threshold
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 #include "gt-mips.h"