public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] New testcases for NEON
@ 2011-04-13 15:59 Andrew Stubbs
  2011-04-19 15:02 ` Richard Earnshaw
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Stubbs @ 2011-04-13 15:59 UTC (permalink / raw)
  To: gcc-patches; +Cc: patches, Daniel Jacobowitz

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

Hi,

This old patch has been carried in the CodeSourcery toolchain for some 
time now. It just adds a few new testcases for vectorization.

OK?

Andrew

[-- Attachment #2: vect-shift-tests.patch --]
[-- Type: text/x-patch, Size: 2769 bytes --]

2008-12-03  Daniel Jacobowitz  <dan@codesourcery.com>

	gcc/testsuite/
	* gcc.dg/vect/vect-shift-3.c, gcc.dg/vect/vect-shift-4.c: New.
	* lib/target-supports.exp (check_effective_target_vect_shift_char): New
	function.

--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-shift-3.c
@@ -0,0 +1,37 @@
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned short dst[N] __attribute__((aligned(N)));
+unsigned short src[N] __attribute__((aligned(N)));
+
+__attribute__ ((noinline))
+void array_shift(void)
+{
+  int i;
+  for (i = 0; i < N; i++)
+    dst[i] = src[i] >> 3;
+}
+
+int main()
+{
+  volatile int i;
+  check_vect ();
+
+  for (i = 0; i < N; i++)
+    src[i] = i << 3;
+
+  array_shift ();
+
+  for (i = 0; i < N; i++)
+    if (dst[i] != i)
+      abort ();
+
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-shift-4.c
@@ -0,0 +1,37 @@
+/* { dg-require-effective-target vect_shift_char } */
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned char dst[N] __attribute__((aligned(N)));
+unsigned char src[N] __attribute__((aligned(N)));
+
+__attribute__ ((noinline))
+void array_shift(void)
+{
+  int i;
+  for (i = 0; i < N; i++)
+    dst[i] = src[i] >> 3;
+}
+
+int main()
+{
+  volatile int i;
+  check_vect ();
+
+  for (i = 0; i < N; i++)
+    src[i] = i << 3;
+
+  array_shift ();
+
+  for (i = 0; i < N; i++)
+    if (dst[i] != i)
+      abort ();
+
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2310,6 +2310,26 @@ proc check_effective_target_vect_shift_scalar { } {
 }
 
 
+# Return 1 if the target supports hardware vector shift operation for char.
+
+proc check_effective_target_vect_shift_char { } {
+    global et_vect_shift_char_saved
+
+    if [info exists et_vect_shift_char_saved] {
+	verbose "check_effective_target_vect_shift_char: using cached result" 2
+    } else {
+	set et_vect_shift_char_saved 0
+	if { ([istarget powerpc*-*-*]
+             && ![istarget powerpc-*-linux*paired*])
+	     || [check_effective_target_arm32] } {
+	   set et_vect_shift_char_saved 1
+	}
+    }
+
+    verbose "check_effective_target_vect_shift_char: returning $et_vect_shift_char_saved" 2
+    return $et_vect_shift_char_saved
+}
+
 # Return 1 if the target supports hardware vectors of long, 0 otherwise.
 #
 # This can change for different subtargets so do not cache the result.

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

* Re: [PATCH][ARM] New testcases for NEON
  2011-04-13 15:59 [PATCH][ARM] New testcases for NEON Andrew Stubbs
@ 2011-04-19 15:02 ` Richard Earnshaw
  2011-04-20 17:27   ` Andrew Stubbs
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Earnshaw @ 2011-04-19 15:02 UTC (permalink / raw)
  To: Andrew Stubbs; +Cc: gcc-patches, patches, Daniel Jacobowitz

On Wed, 2011-04-13 at 16:59 +0100, Andrew Stubbs wrote:
> Hi,
> 
> This old patch has been carried in the CodeSourcery toolchain for some 
> time now. It just adds a few new testcases for vectorization.
> 
> OK?
> 
> Andrew

OK.

2008-12-03  Daniel Jacobowitz  <dan@codesourcery.com>

        gcc/testsuite/
        * gcc.dg/vect/vect-shift-3.c, gcc.dg/vect/vect-shift-4.c: New.
        * lib/target-supports.exp (check_effective_target_vect_shift_char): New
        function.

R.



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

* Re: [PATCH][ARM] New testcases for NEON
  2011-04-19 15:02 ` Richard Earnshaw
@ 2011-04-20 17:27   ` Andrew Stubbs
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Stubbs @ 2011-04-20 17:27 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: gcc-patches, patches, Daniel Jacobowitz

On 19/04/11 15:58, Richard Earnshaw wrote:
> OK.
>
> 2008-12-03  Daniel Jacobowitz<dan@codesourcery.com>
>
>          gcc/testsuite/
>          * gcc.dg/vect/vect-shift-3.c, gcc.dg/vect/vect-shift-4.c: New.
>          * lib/target-supports.exp (check_effective_target_vect_shift_char): New
>          function.

Committed, thanks.

Andrew

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

end of thread, other threads:[~2011-04-20 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-13 15:59 [PATCH][ARM] New testcases for NEON Andrew Stubbs
2011-04-19 15:02 ` Richard Earnshaw
2011-04-20 17:27   ` Andrew Stubbs

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).