]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Add testcase for vectorconvert lowering [PR110473]
authorAndrew Pinski <quic_apinski@quicinc.com>
Tue, 2 Jul 2024 22:02:17 +0000 (15:02 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Tue, 2 Jul 2024 22:27:40 +0000 (15:27 -0700)
Vectorconvert lowering was changed to use the convert optab directly
starting in r15-1677-gc320a7efcd35ba. I had filed an aarch64 specific
issue for this specific thing and it would make sense to add an aarch64
specific testcase instead of just having a x86_64 specific ones for
this.

Pushed as obvious after testing for aarch64-linux-gnu.

PR tree-optimization/110473
PR tree-optimization/107432

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/vect-convert-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/testsuite/gcc.target/aarch64/vect-convert-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/aarch64/vect-convert-1.c b/gcc/testsuite/gcc.target/aarch64/vect-convert-1.c
new file mode 100644 (file)
index 0000000..74b3f50
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-veclower2" } */
+/* PR tree-optimization/110473 */
+/* convertvector lowering should produce directly the casts
+   rather than lower them to scalar.  */
+
+typedef unsigned int v4si __attribute__ ((vector_size (4*sizeof(int))));
+typedef unsigned short v4hi __attribute__ ((vector_size (4*sizeof(short))));
+
+v4si f(v4si a, v4si b)
+{
+  v4hi t = __builtin_convertvector (a, v4hi);
+  v4si t1 = __builtin_convertvector (t, v4si);
+  return t1;
+}
+
+/* { dg-final { scan-assembler-times "\txtn\t" 1 } } */
+/* { dg-final { scan-assembler-times "\tuxtl\t" 1 } } */
+/* { dg-final { scan-tree-dump-times " = .v4hi. a_" 1 "veclower21" } } */
+/* { dg-final { scan-tree-dump-times " = .v4si. " 1 "veclower21" } } */