+/* Return true if a switch should be expanded as a bit test.
+ INDEX_EXPR is the index expression, RANGE is the difference between
+ highest and lowest case, UNIQ is number of unique case node targets
+ not counting the default case and COUNT is the number of comparisons
+ needed, not counting the default case. */
+bool
+expand_switch_using_bit_tests_p (tree index_expr, tree range,
+ unsigned int uniq, unsigned int count)
+{
+ return (CASE_USE_BIT_TESTS
+ && ! TREE_CONSTANT (index_expr)
+ && compare_tree_int (range, GET_MODE_BITSIZE (word_mode)) < 0
+ && compare_tree_int (range, 0) > 0
+ && lshift_cheap_p ()
+ && ((uniq == 1 && count >= 3)
+ || (uniq == 2 && count >= 5)
+ || (uniq == 3 && count >= 6)));
+}
+