public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, AArch64] Fix macro in vdup_lane_2 test case
@ 2014-05-08 17:41 Ian Bolton
  2014-05-16  9:20 ` Ian Bolton
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Bolton @ 2014-05-08 17:41 UTC (permalink / raw)
  To: gcc-patches

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

This patch fixes a defective macro definition, based on correct
definition in similar testcases.  The test currently passes
through luck rather than correctness.

OK for commit?

Cheers,
Ian


2014-05-08  Ian Bolton  <ian.bolton@arm.com>

gcc/testsuite
	* gcc.target/aarch64/vdup_lane_2.c (force_simd): Emit an
	actual instruction to move into the allocated register.

[-- Attachment #2: aarch64_vdup_lane_2_test_fix_patch-v2.txt --]
[-- Type: text/plain, Size: 669 bytes --]

diff --git a/gcc/testsuite/gcc.target/aarch64/vdup_lane_2.c b/gcc/testsuite/gcc.target/aarch64/vdup_lane_2.c
index 7c04e75..2072c79 100644
--- a/gcc/testsuite/gcc.target/aarch64/vdup_lane_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/vdup_lane_2.c
@@ -4,10 +4,11 @@
 
 #include <arm_neon.h>
 
-#define force_simd(V1)   asm volatile (""	\
-          : "=w"(V1)				\
-          : "w"(V1)				\
-          : /* No clobbers */)
+/* Used to force a variable to a SIMD register.  */
+#define force_simd(V1)   asm volatile ("orr %0.16b, %1.16b, %1.16b"	\
+	   : "=w"(V1)							\
+	   : "w"(V1)							\
+	   : /* No clobbers */);
 
 extern void abort (void);
 

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

* RE: [PATCH, AArch64] Fix macro in vdup_lane_2 test case
  2014-05-08 17:41 [PATCH, AArch64] Fix macro in vdup_lane_2 test case Ian Bolton
@ 2014-05-16  9:20 ` Ian Bolton
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Bolton @ 2014-05-16  9:20 UTC (permalink / raw)
  To: Ian Bolton, gcc-patches

Ping.  This may well be classed as "obvious", but that's not
obvious to me, so I request a review.  Many thanks.

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Ian Bolton
> Sent: 08 May 2014 18:42
> To: gcc-patches
> Subject: [PATCH, AArch64] Fix macro in vdup_lane_2 test case
> 
> This patch fixes a defective macro definition, based on correct
> definition in similar testcases.  The test currently passes
> through luck rather than correctness.
> 
> OK for commit?
> 
> Cheers,
> Ian
> 
> 
> 2014-05-08  Ian Bolton  <ian.bolton@arm.com>
> 
> gcc/testsuite
> 	* gcc.target/aarch64/vdup_lane_2.c (force_simd): Emit an
> 	actual instruction to move into the allocated register.



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

* RE: [PATCH, AArch64] Fix macro in vdup_lane_2 test case
  2014-05-19 10:44 ` Marcus Shawcroft
@ 2014-05-20 10:36   ` Ian Bolton
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Bolton @ 2014-05-20 10:36 UTC (permalink / raw)
  To: 'Marcus Shawcroft'; +Cc: gcc-patches

> From: Marcus Shawcroft [mailto:marcus.shawcroft@gmail.com]
> Sent: 19 May 2014 11:45
> To: Ian Bolton
> Cc: gcc-patches
> Subject: Re: [PATCH, AArch64] Fix macro in vdup_lane_2 test case
> 
> On 8 May 2014 18:41, Ian Bolton <ian.bolton@arm.com> wrote:
> 
> > gcc/testsuite
> >         * gcc.target/aarch64/vdup_lane_2.c (force_simd): Emit an
> >         actual instruction to move into the allocated register.
> 
> This macro is attempting to force a value to a particular class of
> register, we don't need or want the mov instruction at all.  Isn't
> something like this sufficient:
> 
> #define force_simd(V1)   asm volatile (""       \
>           : "+w"(V1)                            \
>           :                                     \
>           : /* No clobbers */)
> 
> ?
> 
> /Marcus

Thanks for the review, Marcus.  I did not think of that and it
looks sane, but your suggested approach leads to some of the dup
instructions being optimised away.  Ordinarily, that would be great
but these test cases are trying to force the dups to occur.

Cheers,
Ian








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

* Re: [PATCH, AArch64] Fix macro in vdup_lane_2 test case
       [not found] <536bc1d0.a2a1440a.3499.ffffeb33SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2014-05-19 10:44 ` Marcus Shawcroft
  2014-05-20 10:36   ` Ian Bolton
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Shawcroft @ 2014-05-19 10:44 UTC (permalink / raw)
  To: Ian Bolton; +Cc: gcc-patches

On 8 May 2014 18:41, Ian Bolton <ian.bolton@arm.com> wrote:

> gcc/testsuite
>         * gcc.target/aarch64/vdup_lane_2.c (force_simd): Emit an
>         actual instruction to move into the allocated register.

This macro is attempting to force a value to a particular class of
register, we don't need or want the mov instruction at all.  Isn't
something like this sufficient:

#define force_simd(V1)   asm volatile (""       \
          : "+w"(V1)                            \
          :                                     \
          : /* No clobbers */)

?

/Marcus

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

end of thread, other threads:[~2014-05-20 10:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-08 17:41 [PATCH, AArch64] Fix macro in vdup_lane_2 test case Ian Bolton
2014-05-16  9:20 ` Ian Bolton
     [not found] <536bc1d0.a2a1440a.3499.ffffeb33SMTPIN_ADDED_BROKEN@mx.google.com>
2014-05-19 10:44 ` Marcus Shawcroft
2014-05-20 10:36   ` Ian Bolton

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