dbl_mov_immediate_1.c: New.
authorTamar Christina <tamar.christina@arm.com>
Fri, 28 Jul 2017 15:14:25 +0000 (15:14 +0000)
committerTamar Christina <tnfchris@gcc.gnu.org>
Fri, 28 Jul 2017 15:14:25 +0000 (15:14 +0000)
2017-07-28  Tamar Christina  <tamar.christina@arm.com>
    Bilyan Borisov  <bilyan.borisov@arm.com>

* gcc.target/aarch64/dbl_mov_immediate_1.c: New.
* gcc.target/aarch64/flt_mov_immediate_1.c: New.
* gcc.target/aarch64/f16_mov_immediate_1.c: New.
* gcc.target/aarch64/f16_mov_immediate_2.c: New.
* gcc.target/aarch64/pr63304_1.c: Changed to double.

Co-Authored-By: Bilyan Borisov <bilyan.borisov@arm.com>
From-SVN: r250674

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/dbl_mov_immediate_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/flt_mov_immediate_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/pr63304_1.c

index e0c6bbec8c105325ed1cdd2c0c2996527f582347..ab57bfe2721a3e69969311cdc9e14e2ec0d5eac5 100644 (file)
@@ -1,3 +1,12 @@
+2017-07-28  Tamar Christina  <tamar.christina@arm.com>
+           Bilyan Borisov  <bilyan.borisov@arm.com>
+
+       * gcc.target/aarch64/dbl_mov_immediate_1.c: New.
+       * gcc.target/aarch64/flt_mov_immediate_1.c: New.
+       * gcc.target/aarch64/f16_mov_immediate_1.c: New.
+       * gcc.target/aarch64/f16_mov_immediate_2.c: New.
+       * gcc.target/aarch64/pr63304_1.c: Changed to double.
+
 2017-07-28  Bin Cheng  <bin.cheng@arm.com>
 
        * gcc.dg/tree-ssa/predcom-dse-1.c: New test.
diff --git a/gcc/testsuite/gcc.target/aarch64/dbl_mov_immediate_1.c b/gcc/testsuite/gcc.target/aarch64/dbl_mov_immediate_1.c
new file mode 100644 (file)
index 0000000..e8dd01d
--- /dev/null
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-skip-if "Tiny model won't generate adrp" { *-*-* } { "-mcmodel=tiny" } { "" } } */
+
+double d0(void)
+{
+  double x = 0.0d;
+  return x;
+}
+
+double dn1(void)
+{
+  double x = -0.0d;
+  return x;
+}
+
+
+double d1(void)
+{
+  double x = 1.5d;
+  return x;
+}
+
+double d2(void)
+{
+  double x = 123256.0d;
+  return x;
+}
+
+double d3(void)
+{
+  double x = 123256123456.0d;
+  return x;
+}
+
+double d4(void)
+{
+  double x = 123456123456123456.0d;
+  return x;
+}
+
+/* { dg-final { scan-assembler-times "movi\td\[0-9\]+, #?0"                 1 } } */
+
+/* { dg-final { scan-assembler-times "adrp\tx\[0-9\]+, \.LC\[0-9\]"         2 } } */
+/* { dg-final { scan-assembler-times "ldr\td\[0-9\]+, \\\[x\[0-9\], #:lo12:\.LC\[0-9\]\\\]" 2 } } */
+
+/* { dg-final { scan-assembler-times "fmov\td\[0-9\]+, 1\\\.5e\\\+0"        1 } } */
+
+/* { dg-final { scan-assembler-times "mov\tx\[0-9\]+, 25838523252736"       1 } } */
+/* { dg-final { scan-assembler-times "movk\tx\[0-9\]+, 0x40fe, lsl 48"      1 } } */
+/* { dg-final { scan-assembler-times "mov\tx\[0-9\]+, -9223372036854775808" 1 } } */
+/* { dg-final { scan-assembler-times "fmov\td\[0-9\]+, x\[0-9\]+"           2 } } */
+
diff --git a/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c b/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c
new file mode 100644 (file)
index 0000000..1ed3831
--- /dev/null
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_2a_fp16_scalar } */
+
+extern __fp16 foo ();
+extern void bar (__fp16* x);
+
+void f1 ()
+{
+  volatile __fp16 a = 17.0;
+}
+
+
+void f2 (__fp16 *a)
+{
+  *a = 17.0;
+}
+
+void f3 ()
+{
+  __fp16 b = foo ();
+  b = 17.0;
+  bar (&b);
+}
+
+__fp16 f4 ()
+{
+  __fp16 a = 0;
+  __fp16 b = 1;
+  __fp16 c = 2;
+  __fp16 d = 4;
+
+  __fp16 z = a + b;
+  z = z + c;
+  z = z - d;
+  return z;
+}
+
+__fp16 f5 ()
+{
+  __fp16 a = 16;
+  bar (&a);
+  return a;
+}
+
+/* { dg-final { scan-assembler-times "mov\tw\[0-9\]+, #?19520"           3 } } */
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0xbc, lsl 8"  1 } } */
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x4c, lsl 8"  1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_2.c b/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_2.c
new file mode 100644 (file)
index 0000000..6f44821
--- /dev/null
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_2a_fp16_scalar } */
+
+#include <arm_fp16.h>
+
+float16_t f0(void)
+{
+  float16_t x = 0.0f;
+  return x;
+}
+
+float16_t fn1(void)
+{
+  float16_t x = -0.0f;
+  return x;
+}
+
+float16_t f1(void)
+{
+  float16_t x = 256.0f;
+  return x;
+}
+
+float16_t f2(void)
+{
+  float16_t x = 123256.0f;
+  return x;
+}
+
+float16_t f3(void)
+{
+  float16_t x = 17.0;
+  return x;
+}
+
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, ?#0"         1 } } */
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x80, lsl 8" 1 } } */
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x5c, lsl 8" 1 } } */
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x7c, lsl 8" 1 } } */
+
+/* { dg-final { scan-assembler-times "mov\tw\[0-9\]+, 19520"              1 } } */
+/* { dg-final { scan-assembler-times "fmov\th\[0-9\], w\[0-9\]+"          1 } } */
+
diff --git a/gcc/testsuite/gcc.target/aarch64/flt_mov_immediate_1.c b/gcc/testsuite/gcc.target/aarch64/flt_mov_immediate_1.c
new file mode 100644 (file)
index 0000000..7b92a5a
--- /dev/null
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+float f0(void)
+{
+  float x = 0.0f;
+  return x;
+}
+
+float fn1(void)
+{
+  float x = -0.0f;
+  return x;
+}
+
+float f1(void)
+{
+  float x = 256.0f;
+  return x;
+}
+
+float f2(void)
+{
+  float x = 123256.0f;
+  return x;
+}
+
+float f3(void)
+{
+  float x = 2.0f;
+  return x;
+}
+
+float f4(void)
+{
+  float x = -20000.1;
+  return x;
+}
+
+
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, ?#0"           1 } } */
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x80, lsl 24"  1 } } */
+/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x80, lsl 24"  1 } } */
+
+/* { dg-final { scan-assembler-times "mov\tw\[0-9\]+, 48128"                1 } } */
+/* { dg-final { scan-assembler-times "movk\tw\[0-9\]+, 0x47f0, lsl 16"      1 } } */
+
+/* { dg-final { scan-assembler-times "fmov\ts\[0-9\]+, 2\\\.0e\\\+0"  1 } } */
+
+/* { dg-final { scan-assembler-times "mov\tw\[0-9\]+, 16435"                1 } } */
+/* { dg-final { scan-assembler-times "movk\tw\[0-9\]+, 0xc69c, lsl 16"      1 } } */
+
index c917f81c022c64915b594c3f230add7fa2cc693f..114d8c1a6c307b688085b0e1648ebe55e04e8857 100644 (file)
@@ -4,10 +4,10 @@
 #pragma GCC target ("+nothing+simd, cmodel=small")
 
 int
-cal (float a)
+cal (double a)
 {
-  float b = 1.2;
-  float c = 2.2;
+  double b = 3.2;
+  double c = 2.2;
   if ((a + b) != c)
     return 0;
   else
@@ -19,11 +19,11 @@ cal (float a)
 #pragma GCC target ("cmodel=large")
 
 int
-cal2 (float a)
+cal2 (double a)
 {
 
-  float b = 1.2;
-  float c = 2.2;
+  double b = 3.2;
+  double c = 2.2;
   if ((a + b) != c)
     return 0;
   else
@@ -33,11 +33,11 @@ cal2 (float a)
 #pragma GCC pop_options
 
 int
-cal3 (float a)
+cal3 (double a)
 {
 
-  float b = 1.2;
-  float c = 2.2;
+  double b = 3.2;
+  double c = 2.2;
   if ((a + b) != c)
     return 0;
   else