Hi Naveen,
Thanks for the new version. Unfortunately there is still one indentation issue:
+ for (unsigned int i = 8; i < nbytes; ++i)
+ if (bytes[i] != 0)
return false;
The return should be indented.
+++ b/gcc/testsuite/gcc.target/aarch64/pr113926_1.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv8.2-a+fp16" } */
+
+typedef float v2sf __attribute__((vector_size(8)));
+typedef float v4sf __attribute__((vector_size(16)));
+typedef double v2df __attribute__((vector_size(16)));
+typedef __fp16 v4hf __attribute__((vector_size(8)));
+typedef __fp16 v8hf __attribute__((vector_size(16)));
+
+v2sf
+f_v2sf (void)
+{
+ return (v2sf){ 1.0f, 0.0f };
+}
+
+v4sf
+f_v4sf (void)
+{
+ return (v4sf){ 1.0f, 0.0f, 0.0f, 0.0f };
+}
Both of these should use 1.0f, 1.0f since current trunk already emits those
as fmov s0, 1.0e+0.
+v2df
+f_v2df (void)
+{
+ return (v2df){ 1.0, 0.0 };
+}
+
+v4hf
+f_v4hf (void)
+{
+ return (v4hf){ (__fp16)1.0, (__fp16)0.0, (__fp16)0.0, (__fp16)0.0 };
+}
+
+v8hf
+f_v8hf (void)
+{
+ return (v8hf){ (__fp16)1.0, 0, 0, 0, 0, 0, 0, 0 };
+}
Same here, both should use 1.0, 1.0, 1.0, 1.0
+/* Each function should use fmov, not a literal pool load. */
+/* { dg-final { scan-assembler-times {\tfmov\ts[0-9]+,} 2 } } */
+/* { dg-final { scan-assembler-times {\tfmov\td[0-9]+,} 1 } } */
+/* { dg-final { scan-assembler-times {\tfmov\th[0-9]+,} 2 } } */
+/* { dg-final { scan-assembler-not {\tldr\t[sdq][0-9]+, =} } } */
With those changes, the s[0-9] and h[0-9] checks need to be updated.
Cheers,
Wilco