+2018-07-31 Richard Earnshaw <rearnsha@arm.com>
+
+ * targhooks.h (speculation_safe_value_not_needed): New prototype.
+ * targhooks.c (speculation_safe_value_not_needed): New function.
+ * target.def (have_speculation_safe_value): Update documentation.
+ * doc/tm.texi: Regenerated.
+
2018-07-31 Richard Earnshaw <rearnsha@arm.com>
* config/aarch64/iterators.md (ALLI_TI): New iterator.
a pattern named @code{speculation_barrier}. Else it returns true
for the first case and whether the pattern is enabled for the current
compilation for the second case.
+
+ For targets that have no processors that can execute instructions
+ speculatively an alternative implemenation of this hook is available:
+ simply redefine this hook to @code{speculation_safe_value_not_needed}
+ along with your other target hooks.
@end deftypefn
@deftypefn {Target Hook} rtx TARGET_SPECULATION_SAFE_VALUE (machine_mode @var{mode}, rtx @var{result}, rtx @var{val}, rtx @var{failval})
The default implementation returns false if the target does not define\n\
a pattern named @code{speculation_barrier}. Else it returns true\n\
for the first case and whether the pattern is enabled for the current\n\
- compilation for the second case.",
+ compilation for the second case.\n\
+ \n\
+ For targets that have no processors that can execute instructions\n\
+ speculatively an alternative implemenation of this hook is available:\n\
+ simply redefine this hook to @code{speculation_safe_value_not_needed}\n\
+ along with your other target hooks.",
bool, (bool active), default_have_speculation_safe_value)
DEFHOOK
return false;
#endif
}
+/* Alternative implementation of TARGET_HAVE_SPECULATION_SAFE_VALUE
+ that can be used on targets that never have speculative execution. */
+bool
+speculation_safe_value_not_needed (bool active)
+{
+ return !active;
+}
/* Default implementation of the speculation-safe-load builtin. This
implementation simply copies val to result and generates a
extern tree default_preferred_else_value (unsigned, tree, unsigned, tree *);
extern bool default_have_speculation_safe_value (bool);
+extern bool speculation_safe_value_not_needed (bool);
extern rtx default_speculation_safe_value (machine_mode, rtx, rtx, rtx);
#endif /* GCC_TARGHOOKS_H */