This adjusts aarch64_print_operand to recognize zero rtxes in modes other than
VOIDmode. This allows us to use xzr/wzr for zero vectors, for example.
We extract the test into a helper function, aarch64_const_zero_rtx_p, since this
predicate is needed by later patches.
gcc/ChangeLog:
* config/aarch64/aarch64-protos.h (aarch64_const_zero_rtx_p): New.
* config/aarch64/aarch64.cc (aarch64_const_zero_rtx_p): New.
Use it ...
(aarch64_print_operand): ... here. Recognize CONST0_RTXes in
modes other than VOIDmode.
bool aarch64_expand_setmem (rtx *);
bool aarch64_float_const_zero_rtx_p (rtx);
bool aarch64_float_const_rtx_p (rtx);
+bool aarch64_const_zero_rtx_p (rtx);
bool aarch64_function_arg_regno_p (unsigned);
bool aarch64_fusion_enabled_p (enum aarch64_fusion_pairs);
bool aarch64_gen_cpymemqi (rtx *);
return real_equal (CONST_DOUBLE_REAL_VALUE (x), &dconst0);
}
+/* Return true if X is any kind of constant zero rtx. */
+
+bool
+aarch64_const_zero_rtx_p (rtx x)
+{
+ return (x == CONST0_RTX (GET_MODE (x))
+ || (CONST_DOUBLE_P (x) && aarch64_float_const_zero_rtx_p (x)));
+}
+
/* Return TRUE if rtx X is immediate constant that fits in a single
MOVI immediate operation. */
bool
case 'w':
case 'x':
- if (x == const0_rtx
- || (CONST_DOUBLE_P (x) && aarch64_float_const_zero_rtx_p (x)))
+ if (aarch64_const_zero_rtx_p (x))
{
asm_fprintf (f, "%czr", code);
break;