From 8acb8421b9b828ab4b6fd9e544a35ce1e39607ed Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Fri, 28 Jul 2017 15:14:25 +0000 Subject: dbl_mov_immediate_1.c: New. 2017-07-28 Tamar Christina Bilyan Borisov * 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 From-SVN: r250674 --- gcc/testsuite/ChangeLog | 9 ++++ .../gcc.target/aarch64/dbl_mov_immediate_1.c | 53 ++++++++++++++++++++++ .../gcc.target/aarch64/f16_mov_immediate_1.c | 49 ++++++++++++++++++++ .../gcc.target/aarch64/f16_mov_immediate_2.c | 45 ++++++++++++++++++ .../gcc.target/aarch64/flt_mov_immediate_1.c | 52 +++++++++++++++++++++ gcc/testsuite/gcc.target/aarch64/pr63304_1.c | 18 ++++---- 6 files changed, 217 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/dbl_mov_immediate_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/flt_mov_immediate_1.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e0c6bbe..ab57bfe 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-07-28 Tamar Christina + Bilyan Borisov + + * 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 * 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 index 0000000..e8dd01d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/dbl_mov_immediate_1.c @@ -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 index 0000000..1ed3831e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c @@ -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 index 0000000..6f44821 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_2.c @@ -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 + +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 index 0000000..7b92a5a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/flt_mov_immediate_1.c @@ -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 } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/pr63304_1.c b/gcc/testsuite/gcc.target/aarch64/pr63304_1.c index c917f81c..114d8c1 100644 --- a/gcc/testsuite/gcc.target/aarch64/pr63304_1.c +++ b/gcc/testsuite/gcc.target/aarch64/pr63304_1.c @@ -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 -- cgit v1.1