/* If jumps are cheap and the target does not support conditional
compare, turn some more codes into jumpy sequences. */
else if (BRANCH_COST (optimize_insn_for_speed_p (), false) < 4
- && targetm.gen_ccmp_first == NULL)
+ && !targetm.have_ccmp ())
{
if ((code2 == BIT_AND_EXPR
&& TYPE_PRECISION (TREE_TYPE (op0)) == 1
return plus_constant (Pmode, tagged_addr, offset);
}
+/* Implement TARGET_HAVE_CCMP. */
+static bool
+ix86_have_ccmp ()
+{
+ return (bool) TARGET_APX_CCMP;
+}
+
/* Target-specific selftests. */
#if CHECKING_P
#undef TARGET_GEN_CCMP_NEXT
#define TARGET_GEN_CCMP_NEXT ix86_gen_ccmp_next
+#undef TARGET_HAVE_CCMP
+#define TARGET_HAVE_CCMP ix86_have_ccmp
static bool
ix86_libc_has_fast_function (int fcode ATTRIBUTE_UNUSED)
@var{bit_code} is @code{AND} or @code{IOR}, which is the op on the compares.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_HAVE_CCMP (void)
+This target hook returns true if the target supports conditional compare.
+This target hook is required only when the ccmp support is conditionally
+enabled, such as in response to command-line flags. The default implementation
+returns true iff @code{TARGET_GEN_CCMP_FIRST} is defined.
+@end deftypefn
+
@deftypefn {Target Hook} unsigned TARGET_LOOP_UNROLL_ADJUST (unsigned @var{nunroll}, class loop *@var{loop})
This target hook returns a new value for the number of times @var{loop}
should be unrolled. The parameter @var{nunroll} is the number of times
@hook TARGET_GEN_CCMP_NEXT
+@hook TARGET_HAVE_CCMP
+
@hook TARGET_LOOP_UNROLL_ADJUST
@defmac POWI_MAX_MULTS
ops.op1 = gimple_assign_rhs2 (g);
/* Try to expand conditonal compare. */
- if (targetm.gen_ccmp_first)
+ if (targetm.have_ccmp ())
{
gcc_checking_assert (targetm.gen_ccmp_next != NULL);
r = expand_ccmp_expr (g, TYPE_MODE (ops.type));
rtx, (rtx_insn **prep_seq, rtx_insn **gen_seq, rtx prev, rtx_code cmp_code, tree op0, tree op1, rtx_code bit_code),
NULL)
+/* Return true if the target supports conditional compare. */
+DEFHOOK
+(have_ccmp,
+ "This target hook returns true if the target supports conditional compare.\n\
+This target hook is required only when the ccmp support is conditionally\n\
+enabled, such as in response to command-line flags. The default implementation\n\
+returns true iff @code{TARGET_GEN_CCMP_FIRST} is defined.",
+ bool, (void),
+ default_have_ccmp)
+
/* Return a new value for loop unroll size. */
DEFHOOK
(loop_unroll_adjust,
return HAVE_conditional_execution;
}
+bool
+default_have_ccmp (void)
+{
+ return targetm.gen_ccmp_first != NULL;
+}
+
/* By default we assume that c99 functions are present at the runtime,
but sincos is not. */
bool
extern rtx default_addr_space_convert (rtx, tree, tree);
extern unsigned int default_case_values_threshold (void);
extern bool default_have_conditional_execution (void);
+extern bool default_have_ccmp (void);
extern bool default_libc_has_function (enum function_class, tree);
extern bool default_libc_has_fast_function (int fcode);