+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.
--- /dev/null
+/* { 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 } } */
+
--- /dev/null
+/* { 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 } } */
--- /dev/null
+/* { 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 } } */
+
--- /dev/null
+/* { 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 } } */
+
#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
#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
#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