https://gcc.gnu.org/g:a7ad9cb813063ddf51269910f33b56116c10462c

commit r15-1800-ga7ad9cb813063ddf51269910f33b56116c10462c
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Tue Jul 2 15:02:17 2024 -0700

    aarch64: Add testcase for vectorconvert lowering [PR110473]
    
    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_apin...@quicinc.com>

Diff:
---
 gcc/testsuite/gcc.target/aarch64/vect-convert-1.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

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
index 00000000000..74b3f5095e2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vect-convert-1.c
@@ -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" } } */

Reply via email to