diff mbox series

[06/11] aarch64: Fix up aarch64_print_operand xzr/wzr case

Message ID ZVZaryHM7VQXsMjd@arm.com
State New
Headers show
Series aarch64: Rework ldp/stp patterns, add new ldp/stp pass | expand

Commit Message

Alex Coplan Nov. 16, 2023, 6:08 p.m. UTC
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.

Bootstrapped/regtested as a series on aarch64-linux-gnu, OK for trunk?

gcc/ChangeLog:

	* config/aarch64/aarch64.cc (aarch64_print_operand): Handle
	non-VOIDmode CONST0_RTXes in {x,w}zr cases.
---
 gcc/config/aarch64/aarch64.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Sandiford Nov. 21, 2023, 12:11 p.m. UTC | #1
Alex Coplan <alex.coplan@arm.com> writes:
> 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.
>
> Bootstrapped/regtested as a series on aarch64-linux-gnu, OK for trunk?
>
> gcc/ChangeLog:
>
> 	* config/aarch64/aarch64.cc (aarch64_print_operand): Handle
> 	non-VOIDmode CONST0_RTXes in {x,w}zr cases.

OK (and a good sign!)

Thanks,
Richard

> ---
>  gcc/config/aarch64/aarch64.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
> index 800a8b0e110..abd029887e5 100644
> --- a/gcc/config/aarch64/aarch64.cc
> +++ b/gcc/config/aarch64/aarch64.cc
> @@ -12387,7 +12387,7 @@ aarch64_print_operand (FILE *f, rtx x, int code)
>  
>      case 'w':
>      case 'x':
> -      if (x == const0_rtx
> +      if (x == CONST0_RTX (GET_MODE (x))
>  	  || (CONST_DOUBLE_P (x) && aarch64_float_const_zero_rtx_p (x)))
>  	{
>  	  asm_fprintf (f, "%czr", code);
diff mbox series

Patch

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 800a8b0e110..abd029887e5 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -12387,7 +12387,7 @@  aarch64_print_operand (FILE *f, rtx x, int code)
 
     case 'w':
     case 'x':
-      if (x == const0_rtx
+      if (x == CONST0_RTX (GET_MODE (x))
 	  || (CONST_DOUBLE_P (x) && aarch64_float_const_zero_rtx_p (x)))
 	{
 	  asm_fprintf (f, "%czr", code);