summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-08-22 10:27:46 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-08-22 10:27:46 +0000
commitf733cf303bcdc952c92b81dd62199a40a1f555ec (patch)
tree0a9a9e0f28aa7c7f5bc4d1d1d0e9647163cac4f7 /gcc/testsuite/gcc.target/aarch64
parente0e4357b88efe5dc53e50d341a09de4d02331200 (diff)
downloadgcc-tarball-gcc-6.2.0.tar.gz
gcc-6.2.0gcc-6.2.0
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/abitest-common.h12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/abitest.S7
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c1
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/test_2.c1
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/test_27.c46
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h18
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-16.c28
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-2.c7
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-4.c9
-rw-r--r--gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-5.c7
-rw-r--r--gcc/testsuite/gcc.target/aarch64/noplt_3.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr70809_1.c18
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/vminmaxnm_1.c82
-rw-r--r--gcc/testsuite/gcc.target/aarch64/tail_indirect_call_1.c4
15 files changed, 240 insertions, 12 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest-common.h b/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest-common.h
index 4e2ef0dace..138de7321e 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest-common.h
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest-common.h
@@ -57,7 +57,17 @@
#define X8 320
#define X9 328
-#define STACK 336
+#define H0 336
+#define H1 338
+#define H2 340
+#define H3 342
+#define H4 344
+#define H5 346
+#define H6 348
+#define H7 350
+
+
+#define STACK 352
/* The type of test. 'myfunc' in abitest.S needs to know which kind of
test it is running to decide what to do at the runtime. Keep the
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest.S b/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest.S
index c2fbd83fcb..893e68cb99 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest.S
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/abitest.S
@@ -13,7 +13,12 @@ dumpregs:
myfunc:
mov x16, sp
mov x17, sp
- sub sp, sp, 352 // 336 for registers and 16 for old sp and lr
+ sub sp, sp, 368 // 352 for registers and 16 for old sp and lr
+
+ sub x17, x17, 8
+ st4 { v4.h, v5.h, v6.h, v7.h }[0], [x17] //344
+ sub x17, x17, 8
+ st4 { v0.h, v1.h, v2.h, v3.h }[0], [x17] //336
stp x8, x9, [x17, #-16]! //320
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c
index a21c9265cd..29a1ca6d45 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c
@@ -44,4 +44,5 @@ FUNC_VAL_CHECK (12, vf2_t, vf2, D0, f32in64)
FUNC_VAL_CHECK (13, vi4_t, vi4, Q0, i32in128)
FUNC_VAL_CHECK (14, int *, int_ptr, X0, flat)
FUNC_VAL_CHECK (15, vlf1_t, vlf1, Q0, flat)
+FUNC_VAL_CHECK (16, __fp16, 0xabcd, H0, flat)
#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_2.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_2.c
index 94817ede3e..ce7c60a8d7 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_2.c
@@ -12,5 +12,6 @@
ARG(double, 4.0, D1)
ARG(float, 2.0f, S2)
ARG(double, 5.0, D3)
+ ARG(__fp16, 8.0f, H4)
LAST_ARG(int, 3, W0)
#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_27.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_27.c
new file mode 100644
index 0000000000..7bc79f5fca
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_27.c
@@ -0,0 +1,46 @@
+/* Test AAPCS64 layout
+
+ Test named homogeneous floating-point aggregates of __fp16 data,
+ which should be passed in SIMD/FP registers or via the stack. */
+
+/* { dg-do run { target aarch64*-*-* } } */
+
+#ifndef IN_FRAMEWORK
+#define TESTFILE "test_27.c"
+
+struct x0
+{
+ __fp16 v[1];
+} f16x1;
+
+struct x1
+{
+ __fp16 v[2];
+} f16x2;
+
+struct x2
+{
+ __fp16 v[3];
+} f16x3;
+
+#define HAS_DATA_INIT_FUNC
+void init_data ()
+{
+ f16x1.v[0] = 2.0f;
+ f16x2.v[0] = 4.0f;
+ f16x2.v[1] = 8.0f;
+ f16x3.v[0] = 16.0f;
+ f16x3.v[1] = 32.0f;
+ f16x3.v[2] = 64.0f;
+}
+
+#include "abitest.h"
+#else
+ARG (struct x0, f16x1, H0)
+ARG (struct x1, f16x2, H1)
+ARG (struct x2, f16x3, H3)
+ARG (struct x1, f16x2, H6)
+ARG (struct x0, f16x1, STACK)
+ARG (int, 0xdeadbeef, W0)
+LAST_ARG (double, 456.789, STACK+8)
+#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h b/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
index 3b9b3499ec..ca1fa5811f 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
@@ -44,6 +44,24 @@ struct hfa_fx3_t
float c;
};
+struct hfa_f16x1_t
+{
+ __fp16 a;
+};
+
+struct hfa_f16x2_t
+{
+ __fp16 a;
+ __fp16 b;
+};
+
+struct hfa_f16x3_t
+{
+ __fp16 a;
+ __fp16 b;
+ __fp16 c;
+};
+
struct hfa_dx2_t
{
double a;
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-1.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-1.c
index 4fb9a033ad..5b9e0576dc 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-1.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-1.c
@@ -19,6 +19,8 @@ signed short ss = 0xcba9;
signed int ss_promoted = 0xffffcba9;
float fp = 65432.12345f;
double fp_promoted = (double)65432.12345f;
+__fp16 fp16 = 2.0f;
+__fp16 fp16_promoted = (double)2.0f;
#define HAS_DATA_INIT_FUNC
void init_data ()
@@ -46,9 +48,13 @@ void init_data ()
ANON ( long double , 98765432123456789.987654321L, Q2, 12)
ANON ( vf2_t, vf2 , D3, 13)
ANON ( vi4_t, vi4 , Q4, 14)
+ /* 7.2: For unprototyped (i.e. pre- ANSI or K&R C) and variadic functions,
+ in addition to the normal conversions and promotions, arguments of
+ type __fp16 are converted to type double. */
+ ANON_PROMOTED( __fp16, fp16 , double, fp16_promoted, D5, 15)
#ifndef __AAPCS64_BIG_ENDIAN__
- LAST_ANON ( int , 0xeeee, STACK+32,15)
+ LAST_ANON ( int , 0xeeee, STACK+32,16)
#else
- LAST_ANON ( int , 0xeeee, STACK+36,15)
+ LAST_ANON ( int , 0xeeee, STACK+36,16)
#endif
#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-16.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-16.c
new file mode 100644
index 0000000000..73f8f1c7be
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-16.c
@@ -0,0 +1,28 @@
+/* Test AAPCS64 layout and __builtin_va_arg.
+
+ This test is focused particularly on __fp16 unnamed homogeneous
+ floating-point aggregate types which should be passed in fp/simd
+ registers until we run out of those, then the stack. */
+
+/* { dg-do run { target aarch64*-*-* } } */
+
+#ifndef IN_FRAMEWORK
+#define AAPCS64_TEST_STDARG
+#define TESTFILE "va_arg-16.c"
+#include "type-def.h"
+
+struct hfa_f16x1_t hfa_f16x1 = {2.0f};
+struct hfa_f16x2_t hfa_f16x2 = {4.0f, 8.0f};
+struct hfa_f16x3_t hfa_f16x3 = {16.0f, 32.0f, 64.0f};
+
+#include "abitest.h"
+#else
+ ARG (int, 1, W0, LAST_NAMED_ARG_ID)
+ DOTS
+ ANON (struct hfa_f16x1_t, hfa_f16x1, H0 , 0)
+ ANON (struct hfa_f16x2_t, hfa_f16x2, H1 , 1)
+ ANON (struct hfa_f16x3_t, hfa_f16x3, H3 , 2)
+ ANON (struct hfa_f16x2_t, hfa_f16x2, H6 , 3)
+ ANON (struct hfa_f16x1_t, hfa_f16x1, STACK , 4)
+ LAST_ANON(double , 1.0 , STACK+8, 5)
+#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-2.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-2.c
index e972691f4a..8f2f8811b6 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-2.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-2.c
@@ -19,6 +19,8 @@ signed short ss = 0xcba9;
signed int ss_promoted = 0xffffcba9;
float fp = 65432.12345f;
double fp_promoted = (double)65432.12345f;
+__fp16 fp16 = 2.0f;
+__fp16 fp16_promoted = (double)2.0f;
#define HAS_DATA_INIT_FUNC
void init_data ()
@@ -64,9 +66,10 @@ void init_data ()
ANON ( long double , 98765432123456789.987654321L, STACK+80, 20)
ANON ( vf2_t, vf2 , STACK+96, 21)
ANON ( vi4_t, vi4 , STACK+112,22)
+ ANON_PROMOTED( __fp16 , fp16 , double, fp16_promoted, STACK+128,23)
#ifndef __AAPCS64_BIG_ENDIAN__
- LAST_ANON ( int , 0xeeee, STACK+128,23)
+ LAST_ANON ( int , 0xeeee, STACK+136,24)
#else
- LAST_ANON ( int , 0xeeee, STACK+132,23)
+ LAST_ANON ( int , 0xeeee, STACK+140,24)
#endif
#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-4.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-4.c
index fab3575756..010ad8b3f6 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-4.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-4.c
@@ -29,6 +29,8 @@ struct non_hfa_ffvf2_t non_hfa_ffvf2;
struct non_hfa_fffd_t non_hfa_fffd = {33.f, 34.f, 35.f, 36.0};
union hfa_union_t hfa_union;
union non_hfa_union_t non_hfa_union;
+struct hfa_f16x2_t hfa_f16x2 = {2.0f, 4.0f};
+struct hfa_f16x3_t hfa_f16x3 = {2.0f, 4.0f, 8.0f};
#define HAS_DATA_INIT_FUNC
void init_data ()
@@ -89,9 +91,12 @@ void init_data ()
PTR_ANON (struct non_hfa_ffs_t , non_hfa_ffs , STACK+120, 18)
ANON (struct non_hfa_ffs_2_t, non_hfa_ffs_2, STACK+128, 19)
ANON (union non_hfa_union_t, non_hfa_union, STACK+144, 20)
+ /* HFA of __fp16 passed on stack, directed __fp16 test is va_arg-10.c. */
+ ANON (struct hfa_f16x2_t , hfa_f16x2 , STACK+152, 21)
+ ANON (struct hfa_f16x3_t , hfa_f16x3 , STACK+160, 22)
#ifndef __AAPCS64_BIG_ENDIAN__
- LAST_ANON(int , 2 , STACK+152, 30)
+ LAST_ANON(int , 2 , STACK+168, 30)
#else
- LAST_ANON(int , 2 , STACK+156, 30)
+ LAST_ANON(int , 2 , STACK+172, 30)
#endif
#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-5.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-5.c
index 4853f92a29..e54f1f51fb 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-5.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-5.c
@@ -17,6 +17,8 @@ struct hfa_dx4_t hfa_dx4 = {1234.123, 2345.234, 3456.345, 4567.456};
struct hfa_ldx3_t hfa_ldx3 = {123456.7890, 234567.8901, 345678.9012};
struct hfa_ffs_t hfa_ffs;
union hfa_union_t hfa_union;
+struct hfa_f16x2_t hfa_f16x2 = {2.0f, 4.0f};
+struct hfa_f16x3_t hfa_f16x3 = {2.0f, 4.0f, 8.0f};
#define HAS_DATA_INIT_FUNC
void init_data ()
@@ -43,5 +45,8 @@ void init_data ()
ANON (struct hfa_fx1_t , hfa_fx1 , STACK+24, 4)
ANON (struct hfa_fx2_t , hfa_fx2 , STACK+32, 5)
ANON (struct hfa_dx2_t , hfa_dx2 , STACK+40, 6)
- LAST_ANON(double , 1.0 , STACK+56, 7)
+ /* HFA of __fp16 passed on stack, directed __fp16 test is va_arg-10.c. */
+ ANON (struct hfa_f16x2_t, hfa_f16x2, STACK+56, 7)
+ ANON (struct hfa_f16x3_t, hfa_f16x3, STACK+64, 8)
+ LAST_ANON(double , 1.0 , STACK+72, 9)
#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/noplt_3.c b/gcc/testsuite/gcc.target/aarch64/noplt_3.c
index ef6e65da8f..a382618454 100644
--- a/gcc/testsuite/gcc.target/aarch64/noplt_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/noplt_3.c
@@ -16,5 +16,5 @@ cal_novalue (int a)
dec (a);
}
-/* { dg-final { scan-assembler-times "br" 2 } } */
+/* { dg-final { scan-assembler-times "br\t" 2 } } */
/* { dg-final { scan-assembler-not "b\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/pr70809_1.c b/gcc/testsuite/gcc.target/aarch64/pr70809_1.c
new file mode 100644
index 0000000000..df88c71c42
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr70809_1.c
@@ -0,0 +1,18 @@
+/* PR target/70809. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -ffp-contract=off -mtune=xgene1" } */
+
+/* Check that vector FMLS is not generated when contraction is disabled. */
+
+void
+foo (float *__restrict__ __attribute__ ((aligned (16))) a,
+ float *__restrict__ __attribute__ ((aligned (16))) x,
+ float *__restrict__ __attribute__ ((aligned (16))) y,
+ float *__restrict__ __attribute__ ((aligned (16))) z)
+{
+ unsigned i = 0;
+ for (i = 0; i < 256; i++)
+ a[i] = x[i] - (y[i] * z[i]);
+}
+
+/* { dg-final { scan-assembler-not "fmls\tv.*" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vminmaxnm_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vminmaxnm_1.c
new file mode 100644
index 0000000000..96608ebb28
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/vminmaxnm_1.c
@@ -0,0 +1,82 @@
+/* Test the `v[min|max]nm{q}_f*' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include "arm_neon.h"
+
+extern void abort ();
+
+#define CHECK(T, N, R, E) \
+ {\
+ int i = 0;\
+ for (; i < N; i++)\
+ if (* (T *) &R[i] != * (T *) &E[i])\
+ abort ();\
+ }
+
+int
+main (int argc, char **argv)
+{
+ float32x2_t f32x2_input1 = vdup_n_f32 (-1.0);
+ float32x2_t f32x2_input2 = vdup_n_f32 (0.0);
+ float32x2_t f32x2_exp_minnm = vdup_n_f32 (-1.0);
+ float32x2_t f32x2_exp_maxnm = vdup_n_f32 (0.0);
+ float32x2_t f32x2_ret_minnm = vminnm_f32 (f32x2_input1, f32x2_input2);
+ float32x2_t f32x2_ret_maxnm = vmaxnm_f32 (f32x2_input1, f32x2_input2);
+
+ CHECK (uint32_t, 2, f32x2_ret_minnm, f32x2_exp_minnm);
+ CHECK (uint32_t, 2, f32x2_ret_maxnm, f32x2_exp_maxnm);
+
+ f32x2_input1 = vdup_n_f32 (__builtin_nanf (""));
+ f32x2_input2 = vdup_n_f32 (1.0);
+ f32x2_exp_minnm = vdup_n_f32 (1.0);
+ f32x2_exp_maxnm = vdup_n_f32 (1.0);
+ f32x2_ret_minnm = vminnm_f32 (f32x2_input1, f32x2_input2);
+ f32x2_ret_maxnm = vmaxnm_f32 (f32x2_input1, f32x2_input2);
+
+ CHECK (uint32_t, 2, f32x2_ret_minnm, f32x2_exp_minnm);
+ CHECK (uint32_t, 2, f32x2_ret_maxnm, f32x2_exp_maxnm);
+
+ float32x4_t f32x4_input1 = vdupq_n_f32 (-1024.0);
+ float32x4_t f32x4_input2 = vdupq_n_f32 (77.0);
+ float32x4_t f32x4_exp_minnm = vdupq_n_f32 (-1024.0);
+ float32x4_t f32x4_exp_maxnm = vdupq_n_f32 (77.0);
+ float32x4_t f32x4_ret_minnm = vminnmq_f32 (f32x4_input1, f32x4_input2);
+ float32x4_t f32x4_ret_maxnm = vmaxnmq_f32 (f32x4_input1, f32x4_input2);
+
+ CHECK (uint32_t, 4, f32x4_ret_minnm, f32x4_exp_minnm);
+ CHECK (uint32_t, 4, f32x4_ret_maxnm, f32x4_exp_maxnm);
+
+ f32x4_input1 = vdupq_n_f32 (-__builtin_nanf (""));
+ f32x4_input2 = vdupq_n_f32 (-1.0);
+ f32x4_exp_minnm = vdupq_n_f32 (-1.0);
+ f32x4_exp_maxnm = vdupq_n_f32 (-1.0);
+ f32x4_ret_minnm = vminnmq_f32 (f32x4_input1, f32x4_input2);
+ f32x4_ret_maxnm = vmaxnmq_f32 (f32x4_input1, f32x4_input2);
+
+ CHECK (uint32_t, 4, f32x4_ret_minnm, f32x4_exp_minnm);
+ CHECK (uint32_t, 4, f32x4_ret_maxnm, f32x4_exp_maxnm);
+
+ float64x2_t f64x2_input1 = vdupq_n_f64 (1.23);
+ float64x2_t f64x2_input2 = vdupq_n_f64 (4.56);
+ float64x2_t f64x2_exp_minnm = vdupq_n_f64 (1.23);
+ float64x2_t f64x2_exp_maxnm = vdupq_n_f64 (4.56);
+ float64x2_t f64x2_ret_minnm = vminnmq_f64 (f64x2_input1, f64x2_input2);
+ float64x2_t f64x2_ret_maxnm = vmaxnmq_f64 (f64x2_input1, f64x2_input2);
+
+ CHECK (uint64_t, 2, f64x2_ret_minnm, f64x2_exp_minnm);
+ CHECK (uint64_t, 2, f64x2_ret_maxnm, f64x2_exp_maxnm);
+
+ f64x2_input1 = vdupq_n_f64 (-__builtin_nan (""));
+ f64x2_input2 = vdupq_n_f64 (1.0);
+ f64x2_exp_minnm = vdupq_n_f64 (1.0);
+ f64x2_exp_maxnm = vdupq_n_f64 (1.0);
+ f64x2_ret_minnm = vminnmq_f64 (f64x2_input1, f64x2_input2);
+ f64x2_ret_maxnm = vmaxnmq_f64 (f64x2_input1, f64x2_input2);
+
+ CHECK (uint64_t, 2, f64x2_ret_minnm, f64x2_exp_minnm);
+ CHECK (uint64_t, 2, f64x2_ret_maxnm, f64x2_exp_maxnm);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/tail_indirect_call_1.c b/gcc/testsuite/gcc.target/aarch64/tail_indirect_call_1.c
index 4759d20df9..de8f12d6e2 100644
--- a/gcc/testsuite/gcc.target/aarch64/tail_indirect_call_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/tail_indirect_call_1.c
@@ -3,8 +3,8 @@
typedef void FP (int);
-/* { dg-final { scan-assembler "br" } } */
-/* { dg-final { scan-assembler-not "blr" } } */
+/* { dg-final { scan-assembler-times "br\t" 2 } } */
+/* { dg-final { scan-assembler-not "blr\t" } } */
void
f1 (FP fp, int n)
{