public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/6] gcc/expr.c: Remove historic workaround for broken SIMD subreg
@ 2021-10-22 14:31 Jonathan Wright
  2021-10-22 14:41 ` Richard Sandiford
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wright @ 2021-10-22 14:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Sandiford, Kyrylo Tkachov

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

Hi,

A long time ago, using a parallel to take a subreg of a SIMD register
was broken. This temporary fix[1] (from 2003) spilled these registers
to memory and reloaded the appropriate part to obtain the subreg.

The fix initially existed for the benefit of the PowerPC E500 - a
platform for which GCC removed support a number of years ago.
Regardless, a proper mechanism for taking a subreg of a SIMD register
exists now anyway.

This patch removes the workaround thus preventing SIMD registers
being dumped to memory unnecessarily - which sometimes can't be fixed
by later passes.

Bootstrapped and regression tested on aarch64-none-linux-gnu and
x86_64-pc-linux-gnu - no issues.

Ok for master?

Thanks,
Jonathan

[1] https://gcc.gnu.org/pipermail/gcc-patches/2003-April/102099.html

---

gcc/ChangeLog:

2021-10-11  Jonathan Wright  <jonathan.wright@arm.com>

	* expr.c (emit_group_load_1): Remove historic workaround.

[-- Attachment #2: rb14923.patch --]
[-- Type: application/octet-stream, Size: 945 bytes --]

diff --git a/gcc/expr.c b/gcc/expr.c
index e0bcbccd9053df168c2e861414729fc7cf017f85..62446118b7beb725933ec6f7b0386e7e4b84fa90 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -2508,19 +2508,6 @@ emit_group_load_1 (rtx *tmps, rtx dst, rtx orig_src, tree type,
 					   NULL);
 	    }
 	}
-      /* FIXME: A SIMD parallel will eventually lead to a subreg of a
-	 SIMD register, which is currently broken.  While we get GCC
-	 to emit proper RTL for these cases, let's dump to memory.  */
-      else if (VECTOR_MODE_P (GET_MODE (dst))
-	       && REG_P (src))
-	{
-	  poly_uint64 slen = GET_MODE_SIZE (GET_MODE (src));
-	  rtx mem;
-
-	  mem = assign_stack_temp (GET_MODE (src), slen);
-	  emit_move_insn (mem, src);
-	  tmps[i] = adjust_address (mem, mode, bytepos);
-	}
       else if (CONSTANT_P (src) && GET_MODE (dst) != BLKmode
                && XVECLEN (dst, 0) > 1)
         tmps[i] = simplify_gen_subreg (mode, src, GET_MODE (dst), bytepos);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/6] gcc/expr.c: Remove historic workaround for broken SIMD subreg
  2021-10-22 14:31 [PATCH 2/6] gcc/expr.c: Remove historic workaround for broken SIMD subreg Jonathan Wright
@ 2021-10-22 14:41 ` Richard Sandiford
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Sandiford @ 2021-10-22 14:41 UTC (permalink / raw)
  To: Jonathan Wright; +Cc: gcc-patches, Kyrylo Tkachov

Jonathan Wright <Jonathan.Wright@arm.com> writes:
> Hi,
>
> A long time ago, using a parallel to take a subreg of a SIMD register
> was broken. This temporary fix[1] (from 2003) spilled these registers
> to memory and reloaded the appropriate part to obtain the subreg.
>
> The fix initially existed for the benefit of the PowerPC E500 - a
> platform for which GCC removed support a number of years ago.
> Regardless, a proper mechanism for taking a subreg of a SIMD register
> exists now anyway.
>
> This patch removes the workaround thus preventing SIMD registers
> being dumped to memory unnecessarily - which sometimes can't be fixed
> by later passes.
>
> Bootstrapped and regression tested on aarch64-none-linux-gnu and
> x86_64-pc-linux-gnu - no issues.
>
> Ok for master?
>
> Thanks,
> Jonathan
>
> [1] https://gcc.gnu.org/pipermail/gcc-patches/2003-April/102099.html
>
> ---
>
> gcc/ChangeLog:
>
> 2021-10-11  Jonathan Wright  <jonathan.wright@arm.com>
>
>         * expr.c (emit_group_load_1): Remove historic workaround.

OK, thanks.

Richard

> diff --git a/gcc/expr.c b/gcc/expr.c
> index e0bcbccd9053df168c2e861414729fc7cf017f85..62446118b7beb725933ec6f7b0386e7e4b84fa90 100644
> --- a/gcc/expr.c
> +++ b/gcc/expr.c
> @@ -2508,19 +2508,6 @@ emit_group_load_1 (rtx *tmps, rtx dst, rtx orig_src, tree type,
>  					   NULL);
>  	    }
>  	}
> -      /* FIXME: A SIMD parallel will eventually lead to a subreg of a
> -	 SIMD register, which is currently broken.  While we get GCC
> -	 to emit proper RTL for these cases, let's dump to memory.  */
> -      else if (VECTOR_MODE_P (GET_MODE (dst))
> -	       && REG_P (src))
> -	{
> -	  poly_uint64 slen = GET_MODE_SIZE (GET_MODE (src));
> -	  rtx mem;
> -
> -	  mem = assign_stack_temp (GET_MODE (src), slen);
> -	  emit_move_insn (mem, src);
> -	  tmps[i] = adjust_address (mem, mode, bytepos);
> -	}
>        else if (CONSTANT_P (src) && GET_MODE (dst) != BLKmode
>                 && XVECLEN (dst, 0) > 1)
>          tmps[i] = simplify_gen_subreg (mode, src, GET_MODE (dst), bytepos);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-22 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 14:31 [PATCH 2/6] gcc/expr.c: Remove historic workaround for broken SIMD subreg Jonathan Wright
2021-10-22 14:41 ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).