diff mbox series

[PUSHED] aarch64: Add testcase for vectorconvert lowering [PR110473]

Message ID 20240702222707.3706010-1-quic_apinski@quicinc.com
State New
Headers show
Series [PUSHED] aarch64: Add testcase for vectorconvert lowering [PR110473] | expand

Commit Message

Andrew Pinski July 2, 2024, 10:27 p.m. UTC
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.target/aarch64/vect-convert-1.c       | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/vect-convert-1.c
diff mbox series

Patch

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" } } */