From: Kyrylo Tkachov Date: Tue, 17 Apr 2018 16:34:56 +0000 (+0000) Subject: [AArch64/arm] PR testsuite/85326 Avoid C++ tests when C++ compiler not present X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a422e1ca494ee59303caf362fede7cc142ce678c;p=gcc.git [AArch64/arm] PR testsuite/85326 Avoid C++ tests when C++ compiler not present PR testsuite/85326 * gcc.target/arm/pr54300.C: Move to... * g++.dg/other/pr54300.C: ... Here. Add target directives. * gcc.target/arm/pr55073.C: Move to... * g++.dg/other/pr55073.C: ... Here. Add target directives. * gcc.target/arm/pr56184.C: Move to... * g++.dg/other/pr56184.C: ... Here. Add target directives. * gcc.target/arm/pr59985.C: Move to... * g++.dg/other/pr59985.C: ... Here. Add target directives. * gcc.target/aarch64/pr60675.C: Move to... * g++.dg/other/pr60675.C: ... Here. Add target directives. * gcc.target/aarch64/pr81422.C: Move to... * g++.dg/other/pr81422.C: ... Here. Add target directives. * gcc.target/aarch64/sve/const_pred_1.C: Move to... * g++.dg/other/sve_const_pred_1.C: ... Here. Add target directives. * gcc.target/aarch64/sve/const_pred_2.C: Move to... * g++.dg/other/sve_const_pred_2.C: ... Here. Add target directives. * gcc.target/aarch64/sve/const_pred_3.C: Move to... * g++.dg/other/sve_const_pred_3.C: ... Here. Add target directives. * gcc.target/aarch64/sve/const_pred_4.C: Move to... * g++.dg/other/sve_const_pred_4.C: ... Here. Add target directives. * gcc.target/aarch64/sve/tls_2.C: Move to... * g++.dg/other/sve_tls_2.C: ... Here. Add target directives. * gcc.target/aarch64/pr81414.C: Rename to... * gcc.target/aarch64/pr81414.c: ... This. * gcc.target/aarch64/simd/pr67896.C: Rename to... * gcc.target/aarch64/simd/pr67896.c: ... This. Update error expected messages. * gcc.target/aarch64/sve/vcond_1.C: Rename to... * gcc.target/aarch64/sve/vcond_1.c: ... This. Avoid use of stdint.h. * gcc.target/aarch64/sve/vcond_1_run.C: Rename to... * gcc.target/aarch64/sve/vcond_1_run.c: ... This. Update include file name. From-SVN: r259435 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 95bdc0349b4..af61628ca76 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,39 @@ +2018-04-17 Kyrylo Tkachov + + PR testsuite/85326 + * gcc.target/arm/pr54300.C: Move to... + * g++.dg/other/pr54300.C: ... Here. Add target directives. + * gcc.target/arm/pr55073.C: Move to... + * g++.dg/other/pr55073.C: ... Here. Add target directives. + * gcc.target/arm/pr56184.C: Move to... + * g++.dg/other/pr56184.C: ... Here. Add target directives. + * gcc.target/arm/pr59985.C: Move to... + * g++.dg/other/pr59985.C: ... Here. Add target directives. + * gcc.target/aarch64/pr60675.C: Move to... + * g++.dg/other/pr60675.C: ... Here. Add target directives. + * gcc.target/aarch64/pr81422.C: Move to... + * g++.dg/other/pr81422.C: ... Here. Add target directives. + * gcc.target/aarch64/sve/const_pred_1.C: Move to... + * g++.dg/other/sve_const_pred_1.C: ... Here. Add target directives. + * gcc.target/aarch64/sve/const_pred_2.C: Move to... + * g++.dg/other/sve_const_pred_2.C: ... Here. Add target directives. + * gcc.target/aarch64/sve/const_pred_3.C: Move to... + * g++.dg/other/sve_const_pred_3.C: ... Here. Add target directives. + * gcc.target/aarch64/sve/const_pred_4.C: Move to... + * g++.dg/other/sve_const_pred_4.C: ... Here. Add target directives. + * gcc.target/aarch64/sve/tls_2.C: Move to... + * g++.dg/other/sve_tls_2.C: ... Here. Add target directives. + * gcc.target/aarch64/pr81414.C: Rename to... + * gcc.target/aarch64/pr81414.c: ... This. + * gcc.target/aarch64/simd/pr67896.C: Rename to... + * gcc.target/aarch64/simd/pr67896.c: ... This. Update error expected + messages. + * gcc.target/aarch64/sve/vcond_1.C: Rename to... + * gcc.target/aarch64/sve/vcond_1.c: ... This. Avoid use of stdint.h. + * gcc.target/aarch64/sve/vcond_1_run.C: Rename to... + * gcc.target/aarch64/sve/vcond_1_run.c: ... This. Update include + file name. + 2018-04-17 Jakub Jelinek PR middle-end/85414 diff --git a/gcc/testsuite/g++.dg/other/pr54300.C b/gcc/testsuite/g++.dg/other/pr54300.C new file mode 100644 index 00000000000..e16646a3041 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr54300.C @@ -0,0 +1,63 @@ +/* { dg-do run { target arm*-*-* } } */ +/* { dg-require-effective-target arm_neon } */ +/* { dg-options "-O2" } */ +/* { dg-add-options arm_neon } */ + +#include +#include + +struct __attribute__ ((aligned(8))) _v16u8_ { + uint8x16_t val; + _v16u8_( const int16x8_t &src) { val = vreinterpretq_u8_s16(src); } + operator int16x8_t () const { return vreinterpretq_s16_u8(val); } +}; +typedef struct _v16u8_ v16u8; + +struct __attribute__ ((aligned(4))) _v8u8_ { + uint8x8_t val; + _v8u8_( const uint8x8_t &src) { val = src; } + operator int16x4_t () const { return vreinterpret_s16_u8(val); } +}; +typedef struct _v8u8_ v8u8; + +typedef v16u8 v8i16; +typedef int32x4_t v4i32; +typedef const short cv1i16; +typedef const unsigned char cv1u8; +typedef const v8i16 cv8i16; + +static inline __attribute__((always_inline)) v8u8 zero_64(){ return vdup_n_u8( 0 ); } + +static inline __attribute__((always_inline)) v8i16 loadlo_8i16( cv8i16* p ){ + return vcombine_s16( vld1_s16( (cv1i16 *)p ), zero_64() ); +} +static inline __attribute__((always_inline)) v8i16 _loadlo_8i16( cv8i16* p, int offset ){ + return loadlo_8i16( (cv8i16*)(&((cv1u8*)p)[offset]) ); +} + +void __attribute__((noinline)) +test(unsigned short *_Inp, int32_t *_Out, + unsigned int s1v, unsigned int dv0, + unsigned int smask_v) +{ + int32x4_t c = vdupq_n_s32(0); + + for(unsigned int sv=0 ; sv!=dv0 ; sv=(sv+s1v)&smask_v ) + { + int32x4_t s; + s = vmovl_s16( vget_low_s16( _loadlo_8i16( (cv8i16*) _Inp, sv ) ) ); + c = vaddq_s32( c, s ); + } + vst1q_s32( _Out, c ); +} + +int +main() +{ + unsigned short a[4] = {1, 2, 3, 4}; + int32_t b[4] = {0, 0, 0, 0}; + test(a, b, 1, 1, ~0); + if (b[0] != 1 || b[1] != 2 || b[2] != 3 || b[3] != 4) + abort(); + return 0; +} diff --git a/gcc/testsuite/g++.dg/other/pr55073.C b/gcc/testsuite/g++.dg/other/pr55073.C new file mode 100644 index 00000000000..859c5d46a09 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr55073.C @@ -0,0 +1,74 @@ +/* { dg-do run { target arm*-*-* } } */ +/* { dg-require-effective-target arm_neon } */ +/* { dg-options "-O2" } */ +/* { dg-add-options arm_neon } */ + +#include +#include + +struct __attribute__((aligned(16))) _v16u8_ { + uint8x16_t val; + _v16u8_() { } + + _v16u8_( const uint8x16_t &src) { val = src; } + _v16u8_( const int16x8_t &src) { val = vreinterpretq_u8_s16(src); } + _v16u8_( const uint32x4_t &src) { val = vreinterpretq_u8_u32(src); } + + operator uint8x16_t () const { return val; } + operator int8x16_t () const { return vreinterpretq_s8_u8 (val); } + operator int16x8_t () const { return vreinterpretq_s16_u8(val); } + operator uint32x4_t () const { return vreinterpretq_u32_u8(val); } + operator int32x4_t () const { return vreinterpretq_s32_u8(val); } +}; +typedef struct _v16u8_ v16u8; +typedef const v16u8 cv16u8; + +typedef v16u8 v16i8; +typedef v16u8 v8i16; +typedef v16u8 v4u32; + +inline v16u8 __attribute__((always_inline)) mergelo( const v16u8 & s, const v16u8 & t ) +{ + uint8x8x2_t r = vzip_u8( vget_low_u8(s), vget_low_u8(t) ); + return vcombine_u8( r.val[0], r.val[1] ); +} + +inline v8i16 __attribute__((always_inline)) unpacklo(const v16i8 & s) +{ + return vmovl_s8( vget_low_s8( s ) ); +} + +const uint32_t __attribute__((aligned(16))) _InA [4] = { 0xFF020001, 0xFF020001, 0xFF000101, 0xFF000101 } ; +const uint32_t __attribute__((aligned(16))) _InB [4] = { 0xFF050002, 0xFF050002, 0xFF000303, 0xFF000203 } ; + +__attribute__((noinline)) v16i8 test_func(void) +{ + v16u8 A = vld1q_u8( (uint8_t*) _InA ); + v16u8 B = vld1q_u8( (uint8_t*) _InB ); + v8i16 r = vdupq_n_s16(2); + + v16u8 _0 = mergelo( A, B ); + v16u8 _1 = mergelo( B, A ); + + v16u8 _2 = mergelo( _0, _1 ); + v16u8 _3 = mergelo( _1, _0 ); + + v8i16 _4 = vsubq_s16( unpacklo( _2 ), r ); + v8i16 _5 = vsubq_s16( unpacklo( _3 ), r ); + + v8i16 ret = vaddq_s16( _4, _5 ); + + return ( ret ); +} + +int main (int argc, char **argv) +{ + v16u8 val = test_func(); + + if (vgetq_lane_u32( val, 0 ) != 0xffffffff + || vgetq_lane_u32( val, 1 ) != 0xffffffff + || vgetq_lane_u32( val, 2 ) != 0xfffcfffc + || vgetq_lane_u32( val, 3 ) != 0xfffcfffc) + abort (); + exit (0); +} diff --git a/gcc/testsuite/g++.dg/other/pr56184.C b/gcc/testsuite/g++.dg/other/pr56184.C new file mode 100644 index 00000000000..dc949283c98 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr56184.C @@ -0,0 +1,258 @@ +/* { dg-do compile { target arm*-*-* } } */ +/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */ +/* { dg-options "-fno-short-enums -O2 -mthumb -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a9 -fno-section-anchors -Wno-return-type" } */ + +typedef unsigned int size_t; +__extension__ typedef int __intptr_t; +typedef __intptr_t intptr_t; +typedef union tree_node *tree; +typedef const union tree_node *const_tree; +extern void *ggc_internal_cleared_alloc_stat (size_t ) + __attribute__ ((__malloc__)); +enum tree_code { +TREE_LIST=2, +FUNCTION_DECL, +MAX_TREE_CODES=254 +}; +extern unsigned char tree_contains_struct[MAX_TREE_CODES][64]; +struct tree_base { + enum tree_code code : 16; +}; +struct tree_common { + tree chain; +}; +enum tree_node_structure_enum { +TS_COMMON, +TS_DECL_COMMON, +}; +extern void tree_contains_struct_check_failed (const_tree, + const enum tree_node_structure_enum, + const char *, int, const char *) + __attribute__ ((__noreturn__)); +extern void tree_check_failed (const_tree, const char *, int, const char *, + ...) __attribute__ ((__noreturn__)); +struct tree_list { + tree value; +}; +struct tree_decl_common { + tree initial; +}; +struct tree_function_decl { + struct function *f; +}; +union + tree_node { + struct tree_base base; + struct tree_common common; + struct tree_decl_common decl_common; + struct tree_function_decl function_decl; + struct tree_list list; +}; +inline tree +tree_check (tree __t, const char *__f, int __l, const char *__g, enum tree_code __c) +{ + if (((enum tree_code) (__t)->base.code) != __c) + tree_check_failed (__t, __f, __l, __g, __c, 0); +} +inline tree +contains_struct_check (tree __t, const enum tree_node_structure_enum __s, + const char *__f, int __l, const char *__g) +{ + if (tree_contains_struct[((enum tree_code) (__t)->base.code)][__s] != 1) + tree_contains_struct_check_failed (__t, __s, __f, __l, __g); +} +struct function { + tree static_chain_decl; +}; +enum gimple_code { + LAST_AND_UNUSED_GIMPLE_CODE +}; +struct eh_catch_d +{ + struct eh_catch_d *next_catch; + struct eh_catch_d *prev_catch; + tree type_list; + tree filter_list; + tree label; +}; +struct eh_region_d +{ + struct eh_region_d *outer; + struct eh_region_d *inner; + int index; + union eh_region_u { + struct eh_region_u_try { + struct eh_catch_d *first_catch; + } eh_try; + } u; +}; +typedef struct eh_catch_d *eh_catch; +typedef struct eh_region_d *eh_region; +extern void add_type_for_runtime (tree); +enum LTO_tags +{ + LTO_null = 0, + LTO_bb0 = 1 + MAX_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE, + LTO_ert_cleanup, + LTO_NUM_TAGS +}; +enum lto_section_type +{ + LTO_section_function_body, +}; +struct lto_input_block +{ + const char *data; + unsigned int p; + unsigned int len; +}; +extern void lto_section_overrun (struct lto_input_block *) __attribute__ ((__noreturn__)); +extern void lto_value_range_error (const char *, + long long, long long, + long long) __attribute__ ((__noreturn__)); +long long streamer_read_hwi (struct lto_input_block *); +static inline unsigned char +streamer_read_uchar (struct lto_input_block *ib) +{ + if (ib->p >= ib->len) + lto_section_overrun (ib); + return (ib->data[ib->p++]); +} +static inline long long +streamer_read_hwi_in_range (struct lto_input_block *ib, + const char *purpose, + long long min, + long long max) +{ + long long range = max - min; + long long val = streamer_read_uchar (ib); + if (range >= 0xff) + val |= ((long long)streamer_read_uchar (ib)) << 8; + if (val < min || val > max) + lto_value_range_error (purpose, val, min, max); + return val; +} +static inline enum LTO_tags +streamer_read_record_start (struct lto_input_block *ib) +{ + return (enum LTO_tags)streamer_read_hwi_in_range ((ib), "LTO_tags", 0, (int)(LTO_NUM_TAGS) - 1); +} +struct streamer_hooks { + tree (*read_tree) (struct lto_input_block *, struct data_in *); +}; +extern struct streamer_hooks streamer_hooks; +static struct eh_catch_d * +lto_input_eh_catch_list (struct lto_input_block *ib, struct data_in *data_in, + eh_catch *last_p) +{ + eh_catch first; + enum LTO_tags tag; + *last_p = first = __null; + tag = streamer_read_record_start (ib); + while (tag) + { + tree list; + eh_catch n; + n = ((struct eh_catch_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_catch_d) ))); + n->type_list = streamer_hooks.read_tree(ib, data_in); + n->filter_list = streamer_hooks.read_tree(ib, data_in); + n->label = streamer_hooks.read_tree(ib, data_in); + for (list = n->filter_list; list; list = ((contains_struct_check ((list), (TS_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 275, __FUNCTION__))->common.chain)) + add_type_for_runtime (((tree_check ((list), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 276, __FUNCTION__, (TREE_LIST)))->list.value)); + if (*last_p) + (*last_p)->next_catch = n; + n->prev_catch = *last_p; + *last_p = n; + if (first == __null) + first = n; + tag = streamer_read_record_start (ib); + } + return first; +} +static eh_region +input_eh_region (struct lto_input_block *ib, struct data_in *data_in, int ix) +{ + enum LTO_tags tag; + eh_region r; + tag = streamer_read_record_start (ib); + if (tag == LTO_null) + return __null; + r = ((struct eh_region_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_region_d) ))); + r->index = streamer_read_hwi (ib); + r->outer = (eh_region) (intptr_t) streamer_read_hwi (ib); + r->inner = (eh_region) (intptr_t) streamer_read_hwi (ib); + switch (tag) + { + case LTO_ert_cleanup: + { + struct eh_catch_d *last_catch; + r->u.eh_try.first_catch = lto_input_eh_catch_list (ib, data_in, + &last_catch); + } + { + tree l; + add_type_for_runtime (((tree_check ((l), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 346, __FUNCTION__, (TREE_LIST)))->list.value)); + } + } +} +static void +input_eh_regions (struct lto_input_block *ib, struct data_in *data_in, + struct function *fn) +{ + long long i, root_region, len; + enum LTO_tags tag; + tag = streamer_read_record_start (ib); + if (tag == LTO_null) + return; + len = streamer_read_hwi (ib); + if (len > 0) + { + for (i = 0; i < len; i++) + { + eh_region r = input_eh_region (ib, data_in, i); + } + } +} +static void +input_ssa_names (struct lto_input_block *ib, struct data_in *data_in, + struct function *fn) +{ + unsigned int i, size; + while (i) + { + } +} +static void +input_struct_function_base (struct function *fn, struct data_in *data_in, + struct lto_input_block *ib) +{ + fn->static_chain_decl = streamer_hooks.read_tree(ib, data_in); +} +static void +input_function (tree fn_decl, struct data_in *data_in, + struct lto_input_block *ib) +{ + struct function *fn; + enum LTO_tags tag; + fn = ((tree_check ((fn_decl), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 807, __FUNCTION__, (FUNCTION_DECL)))->function_decl.f); + tag = streamer_read_record_start (ib); + input_struct_function_base (fn, data_in, ib); + input_ssa_names (ib, data_in, fn); + input_eh_regions (ib, data_in, fn); + ((contains_struct_check ((fn_decl), (TS_DECL_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 823, __FUNCTION__))->decl_common.initial) = streamer_hooks.read_tree(ib, data_in); +} +static void +lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, + const char *data, enum lto_section_type section_type) +{ + struct data_in *data_in; + struct lto_input_block ib_main; + input_function (fn_decl, data_in, &ib_main); +} +void +lto_input_function_body (struct lto_file_decl_data *file_data, + tree fn_decl, const char *data) +{ + lto_read_body (file_data, fn_decl, data, LTO_section_function_body); +} + diff --git a/gcc/testsuite/g++.dg/other/pr59985.C b/gcc/testsuite/g++.dg/other/pr59985.C new file mode 100644 index 00000000000..7c9bfab35f1 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr59985.C @@ -0,0 +1,70 @@ +/* { dg-do compile { target arm*-*-* } } */ +/* { dg-skip-if "incompatible options" { arm_thumb1 } } */ +/* { dg-options "-g -fcompare-debug -O2 -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard" } */ +/* { dg-skip-if "need hardfp abi" { *-*-* } { "-mfloat-abi=soft" } { "" } } */ + +extern void *f1 (unsigned long, unsigned long); +extern const struct line_map *f2 (void *, int, unsigned int, const char *, unsigned int); +extern unsigned int f3 (void *, unsigned int); +extern void *v1; +struct B { const char *s; int t; }; +struct C { unsigned u; unsigned long long v; void *w; }; +unsigned long long f4 (struct C *); +const char *f5 (void *, unsigned int, unsigned int *); +unsigned long long f6 (void *); + +static inline unsigned long long +f7 (struct C *x, unsigned y) +{ + unsigned long long a, b; + int u = x->u; + a = y == 64 ? -1ULL : (1ULL << y) - 1; + if (u + y > 64) + { + f6 (x->w); + x->u = y; + return b & a; + } + b = x->v; + b >>= u; + x->u = u + y; + return b & a; +} + +static const char * +f8 (const char *x) +{ + B **a; + unsigned long t = __builtin_strlen (x); + char *b; + struct B *c; + b = (char *) f1 (t + 1, 1); + c = (struct B *) f1 (1, sizeof (struct B)); + __builtin_memcpy (b, x, t + 1); + c->t = t; + struct B *d = *a; + return d->s; +} + +unsigned int +f9 (struct C *x, void *y) +{ + static const char *a; + static int b; + static int c; + bool d, e, f; + unsigned t; + bool prev_file = a != __null; + if (f7 (x, 1)) + return ((unsigned int) 0); + d = f7 (x, 1); + e = f7 (x, 1); + f = f7 (x, 1); + a = f8 (f5 (y, f4 (x), &t)); + if (e) b = f4 (x); + if (f) + if (d) + if (prev_file) + f2 (v1, 1, false, __null, 0); + return f3 (v1, c); +} diff --git a/gcc/testsuite/g++.dg/other/pr60675.C b/gcc/testsuite/g++.dg/other/pr60675.C new file mode 100644 index 00000000000..11001559147 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr60675.C @@ -0,0 +1,277 @@ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-std=c++11 -w -O2 -fPIC" } */ +namespace CLHEP { + static const double meter = 1000.*10; + static const double meter2 = meter*meter; + static const double megaelectronvolt = 1. ; + static const double gigaelectronvolt = 1.e+3; + static const double GeV = gigaelectronvolt; + static const double megavolt = megaelectronvolt; + static const double volt = 1.e-6*megavolt; + static const double tesla = volt*1.e+9/meter2; + } + using CLHEP::GeV; + using CLHEP::tesla; + namespace std { + typedef long int ptrdiff_t; + } + extern "C" { + extern double cos (double __x) throw (); + extern double sin (double __x) throw (); + extern double sqrt (double __x) throw (); + } + namespace std __attribute__ ((__visibility__ ("default"))) { + using ::cos; + using ::sin; + using ::sqrt; + template struct char_traits; + template > struct basic_ostream; + typedef basic_ostream ostream; + template struct iterator_traits { }; + template struct iterator_traits<_Tp*> { + typedef ptrdiff_t difference_type; + typedef _Tp& reference; + }; + } + namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { + using std::iterator_traits; + template struct __normal_iterator { + _Iterator _M_current; + typedef iterator_traits<_Iterator> __traits_type; + typedef typename __traits_type::difference_type difference_type; + typedef typename __traits_type::reference reference; + explicit __normal_iterator(const _Iterator& __i) : _M_current(__i) { } + reference operator*() const { + return *_M_current; + } + __normal_iterator operator+(difference_type __n) const { + return __normal_iterator(_M_current + __n); + } + }; + template struct new_allocator { + }; + } + namespace std __attribute__ ((__visibility__ ("default"))) { + template struct allocator: public __gnu_cxx::new_allocator<_Tp> { + }; + struct ios_base { }; + template struct basic_ios : public ios_base { }; + template struct basic_ostream : virtual public basic_ios<_CharT, _Traits> { + typedef basic_ostream<_CharT, _Traits> __ostream_type; + __ostream_type& operator<<(__ostream_type& (*__pf)(__ostream_type&)) { } + __ostream_type& operator<<(const void* __p) { + return _M_insert(__p); + } + template __ostream_type& _M_insert(_ValueT __v); + }; + template inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { + } + } + typedef double G4double; + typedef int G4int; + extern __thread std::ostream *G4cout_p; + struct G4Field; + struct G4FieldManager { + inline G4Field* GetDetectorField() ; + }; + namespace CLHEP { + struct Hep3Vector { + Hep3Vector(double x, double y, double z); + inline ~Hep3Vector(); + inline double x() const; + inline double y() const; + inline double z() const; + inline double mag() const; + inline Hep3Vector cross(const Hep3Vector &) const; + double dx; + double dy; + double dz; + }; + Hep3Vector operator / (const Hep3Vector &, double a); + inline double Hep3Vector::x() const { + return dx; + } + inline double Hep3Vector::y() const { + return dy; + } + inline double Hep3Vector::z() const { + return dz; + } + inline Hep3Vector operator + (const Hep3Vector & a, const Hep3Vector & b) { } + inline Hep3Vector operator * (const Hep3Vector & p, double a) { } + inline double operator * (const Hep3Vector & a, const Hep3Vector & b) { } + inline Hep3Vector::Hep3Vector(double x1, double y1, double z1) : dx(x1), dy(y1), dz(z1) { + } + inline Hep3Vector::~Hep3Vector() { } + inline Hep3Vector Hep3Vector::cross(const Hep3Vector & p) const { + return Hep3Vector(dy*p.dz-p.dy*dz, dz*p.dx-p.dz*dx, dx*p.dy-p.dx*dy); + } + } + typedef CLHEP::Hep3Vector G4ThreeVector; + namespace std __attribute__ ((__visibility__ ("default"))) { + template > struct vector + { + typedef _Tp *pointer; + typedef __gnu_cxx::__normal_iterator iterator; + iterator begin() { } + }; + } + struct G4TransportationManager { + static G4TransportationManager* GetTransportationManager(); + inline G4FieldManager* GetFieldManager() const; + }; + struct G4ErrorMatrix { + G4ErrorMatrix(G4int p, G4int q, G4int i); + virtual ~G4ErrorMatrix(); + struct G4ErrorMatrix_row { + inline G4ErrorMatrix_row(G4ErrorMatrix&,G4int); + G4double & operator[](G4int); + G4ErrorMatrix& _a; + G4int _r; + }; + inline G4ErrorMatrix_row operator[] (G4int); + std::vector m; + G4int nrow, ncol; + }; + inline G4ErrorMatrix::G4ErrorMatrix_row G4ErrorMatrix::operator[] (G4int r) { + G4ErrorMatrix_row b(*this,r); + return b; + } + inline G4double &G4ErrorMatrix::G4ErrorMatrix_row::operator[](G4int c) { + return *(_a.m.begin()+_r*_a.ncol+c); + } + inline G4ErrorMatrix:: G4ErrorMatrix_row::G4ErrorMatrix_row(G4ErrorMatrix&a, G4int r) : _a(a) { + _r = r; + }; + struct G4DynamicParticle { + G4double GetCharge() const; + }; + struct G4Step; + struct G4Track { + const G4DynamicParticle* GetDynamicParticle() const; + const G4ThreeVector& GetPosition() const; + G4ThreeVector GetMomentum() const; + const G4Step* GetStep() const; + }; + struct G4StepPoint { + const G4ThreeVector& GetPosition() const; + G4ThreeVector GetMomentum() const; + }; + struct G4Step { + G4StepPoint* GetPreStepPoint() const; + G4double GetStepLength() const; + }; + namespace HepGeom { + template struct BasicVector3D { + T v_[3]; + BasicVector3D(T x1, T y1, T z1) { } + operator T * () { + return v_; + } + T x() const { + return v_[0]; + } + T y() const { + return v_[1]; + } + T z() const { + return v_[2]; + } + T perp2() const { } + T perp() const { + return std::sqrt(perp2()); + } + T mag2() const { } + T mag() const { + return std::sqrt(mag2()); + } + T theta() const { } + }; + inline BasicVector3D operator-(const BasicVector3D & a,const BasicVector3D & b) { } + inline BasicVector3D operator*(const BasicVector3D & v, double a) { } + template struct Point3D : public BasicVector3D { + explicit Point3D(const double * a) : BasicVector3D(a[0],a[1],a[2]) { } + Point3D(const CLHEP::Hep3Vector & v) : BasicVector3D(v.dx,v.dy,v.dz) { } + }; + } + typedef HepGeom::Point3D G4Point3D; + namespace HepGeom { + template struct Vector3D : public BasicVector3D { + Vector3D(const BasicVector3D & v) : BasicVector3D(v) { } + Vector3D(const CLHEP::Hep3Vector & v) : BasicVector3D(v.dx,v.dy,v.dz) { } + operator CLHEP::Hep3Vector () const { } + }; + } + typedef HepGeom::Vector3D G4Vector3D; + struct G4ErrorFreeTrajState +{ + virtual G4int PropagateError( const G4Track* aTrack ); + G4int PropagateErrorMSC( const G4Track* aTrack ); + }; + G4int G4ErrorFreeTrajState::PropagateError( const G4Track* aTrack ) { + G4double stepLengthCm = aTrack->GetStep()->GetStepLength()/10.; + G4Point3D vposPost = aTrack->GetPosition()/10.; + G4Vector3D vpPost = aTrack->GetMomentum()/GeV; + G4Point3D vposPre = aTrack->GetStep()->GetPreStepPoint()->GetPosition()/10.; + G4Vector3D vpPre = aTrack->GetStep()->GetPreStepPoint()->GetMomentum()/GeV; + G4double pPre = vpPre.mag(); + G4double pPost = vpPost.mag(); + G4double pInvPre = 1./pPre; + G4double pInvPost = 1./pPost; + G4double deltaPInv = pInvPost - pInvPre; + G4Vector3D vpPreNorm = vpPre * pInvPre; + G4Vector3D vpPostNorm = vpPost * pInvPost; + (*G4cout_p) << "G4EP: vpPreNorm " << vpPreNorm << " vpPostNorm " << vpPostNorm << std::endl; + G4double sinpPre = std::sin( vpPreNorm.theta() ); + G4double sinpPostInv = 1./std::sin( vpPreNorm.theta() ); + G4ErrorMatrix transf(5, 5, 0 ); + G4double charge = aTrack->GetDynamicParticle()->GetCharge(); + G4double h1[3], h2[3]; + G4Field* field += G4TransportationManager::GetTransportationManager()->GetFieldManager()->GetDetectorField() +; + if( charge != 0. && field ) + { + G4ThreeVector HPre = G4ThreeVector( h1[0], h1[1], h1[2] ) / tesla *10.; + G4ThreeVector HPost= G4ThreeVector( h2[0], h2[1], h2[2] ) / tesla *10.; + { + G4double pInvAver = 1./(pInvPre + pInvPost ); + G4double CFACT8 = 2.997925E-4; + G4ThreeVector vHAverNorm( (HPre*pInvPre + HPost*pInvPost ) * pInvAver * charge * CFACT8 ); + G4double HAver = vHAverNorm.mag(); + G4double pAver = (pPre+pPost)*0.5; + G4double QAver = -HAver/pAver; + G4double thetaAver = QAver * stepLengthCm; + G4double sinThetaAver = std::sin(thetaAver); + G4double cosThetaAver = std::cos(thetaAver); + G4double gamma = vHAverNorm * vpPostNorm; + G4ThreeVector AN2 = vHAverNorm.cross( vpPostNorm ); + G4double AU = 1./vpPreNorm.perp(); + G4ThreeVector vUPre( -AU*vpPreNorm.y(), AU*vpPreNorm.x(), 0. ); + G4ThreeVector vVPre( -vpPreNorm.z()*vUPre.y(), vpPreNorm.z()*vUPre.x(), vpPreNorm.x()*vUPre.y() - vpPreNorm.y()*vUPre.x() ); + AU = 1./vpPostNorm.perp(); + G4ThreeVector vUPost( -AU*vpPostNorm.y(), AU*vpPostNorm.x(), 0. ); + G4ThreeVector vVPost( -vpPostNorm.z()*vUPost.y(), vpPostNorm.z()*vUPost.x(), vpPostNorm.x()*vUPost.y() - vpPostNorm.y()*vUPost.x() ); + G4Point3D deltaPos( vposPre - vposPost ); + G4double QP = QAver * pAver; + G4double ANV = -( vHAverNorm.x()*vUPost.x() + vHAverNorm.y()*vUPost.y() ); + G4double ANU = ( vHAverNorm.x()*vVPost.x() + vHAverNorm.y()*vVPost.y() + vHAverNorm.z()*vVPost.z() ); + G4double OMcosThetaAver = 1. - cosThetaAver; + G4double TMSINT = thetaAver - sinThetaAver; + G4ThreeVector vHUPre( -vHAverNorm.z() * vUPre.y(), vHAverNorm.z() * vUPre.x(), vHAverNorm.x() * vUPre.y() - vHAverNorm.y() * vUPre.x() ); + G4ThreeVector vHVPre( vHAverNorm.y() * vVPre.z() - vHAverNorm.z() * vVPre.y(), vHAverNorm.z() * vVPre.x() - vHAverNorm.x() * vVPre.z(), vHAverNorm.x() * vVPre.y() - vHAverNorm.y() * vVPre.x() ); + transf[0][1] = -deltaPInv/thetaAver* ( TMSINT*gamma*(vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z()) + sinThetaAver*(vVPre.x()*vpPostNorm.x()+vVPre.y()*vpPostNorm.y()+vVPre.z()*vpPostNorm.z()) + OMcosThetaAver*(vHVPre.x()*vpPostNorm.x()+vHVPre.y()*vpPostNorm.y()+vHVPre.z()*vpPostNorm.z()) ); + transf[0][2] = -sinpPre*deltaPInv/thetaAver* ( TMSINT*gamma*(vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() ) + sinThetaAver*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() ) + OMcosThetaAver*(vHUPre.x()*vpPostNorm.x()+vHUPre.y()*vpPostNorm.y()+vHUPre.z()*vpPostNorm.z()) ); + transf[0][3] = -deltaPInv/stepLengthCm*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() ); + transf[1][1] = cosThetaAver*(vVPre.x()*vVPost.x()+vVPre.y()*vVPost.y()+vVPre.z()*vVPost.z()) + sinThetaAver*(vHVPre.x()*vVPost.x()+vHVPre.y()*vVPost.y()+vHVPre.z()*vVPost.z()) + OMcosThetaAver*(vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z())* (vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z()) + ANV*( -sinThetaAver*(vVPre.x()*vpPostNorm.x()+vVPre.y()*vpPostNorm.y()+vVPre.z()*vpPostNorm.z()) + OMcosThetaAver*(vVPre.x()*AN2.x()+vVPre.y()*AN2.y()+vVPre.z()*AN2.z()) - TMSINT*gamma*(vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z()) ); + transf[1][2] = cosThetaAver*(vUPre.x()*vVPost.x()+vUPre.y()*vVPost.y() ) + sinThetaAver*(vHUPre.x()*vVPost.x()+vHUPre.y()*vVPost.y()+vHUPre.z()*vVPost.z()) + OMcosThetaAver*(vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() )* (vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z()) + ANV*( -sinThetaAver*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() ) + OMcosThetaAver*(vUPre.x()*AN2.x()+vUPre.y()*AN2.y() ) - TMSINT*gamma*(vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() ) ); + transf[2][0] = -QP*ANU*(vpPostNorm.x()*deltaPos.x()+vpPostNorm.y()*deltaPos.y()+vpPostNorm.z()*deltaPos.z())*sinpPostInv *(1.+deltaPInv*pAver); + transf[2][3] = -QAver*ANU*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() )*sinpPostInv; + transf[3][4] = (vVPre.x()*vUPost.x()+vVPre.y()*vUPost.y() ); + transf[4][0] = pAver*(vVPost.x()*deltaPos.x()+vVPost.y()*deltaPos.y()+vVPost.z()*deltaPos.z()) *(1.+deltaPInv*pAver); + transf[4][1] = ( sinThetaAver*(vVPre.x()*vVPost.x()+vVPre.y()*vVPost.y()+vVPre.z()*vVPost.z()) + OMcosThetaAver*(vHVPre.x()*vVPost.x()+vHVPre.y()*vVPost.y()+vHVPre.z()*vVPost.z()) + TMSINT*(vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z())* (vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z()) )/QAver; + transf[4][2] = ( sinThetaAver*(vUPre.x()*vVPost.x()+vUPre.y()*vVPost.y() ) + OMcosThetaAver*(vHUPre.x()*vVPost.x()+vHUPre.y()*vVPost.y()+vHUPre.z()*vVPost.z()) + TMSINT*(vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z())* (vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() ) )*sinpPre/QAver; + } + } + PropagateErrorMSC( aTrack ); + } diff --git a/gcc/testsuite/g++.dg/other/pr81422.C b/gcc/testsuite/g++.dg/other/pr81422.C new file mode 100644 index 00000000000..5bcc948996e --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr81422.C @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +struct DArray +{ + __SIZE_TYPE__ length; + int* ptr; +}; + +void foo35(DArray) +{ + static __thread int x[5]; + foo35({5, (int*)&x}); +} + diff --git a/gcc/testsuite/g++.dg/other/sve_const_pred_1.C b/gcc/testsuite/g++.dg/other/sve_const_pred_1.C new file mode 100644 index 00000000000..cc124c06ee5 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/sve_const_pred_1.C @@ -0,0 +1,18 @@ +/* { dg-do compile { target aarch64*-*-* } } */ +/* { dg-options "-O2 -march=armv8.2-a+sve -msve-vector-bits=256" } */ + +#include + +typedef int8_t vnx16qi __attribute__((vector_size(32))); + +vnx16qi +foo (vnx16qi x, vnx16qi y) +{ + return (vnx16qi) { -1, 0, 0, -1, -1, -1, 0, 0, + -1, -1, -1, -1, 0, 0, 0, 0, + -1, -1, -1, -1, -1, -1, -1, -1, + 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y; +} + +/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ +/* { dg-final { scan-assembler {\t\.byte\t57\n\t\.byte\t15\n\t\.byte\t(255|-1)\n\t\.byte\t0\n} } } */ diff --git a/gcc/testsuite/g++.dg/other/sve_const_pred_2.C b/gcc/testsuite/g++.dg/other/sve_const_pred_2.C new file mode 100644 index 00000000000..e3bce397cbf --- /dev/null +++ b/gcc/testsuite/g++.dg/other/sve_const_pred_2.C @@ -0,0 +1,16 @@ +/* { dg-do compile { target aarch64*-*-* } } */ +/* { dg-options "-O2 -march=armv8.2-a+sve -msve-vector-bits=256" } */ + +#include + +typedef int16_t vnx8hi __attribute__((vector_size(32))); + +vnx8hi +foo (vnx8hi x, vnx8hi y) +{ + return (vnx8hi) { -1, 0, 0, -1, -1, -1, 0, 0, + -1, -1, -1, -1, 0, 0, 0, 0 } ? x : y; +} + +/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ +/* { dg-final { scan-assembler {\t\.byte\t65\n\t\.byte\t5\n\t\.byte\t85\n\t\.byte\t0\n} } } */ diff --git a/gcc/testsuite/g++.dg/other/sve_const_pred_3.C b/gcc/testsuite/g++.dg/other/sve_const_pred_3.C new file mode 100644 index 00000000000..9e75f399e4b --- /dev/null +++ b/gcc/testsuite/g++.dg/other/sve_const_pred_3.C @@ -0,0 +1,15 @@ +/* { dg-do compile { target aarch64*-*-* } } */ +/* { dg-options "-O2 -march=armv8.2-a+sve -msve-vector-bits=256" } */ + +#include + +typedef int32_t vnx4si __attribute__((vector_size(32))); + +vnx4si +foo (vnx4si x, vnx4si y) +{ + return (vnx4si) { -1, 0, 0, -1, -1, -1, 0, 0 } ? x : y; +} + +/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ +/* { dg-final { scan-assembler {\t\.byte\t1\n\t\.byte\t16\n\t\.byte\t17\n\t\.byte\t0\n} } } */ diff --git a/gcc/testsuite/g++.dg/other/sve_const_pred_4.C b/gcc/testsuite/g++.dg/other/sve_const_pred_4.C new file mode 100644 index 00000000000..04a13513380 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/sve_const_pred_4.C @@ -0,0 +1,15 @@ +/* { dg-do compile { target aarch64*-*-* } } */ +/* { dg-options "-O2 -march=armv8.2-a+sve -msve-vector-bits=256" } */ + +#include + +typedef int64_t vnx2di __attribute__((vector_size(32))); + +vnx2di +foo (vnx2di x, vnx2di y) +{ + return (vnx2di) { -1, 0, 0, -1 } ? x : y; +} + +/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ +/* { dg-final { scan-assembler {\t\.byte\t1\n\t\.byte\t0\n\t\.byte\t0\n\t\.byte\t1\n} } } */ diff --git a/gcc/testsuite/g++.dg/other/sve_tls_2.C b/gcc/testsuite/g++.dg/other/sve_tls_2.C new file mode 100644 index 00000000000..d159255fc94 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/sve_tls_2.C @@ -0,0 +1,30 @@ +/* { dg-do compile { target aarch64*-*-* } } */ +/* { dg-options "-O2 -march=armv8.2-a+sve -fPIC -msve-vector-bits=256" } */ + +#include + +typedef int8_t v32qi __attribute__((vector_size (32))); + +extern __thread int z; + +void +foo (v32qi *a, int *b) +{ + v32qi x = a[0], y = a[1]; + asm volatile ("" :: "w" ((v32qi) { -1, 0, 0, -1, -1, -1, 0, 0, + -1, -1, -1, -1, 0, 0, 0, 0, + -1, -1, -1, -1, -1, -1, -1, -1, + 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y) + : "memory"); + if (*b) + { + x = a[2], y = a[3]; + asm volatile ("" :: "w" ((v32qi) { -1, 0, 0, -1, -1, -1, 0, 0, + -1, -1, -1, -1, 0, 0, 0, 0, + -1, -1, -1, -1, -1, -1, -1, -1, + 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y), + "r" (z)); + } +} + +/* { dg-final { scan-assembler-times {\tldr\tp[0-9]} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/pr60675.C b/gcc/testsuite/gcc.target/aarch64/pr60675.C deleted file mode 100644 index aa88cdb2403..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/pr60675.C +++ /dev/null @@ -1,277 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-std=c++11 -w -O2 -fPIC" } */ -namespace CLHEP { - static const double meter = 1000.*10; - static const double meter2 = meter*meter; - static const double megaelectronvolt = 1. ; - static const double gigaelectronvolt = 1.e+3; - static const double GeV = gigaelectronvolt; - static const double megavolt = megaelectronvolt; - static const double volt = 1.e-6*megavolt; - static const double tesla = volt*1.e+9/meter2; - } - using CLHEP::GeV; - using CLHEP::tesla; - namespace std { - typedef long int ptrdiff_t; - } - extern "C" { - extern double cos (double __x) throw (); - extern double sin (double __x) throw (); - extern double sqrt (double __x) throw (); - } - namespace std __attribute__ ((__visibility__ ("default"))) { - using ::cos; - using ::sin; - using ::sqrt; - template struct char_traits; - template > struct basic_ostream; - typedef basic_ostream ostream; - template struct iterator_traits { }; - template struct iterator_traits<_Tp*> { - typedef ptrdiff_t difference_type; - typedef _Tp& reference; - }; - } - namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { - using std::iterator_traits; - template struct __normal_iterator { - _Iterator _M_current; - typedef iterator_traits<_Iterator> __traits_type; - typedef typename __traits_type::difference_type difference_type; - typedef typename __traits_type::reference reference; - explicit __normal_iterator(const _Iterator& __i) : _M_current(__i) { } - reference operator*() const { - return *_M_current; - } - __normal_iterator operator+(difference_type __n) const { - return __normal_iterator(_M_current + __n); - } - }; - template struct new_allocator { - }; - } - namespace std __attribute__ ((__visibility__ ("default"))) { - template struct allocator: public __gnu_cxx::new_allocator<_Tp> { - }; - struct ios_base { }; - template struct basic_ios : public ios_base { }; - template struct basic_ostream : virtual public basic_ios<_CharT, _Traits> { - typedef basic_ostream<_CharT, _Traits> __ostream_type; - __ostream_type& operator<<(__ostream_type& (*__pf)(__ostream_type&)) { } - __ostream_type& operator<<(const void* __p) { - return _M_insert(__p); - } - template __ostream_type& _M_insert(_ValueT __v); - }; - template inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { - } - } - typedef double G4double; - typedef int G4int; - extern __thread std::ostream *G4cout_p; - struct G4Field; - struct G4FieldManager { - inline G4Field* GetDetectorField() ; - }; - namespace CLHEP { - struct Hep3Vector { - Hep3Vector(double x, double y, double z); - inline ~Hep3Vector(); - inline double x() const; - inline double y() const; - inline double z() const; - inline double mag() const; - inline Hep3Vector cross(const Hep3Vector &) const; - double dx; - double dy; - double dz; - }; - Hep3Vector operator / (const Hep3Vector &, double a); - inline double Hep3Vector::x() const { - return dx; - } - inline double Hep3Vector::y() const { - return dy; - } - inline double Hep3Vector::z() const { - return dz; - } - inline Hep3Vector operator + (const Hep3Vector & a, const Hep3Vector & b) { } - inline Hep3Vector operator * (const Hep3Vector & p, double a) { } - inline double operator * (const Hep3Vector & a, const Hep3Vector & b) { } - inline Hep3Vector::Hep3Vector(double x1, double y1, double z1) : dx(x1), dy(y1), dz(z1) { - } - inline Hep3Vector::~Hep3Vector() { } - inline Hep3Vector Hep3Vector::cross(const Hep3Vector & p) const { - return Hep3Vector(dy*p.dz-p.dy*dz, dz*p.dx-p.dz*dx, dx*p.dy-p.dx*dy); - } - } - typedef CLHEP::Hep3Vector G4ThreeVector; - namespace std __attribute__ ((__visibility__ ("default"))) { - template > struct vector - { - typedef _Tp *pointer; - typedef __gnu_cxx::__normal_iterator iterator; - iterator begin() { } - }; - } - struct G4TransportationManager { - static G4TransportationManager* GetTransportationManager(); - inline G4FieldManager* GetFieldManager() const; - }; - struct G4ErrorMatrix { - G4ErrorMatrix(G4int p, G4int q, G4int i); - virtual ~G4ErrorMatrix(); - struct G4ErrorMatrix_row { - inline G4ErrorMatrix_row(G4ErrorMatrix&,G4int); - G4double & operator[](G4int); - G4ErrorMatrix& _a; - G4int _r; - }; - inline G4ErrorMatrix_row operator[] (G4int); - std::vector m; - G4int nrow, ncol; - }; - inline G4ErrorMatrix::G4ErrorMatrix_row G4ErrorMatrix::operator[] (G4int r) { - G4ErrorMatrix_row b(*this,r); - return b; - } - inline G4double &G4ErrorMatrix::G4ErrorMatrix_row::operator[](G4int c) { - return *(_a.m.begin()+_r*_a.ncol+c); - } - inline G4ErrorMatrix:: G4ErrorMatrix_row::G4ErrorMatrix_row(G4ErrorMatrix&a, G4int r) : _a(a) { - _r = r; - }; - struct G4DynamicParticle { - G4double GetCharge() const; - }; - struct G4Step; - struct G4Track { - const G4DynamicParticle* GetDynamicParticle() const; - const G4ThreeVector& GetPosition() const; - G4ThreeVector GetMomentum() const; - const G4Step* GetStep() const; - }; - struct G4StepPoint { - const G4ThreeVector& GetPosition() const; - G4ThreeVector GetMomentum() const; - }; - struct G4Step { - G4StepPoint* GetPreStepPoint() const; - G4double GetStepLength() const; - }; - namespace HepGeom { - template struct BasicVector3D { - T v_[3]; - BasicVector3D(T x1, T y1, T z1) { } - operator T * () { - return v_; - } - T x() const { - return v_[0]; - } - T y() const { - return v_[1]; - } - T z() const { - return v_[2]; - } - T perp2() const { } - T perp() const { - return std::sqrt(perp2()); - } - T mag2() const { } - T mag() const { - return std::sqrt(mag2()); - } - T theta() const { } - }; - inline BasicVector3D operator-(const BasicVector3D & a,const BasicVector3D & b) { } - inline BasicVector3D operator*(const BasicVector3D & v, double a) { } - template struct Point3D : public BasicVector3D { - explicit Point3D(const double * a) : BasicVector3D(a[0],a[1],a[2]) { } - Point3D(const CLHEP::Hep3Vector & v) : BasicVector3D(v.dx,v.dy,v.dz) { } - }; - } - typedef HepGeom::Point3D G4Point3D; - namespace HepGeom { - template struct Vector3D : public BasicVector3D { - Vector3D(const BasicVector3D & v) : BasicVector3D(v) { } - Vector3D(const CLHEP::Hep3Vector & v) : BasicVector3D(v.dx,v.dy,v.dz) { } - operator CLHEP::Hep3Vector () const { } - }; - } - typedef HepGeom::Vector3D G4Vector3D; - struct G4ErrorFreeTrajState -{ - virtual G4int PropagateError( const G4Track* aTrack ); - G4int PropagateErrorMSC( const G4Track* aTrack ); - }; - G4int G4ErrorFreeTrajState::PropagateError( const G4Track* aTrack ) { - G4double stepLengthCm = aTrack->GetStep()->GetStepLength()/10.; - G4Point3D vposPost = aTrack->GetPosition()/10.; - G4Vector3D vpPost = aTrack->GetMomentum()/GeV; - G4Point3D vposPre = aTrack->GetStep()->GetPreStepPoint()->GetPosition()/10.; - G4Vector3D vpPre = aTrack->GetStep()->GetPreStepPoint()->GetMomentum()/GeV; - G4double pPre = vpPre.mag(); - G4double pPost = vpPost.mag(); - G4double pInvPre = 1./pPre; - G4double pInvPost = 1./pPost; - G4double deltaPInv = pInvPost - pInvPre; - G4Vector3D vpPreNorm = vpPre * pInvPre; - G4Vector3D vpPostNorm = vpPost * pInvPost; - (*G4cout_p) << "G4EP: vpPreNorm " << vpPreNorm << " vpPostNorm " << vpPostNorm << std::endl; - G4double sinpPre = std::sin( vpPreNorm.theta() ); - G4double sinpPostInv = 1./std::sin( vpPreNorm.theta() ); - G4ErrorMatrix transf(5, 5, 0 ); - G4double charge = aTrack->GetDynamicParticle()->GetCharge(); - G4double h1[3], h2[3]; - G4Field* field -= G4TransportationManager::GetTransportationManager()->GetFieldManager()->GetDetectorField() -; - if( charge != 0. && field ) - { - G4ThreeVector HPre = G4ThreeVector( h1[0], h1[1], h1[2] ) / tesla *10.; - G4ThreeVector HPost= G4ThreeVector( h2[0], h2[1], h2[2] ) / tesla *10.; - { - G4double pInvAver = 1./(pInvPre + pInvPost ); - G4double CFACT8 = 2.997925E-4; - G4ThreeVector vHAverNorm( (HPre*pInvPre + HPost*pInvPost ) * pInvAver * charge * CFACT8 ); - G4double HAver = vHAverNorm.mag(); - G4double pAver = (pPre+pPost)*0.5; - G4double QAver = -HAver/pAver; - G4double thetaAver = QAver * stepLengthCm; - G4double sinThetaAver = std::sin(thetaAver); - G4double cosThetaAver = std::cos(thetaAver); - G4double gamma = vHAverNorm * vpPostNorm; - G4ThreeVector AN2 = vHAverNorm.cross( vpPostNorm ); - G4double AU = 1./vpPreNorm.perp(); - G4ThreeVector vUPre( -AU*vpPreNorm.y(), AU*vpPreNorm.x(), 0. ); - G4ThreeVector vVPre( -vpPreNorm.z()*vUPre.y(), vpPreNorm.z()*vUPre.x(), vpPreNorm.x()*vUPre.y() - vpPreNorm.y()*vUPre.x() ); - AU = 1./vpPostNorm.perp(); - G4ThreeVector vUPost( -AU*vpPostNorm.y(), AU*vpPostNorm.x(), 0. ); - G4ThreeVector vVPost( -vpPostNorm.z()*vUPost.y(), vpPostNorm.z()*vUPost.x(), vpPostNorm.x()*vUPost.y() - vpPostNorm.y()*vUPost.x() ); - G4Point3D deltaPos( vposPre - vposPost ); - G4double QP = QAver * pAver; - G4double ANV = -( vHAverNorm.x()*vUPost.x() + vHAverNorm.y()*vUPost.y() ); - G4double ANU = ( vHAverNorm.x()*vVPost.x() + vHAverNorm.y()*vVPost.y() + vHAverNorm.z()*vVPost.z() ); - G4double OMcosThetaAver = 1. - cosThetaAver; - G4double TMSINT = thetaAver - sinThetaAver; - G4ThreeVector vHUPre( -vHAverNorm.z() * vUPre.y(), vHAverNorm.z() * vUPre.x(), vHAverNorm.x() * vUPre.y() - vHAverNorm.y() * vUPre.x() ); - G4ThreeVector vHVPre( vHAverNorm.y() * vVPre.z() - vHAverNorm.z() * vVPre.y(), vHAverNorm.z() * vVPre.x() - vHAverNorm.x() * vVPre.z(), vHAverNorm.x() * vVPre.y() - vHAverNorm.y() * vVPre.x() ); - transf[0][1] = -deltaPInv/thetaAver* ( TMSINT*gamma*(vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z()) + sinThetaAver*(vVPre.x()*vpPostNorm.x()+vVPre.y()*vpPostNorm.y()+vVPre.z()*vpPostNorm.z()) + OMcosThetaAver*(vHVPre.x()*vpPostNorm.x()+vHVPre.y()*vpPostNorm.y()+vHVPre.z()*vpPostNorm.z()) ); - transf[0][2] = -sinpPre*deltaPInv/thetaAver* ( TMSINT*gamma*(vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() ) + sinThetaAver*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() ) + OMcosThetaAver*(vHUPre.x()*vpPostNorm.x()+vHUPre.y()*vpPostNorm.y()+vHUPre.z()*vpPostNorm.z()) ); - transf[0][3] = -deltaPInv/stepLengthCm*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() ); - transf[1][1] = cosThetaAver*(vVPre.x()*vVPost.x()+vVPre.y()*vVPost.y()+vVPre.z()*vVPost.z()) + sinThetaAver*(vHVPre.x()*vVPost.x()+vHVPre.y()*vVPost.y()+vHVPre.z()*vVPost.z()) + OMcosThetaAver*(vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z())* (vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z()) + ANV*( -sinThetaAver*(vVPre.x()*vpPostNorm.x()+vVPre.y()*vpPostNorm.y()+vVPre.z()*vpPostNorm.z()) + OMcosThetaAver*(vVPre.x()*AN2.x()+vVPre.y()*AN2.y()+vVPre.z()*AN2.z()) - TMSINT*gamma*(vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z()) ); - transf[1][2] = cosThetaAver*(vUPre.x()*vVPost.x()+vUPre.y()*vVPost.y() ) + sinThetaAver*(vHUPre.x()*vVPost.x()+vHUPre.y()*vVPost.y()+vHUPre.z()*vVPost.z()) + OMcosThetaAver*(vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() )* (vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z()) + ANV*( -sinThetaAver*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() ) + OMcosThetaAver*(vUPre.x()*AN2.x()+vUPre.y()*AN2.y() ) - TMSINT*gamma*(vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() ) ); - transf[2][0] = -QP*ANU*(vpPostNorm.x()*deltaPos.x()+vpPostNorm.y()*deltaPos.y()+vpPostNorm.z()*deltaPos.z())*sinpPostInv *(1.+deltaPInv*pAver); - transf[2][3] = -QAver*ANU*(vUPre.x()*vpPostNorm.x()+vUPre.y()*vpPostNorm.y() )*sinpPostInv; - transf[3][4] = (vVPre.x()*vUPost.x()+vVPre.y()*vUPost.y() ); - transf[4][0] = pAver*(vVPost.x()*deltaPos.x()+vVPost.y()*deltaPos.y()+vVPost.z()*deltaPos.z()) *(1.+deltaPInv*pAver); - transf[4][1] = ( sinThetaAver*(vVPre.x()*vVPost.x()+vVPre.y()*vVPost.y()+vVPre.z()*vVPost.z()) + OMcosThetaAver*(vHVPre.x()*vVPost.x()+vHVPre.y()*vVPost.y()+vHVPre.z()*vVPost.z()) + TMSINT*(vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z())* (vHAverNorm.x()*vVPre.x()+vHAverNorm.y()*vVPre.y()+vHAverNorm.z()*vVPre.z()) )/QAver; - transf[4][2] = ( sinThetaAver*(vUPre.x()*vVPost.x()+vUPre.y()*vVPost.y() ) + OMcosThetaAver*(vHUPre.x()*vVPost.x()+vHUPre.y()*vVPost.y()+vHUPre.z()*vVPost.z()) + TMSINT*(vHAverNorm.x()*vVPost.x()+vHAverNorm.y()*vVPost.y()+vHAverNorm.z()*vVPost.z())* (vHAverNorm.x()*vUPre.x()+vHAverNorm.y()*vUPre.y() ) )*sinpPre/QAver; - } - } - PropagateErrorMSC( aTrack ); - } diff --git a/gcc/testsuite/gcc.target/aarch64/pr81414.C b/gcc/testsuite/gcc.target/aarch64/pr81414.C deleted file mode 100644 index 53dfc7cf800..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/pr81414.C +++ /dev/null @@ -1,9 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -mcpu=cortex-a57" } */ - -typedef __Float32x2_t float32x2_t; -float32x2_t -foo1 (float32x2_t __a, float32x2_t __b, float32x2_t __c) { - return __b * __c + __a; -} - diff --git a/gcc/testsuite/gcc.target/aarch64/pr81414.c b/gcc/testsuite/gcc.target/aarch64/pr81414.c new file mode 100644 index 00000000000..53dfc7cf800 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr81414.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcpu=cortex-a57" } */ + +typedef __Float32x2_t float32x2_t; +float32x2_t +foo1 (float32x2_t __a, float32x2_t __b, float32x2_t __c) { + return __b * __c + __a; +} + diff --git a/gcc/testsuite/gcc.target/aarch64/pr81422.C b/gcc/testsuite/gcc.target/aarch64/pr81422.C deleted file mode 100644 index 5bcc948996e..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/pr81422.C +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O0" } */ - -struct DArray -{ - __SIZE_TYPE__ length; - int* ptr; -}; - -void foo35(DArray) -{ - static __thread int x[5]; - foo35({5, (int*)&x}); -} - diff --git a/gcc/testsuite/gcc.target/aarch64/simd/pr67896.C b/gcc/testsuite/gcc.target/aarch64/simd/pr67896.C deleted file mode 100644 index 1f916e09f4f..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/simd/pr67896.C +++ /dev/null @@ -1,7 +0,0 @@ -typedef __Poly8_t A; -typedef __Poly16_t A; /* { dg-error "conflicting declaration" } */ -typedef __Poly64_t A; /* { dg-error "conflicting declaration" } */ -typedef __Poly128_t A; /* { dg-error "conflicting declaration" } */ - -typedef __Poly8x8_t B; -typedef __Poly16x8_t B; /* { dg-error "conflicting declaration" } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/pr67896.c b/gcc/testsuite/gcc.target/aarch64/simd/pr67896.c new file mode 100644 index 00000000000..3e27bea0e95 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/pr67896.c @@ -0,0 +1,7 @@ +typedef __Poly8_t A; +typedef __Poly16_t A; /* { dg-error "conflicting types" } */ +typedef __Poly64_t A; /* { dg-error "conflicting types" } */ +typedef __Poly128_t A; /* { dg-error "conflicting types" } */ + +typedef __Poly8x8_t B; +typedef __Poly16x8_t B; /* { dg-error "conflicting types" } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_1.C b/gcc/testsuite/gcc.target/aarch64/sve/const_pred_1.C deleted file mode 100644 index 25b7663273f..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_1.C +++ /dev/null @@ -1,18 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -msve-vector-bits=256" } */ - -#include - -typedef int8_t vnx16qi __attribute__((vector_size(32))); - -vnx16qi -foo (vnx16qi x, vnx16qi y) -{ - return (vnx16qi) { -1, 0, 0, -1, -1, -1, 0, 0, - -1, -1, -1, -1, 0, 0, 0, 0, - -1, -1, -1, -1, -1, -1, -1, -1, - 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y; -} - -/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ -/* { dg-final { scan-assembler {\t\.byte\t57\n\t\.byte\t15\n\t\.byte\t(255|-1)\n\t\.byte\t0\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_2.C b/gcc/testsuite/gcc.target/aarch64/sve/const_pred_2.C deleted file mode 100644 index 4c781ca560c..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_2.C +++ /dev/null @@ -1,16 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -msve-vector-bits=256" } */ - -#include - -typedef int16_t vnx8hi __attribute__((vector_size(32))); - -vnx8hi -foo (vnx8hi x, vnx8hi y) -{ - return (vnx8hi) { -1, 0, 0, -1, -1, -1, 0, 0, - -1, -1, -1, -1, 0, 0, 0, 0 } ? x : y; -} - -/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ -/* { dg-final { scan-assembler {\t\.byte\t65\n\t\.byte\t5\n\t\.byte\t85\n\t\.byte\t0\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_3.C b/gcc/testsuite/gcc.target/aarch64/sve/const_pred_3.C deleted file mode 100644 index 6196ee05be7..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_3.C +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -msve-vector-bits=256" } */ - -#include - -typedef int32_t vnx4si __attribute__((vector_size(32))); - -vnx4si -foo (vnx4si x, vnx4si y) -{ - return (vnx4si) { -1, 0, 0, -1, -1, -1, 0, 0 } ? x : y; -} - -/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ -/* { dg-final { scan-assembler {\t\.byte\t1\n\t\.byte\t16\n\t\.byte\t17\n\t\.byte\t0\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_4.C b/gcc/testsuite/gcc.target/aarch64/sve/const_pred_4.C deleted file mode 100644 index 2bdf67fd038..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/const_pred_4.C +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -msve-vector-bits=256" } */ - -#include - -typedef int64_t vnx2di __attribute__((vector_size(32))); - -vnx2di -foo (vnx2di x, vnx2di y) -{ - return (vnx2di) { -1, 0, 0, -1 } ? x : y; -} - -/* { dg-final { scan-assembler {\tldr\tp[0-9]+,} } } */ -/* { dg-final { scan-assembler {\t\.byte\t1\n\t\.byte\t0\n\t\.byte\t0\n\t\.byte\t1\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/tls_2.C b/gcc/testsuite/gcc.target/aarch64/sve/tls_2.C deleted file mode 100644 index c18a737ae04..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/tls_2.C +++ /dev/null @@ -1,30 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fPIC -msve-vector-bits=256" } */ - -#include - -typedef int8_t v32qi __attribute__((vector_size (32))); - -extern __thread int z; - -void -foo (v32qi *a, int *b) -{ - v32qi x = a[0], y = a[1]; - asm volatile ("" :: "w" ((v32qi) { -1, 0, 0, -1, -1, -1, 0, 0, - -1, -1, -1, -1, 0, 0, 0, 0, - -1, -1, -1, -1, -1, -1, -1, -1, - 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y) - : "memory"); - if (*b) - { - x = a[2], y = a[3]; - asm volatile ("" :: "w" ((v32qi) { -1, 0, 0, -1, -1, -1, 0, 0, - -1, -1, -1, -1, 0, 0, 0, 0, - -1, -1, -1, -1, -1, -1, -1, -1, - 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y), - "r" (z)); - } -} - -/* { dg-final { scan-assembler-times {\tldr\tp[0-9]} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vcond_1.C b/gcc/testsuite/gcc.target/aarch64/sve/vcond_1.C index 6fd6b420eef..66208425e2e 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/vcond_1.C +++ b/gcc/testsuite/gcc.target/aarch64/sve/vcond_1.C @@ -1,17 +1,15 @@ /* { dg-do assemble { target aarch64_asm_sve_ok } } */ /* { dg-options "-O -msve-vector-bits=256 --save-temps" } */ -#include - -typedef int8_t vnx16qi __attribute__((vector_size(32))); -typedef int16_t vnx8hi __attribute__((vector_size(32))); -typedef int32_t vnx4si __attribute__((vector_size(32))); -typedef int64_t vnx2di __attribute__((vector_size(32))); - -typedef uint8_t v32qu __attribute__((vector_size(32))); -typedef uint16_t v16hu __attribute__((vector_size(32))); -typedef uint32_t v8su __attribute__((vector_size(32))); -typedef uint64_t v4du __attribute__((vector_size(32))); +typedef __INT8_TYPE__ vnx16qi __attribute__((vector_size(32))); +typedef __INT16_TYPE__ vnx8hi __attribute__((vector_size(32))); +typedef __INT32_TYPE__ vnx4si __attribute__((vector_size(32))); +typedef __INT64_TYPE__ vnx2di __attribute__((vector_size(32))); + +typedef __UINT8_TYPE__ v32qu __attribute__((vector_size(32))); +typedef __UINT16_TYPE__ v16hu __attribute__((vector_size(32))); +typedef __UINT32_TYPE__ v8su __attribute__((vector_size(32))); +typedef __UINT64_TYPE__ v4du __attribute__((vector_size(32))); #define DEF_VCOND_VAR(TYPE, COND, SUFFIX) \ TYPE vcond_##TYPE##_##SUFFIX (TYPE x, TYPE y, TYPE a, TYPE b) \ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vcond_1_run.C b/gcc/testsuite/gcc.target/aarch64/sve/vcond_1_run.C index 2df33710d8f..72dab3942a9 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/vcond_1_run.C +++ b/gcc/testsuite/gcc.target/aarch64/sve/vcond_1_run.C @@ -2,7 +2,7 @@ /* { dg-options "-O" } */ /* { dg-options "-O -msve-vector-bits=256" { target aarch64_sve256_hw } } */ -#include "vcond_1.C" +#include "vcond_1.c" #define NUM_ELEMS(X) (sizeof (X) / sizeof (X[0])) diff --git a/gcc/testsuite/gcc.target/arm/pr54300.C b/gcc/testsuite/gcc.target/arm/pr54300.C deleted file mode 100644 index 9105e279b33..00000000000 --- a/gcc/testsuite/gcc.target/arm/pr54300.C +++ /dev/null @@ -1,63 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target arm_neon } */ -/* { dg-options "-O2" } */ -/* { dg-add-options arm_neon } */ - -#include -#include - -struct __attribute__ ((aligned(8))) _v16u8_ { - uint8x16_t val; - _v16u8_( const int16x8_t &src) { val = vreinterpretq_u8_s16(src); } - operator int16x8_t () const { return vreinterpretq_s16_u8(val); } -}; -typedef struct _v16u8_ v16u8; - -struct __attribute__ ((aligned(4))) _v8u8_ { - uint8x8_t val; - _v8u8_( const uint8x8_t &src) { val = src; } - operator int16x4_t () const { return vreinterpret_s16_u8(val); } -}; -typedef struct _v8u8_ v8u8; - -typedef v16u8 v8i16; -typedef int32x4_t v4i32; -typedef const short cv1i16; -typedef const unsigned char cv1u8; -typedef const v8i16 cv8i16; - -static inline __attribute__((always_inline)) v8u8 zero_64(){ return vdup_n_u8( 0 ); } - -static inline __attribute__((always_inline)) v8i16 loadlo_8i16( cv8i16* p ){ - return vcombine_s16( vld1_s16( (cv1i16 *)p ), zero_64() ); -} -static inline __attribute__((always_inline)) v8i16 _loadlo_8i16( cv8i16* p, int offset ){ - return loadlo_8i16( (cv8i16*)(&((cv1u8*)p)[offset]) ); -} - -void __attribute__((noinline)) -test(unsigned short *_Inp, int32_t *_Out, - unsigned int s1v, unsigned int dv0, - unsigned int smask_v) -{ - int32x4_t c = vdupq_n_s32(0); - - for(unsigned int sv=0 ; sv!=dv0 ; sv=(sv+s1v)&smask_v ) - { - int32x4_t s; - s = vmovl_s16( vget_low_s16( _loadlo_8i16( (cv8i16*) _Inp, sv ) ) ); - c = vaddq_s32( c, s ); - } - vst1q_s32( _Out, c ); -} - -int -main() -{ - unsigned short a[4] = {1, 2, 3, 4}; - int32_t b[4] = {0, 0, 0, 0}; - test(a, b, 1, 1, ~0); - if (b[0] != 1 || b[1] != 2 || b[2] != 3 || b[3] != 4) - abort(); - return 0; -} diff --git a/gcc/testsuite/gcc.target/arm/pr55073.C b/gcc/testsuite/gcc.target/arm/pr55073.C deleted file mode 100644 index 5575cf77911..00000000000 --- a/gcc/testsuite/gcc.target/arm/pr55073.C +++ /dev/null @@ -1,74 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target arm_neon } */ -/* { dg-options "-O2" } */ -/* { dg-add-options arm_neon } */ - -#include -#include - -struct __attribute__((aligned(16))) _v16u8_ { - uint8x16_t val; - _v16u8_() { } - - _v16u8_( const uint8x16_t &src) { val = src; } - _v16u8_( const int16x8_t &src) { val = vreinterpretq_u8_s16(src); } - _v16u8_( const uint32x4_t &src) { val = vreinterpretq_u8_u32(src); } - - operator uint8x16_t () const { return val; } - operator int8x16_t () const { return vreinterpretq_s8_u8 (val); } - operator int16x8_t () const { return vreinterpretq_s16_u8(val); } - operator uint32x4_t () const { return vreinterpretq_u32_u8(val); } - operator int32x4_t () const { return vreinterpretq_s32_u8(val); } -}; -typedef struct _v16u8_ v16u8; -typedef const v16u8 cv16u8; - -typedef v16u8 v16i8; -typedef v16u8 v8i16; -typedef v16u8 v4u32; - -inline v16u8 __attribute__((always_inline)) mergelo( const v16u8 & s, const v16u8 & t ) -{ - uint8x8x2_t r = vzip_u8( vget_low_u8(s), vget_low_u8(t) ); - return vcombine_u8( r.val[0], r.val[1] ); -} - -inline v8i16 __attribute__((always_inline)) unpacklo(const v16i8 & s) -{ - return vmovl_s8( vget_low_s8( s ) ); -} - -const uint32_t __attribute__((aligned(16))) _InA [4] = { 0xFF020001, 0xFF020001, 0xFF000101, 0xFF000101 } ; -const uint32_t __attribute__((aligned(16))) _InB [4] = { 0xFF050002, 0xFF050002, 0xFF000303, 0xFF000203 } ; - -__attribute__((noinline)) v16i8 test_func(void) -{ - v16u8 A = vld1q_u8( (uint8_t*) _InA ); - v16u8 B = vld1q_u8( (uint8_t*) _InB ); - v8i16 r = vdupq_n_s16(2); - - v16u8 _0 = mergelo( A, B ); - v16u8 _1 = mergelo( B, A ); - - v16u8 _2 = mergelo( _0, _1 ); - v16u8 _3 = mergelo( _1, _0 ); - - v8i16 _4 = vsubq_s16( unpacklo( _2 ), r ); - v8i16 _5 = vsubq_s16( unpacklo( _3 ), r ); - - v8i16 ret = vaddq_s16( _4, _5 ); - - return ( ret ); -} - -int main (int argc, char **argv) -{ - v16u8 val = test_func(); - - if (vgetq_lane_u32( val, 0 ) != 0xffffffff - || vgetq_lane_u32( val, 1 ) != 0xffffffff - || vgetq_lane_u32( val, 2 ) != 0xfffcfffc - || vgetq_lane_u32( val, 3 ) != 0xfffcfffc) - abort (); - exit (0); -} diff --git a/gcc/testsuite/gcc.target/arm/pr56184.C b/gcc/testsuite/gcc.target/arm/pr56184.C deleted file mode 100644 index 82442225603..00000000000 --- a/gcc/testsuite/gcc.target/arm/pr56184.C +++ /dev/null @@ -1,258 +0,0 @@ -/* { dg-do compile } */ -/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */ -/* { dg-options "-fno-short-enums -O2 -mthumb -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a9 -fno-section-anchors -Wno-return-type" } */ - -typedef unsigned int size_t; -__extension__ typedef int __intptr_t; -typedef __intptr_t intptr_t; -typedef union tree_node *tree; -typedef const union tree_node *const_tree; -extern void *ggc_internal_cleared_alloc_stat (size_t ) - __attribute__ ((__malloc__)); -enum tree_code { -TREE_LIST=2, -FUNCTION_DECL, -MAX_TREE_CODES=254 -}; -extern unsigned char tree_contains_struct[MAX_TREE_CODES][64]; -struct tree_base { - enum tree_code code : 16; -}; -struct tree_common { - tree chain; -}; -enum tree_node_structure_enum { -TS_COMMON, -TS_DECL_COMMON, -}; -extern void tree_contains_struct_check_failed (const_tree, - const enum tree_node_structure_enum, - const char *, int, const char *) - __attribute__ ((__noreturn__)); -extern void tree_check_failed (const_tree, const char *, int, const char *, - ...) __attribute__ ((__noreturn__)); -struct tree_list { - tree value; -}; -struct tree_decl_common { - tree initial; -}; -struct tree_function_decl { - struct function *f; -}; -union - tree_node { - struct tree_base base; - struct tree_common common; - struct tree_decl_common decl_common; - struct tree_function_decl function_decl; - struct tree_list list; -}; -inline tree -tree_check (tree __t, const char *__f, int __l, const char *__g, enum tree_code __c) -{ - if (((enum tree_code) (__t)->base.code) != __c) - tree_check_failed (__t, __f, __l, __g, __c, 0); -} -inline tree -contains_struct_check (tree __t, const enum tree_node_structure_enum __s, - const char *__f, int __l, const char *__g) -{ - if (tree_contains_struct[((enum tree_code) (__t)->base.code)][__s] != 1) - tree_contains_struct_check_failed (__t, __s, __f, __l, __g); -} -struct function { - tree static_chain_decl; -}; -enum gimple_code { - LAST_AND_UNUSED_GIMPLE_CODE -}; -struct eh_catch_d -{ - struct eh_catch_d *next_catch; - struct eh_catch_d *prev_catch; - tree type_list; - tree filter_list; - tree label; -}; -struct eh_region_d -{ - struct eh_region_d *outer; - struct eh_region_d *inner; - int index; - union eh_region_u { - struct eh_region_u_try { - struct eh_catch_d *first_catch; - } eh_try; - } u; -}; -typedef struct eh_catch_d *eh_catch; -typedef struct eh_region_d *eh_region; -extern void add_type_for_runtime (tree); -enum LTO_tags -{ - LTO_null = 0, - LTO_bb0 = 1 + MAX_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE, - LTO_ert_cleanup, - LTO_NUM_TAGS -}; -enum lto_section_type -{ - LTO_section_function_body, -}; -struct lto_input_block -{ - const char *data; - unsigned int p; - unsigned int len; -}; -extern void lto_section_overrun (struct lto_input_block *) __attribute__ ((__noreturn__)); -extern void lto_value_range_error (const char *, - long long, long long, - long long) __attribute__ ((__noreturn__)); -long long streamer_read_hwi (struct lto_input_block *); -static inline unsigned char -streamer_read_uchar (struct lto_input_block *ib) -{ - if (ib->p >= ib->len) - lto_section_overrun (ib); - return (ib->data[ib->p++]); -} -static inline long long -streamer_read_hwi_in_range (struct lto_input_block *ib, - const char *purpose, - long long min, - long long max) -{ - long long range = max - min; - long long val = streamer_read_uchar (ib); - if (range >= 0xff) - val |= ((long long)streamer_read_uchar (ib)) << 8; - if (val < min || val > max) - lto_value_range_error (purpose, val, min, max); - return val; -} -static inline enum LTO_tags -streamer_read_record_start (struct lto_input_block *ib) -{ - return (enum LTO_tags)streamer_read_hwi_in_range ((ib), "LTO_tags", 0, (int)(LTO_NUM_TAGS) - 1); -} -struct streamer_hooks { - tree (*read_tree) (struct lto_input_block *, struct data_in *); -}; -extern struct streamer_hooks streamer_hooks; -static struct eh_catch_d * -lto_input_eh_catch_list (struct lto_input_block *ib, struct data_in *data_in, - eh_catch *last_p) -{ - eh_catch first; - enum LTO_tags tag; - *last_p = first = __null; - tag = streamer_read_record_start (ib); - while (tag) - { - tree list; - eh_catch n; - n = ((struct eh_catch_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_catch_d) ))); - n->type_list = streamer_hooks.read_tree(ib, data_in); - n->filter_list = streamer_hooks.read_tree(ib, data_in); - n->label = streamer_hooks.read_tree(ib, data_in); - for (list = n->filter_list; list; list = ((contains_struct_check ((list), (TS_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 275, __FUNCTION__))->common.chain)) - add_type_for_runtime (((tree_check ((list), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 276, __FUNCTION__, (TREE_LIST)))->list.value)); - if (*last_p) - (*last_p)->next_catch = n; - n->prev_catch = *last_p; - *last_p = n; - if (first == __null) - first = n; - tag = streamer_read_record_start (ib); - } - return first; -} -static eh_region -input_eh_region (struct lto_input_block *ib, struct data_in *data_in, int ix) -{ - enum LTO_tags tag; - eh_region r; - tag = streamer_read_record_start (ib); - if (tag == LTO_null) - return __null; - r = ((struct eh_region_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_region_d) ))); - r->index = streamer_read_hwi (ib); - r->outer = (eh_region) (intptr_t) streamer_read_hwi (ib); - r->inner = (eh_region) (intptr_t) streamer_read_hwi (ib); - switch (tag) - { - case LTO_ert_cleanup: - { - struct eh_catch_d *last_catch; - r->u.eh_try.first_catch = lto_input_eh_catch_list (ib, data_in, - &last_catch); - } - { - tree l; - add_type_for_runtime (((tree_check ((l), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 346, __FUNCTION__, (TREE_LIST)))->list.value)); - } - } -} -static void -input_eh_regions (struct lto_input_block *ib, struct data_in *data_in, - struct function *fn) -{ - long long i, root_region, len; - enum LTO_tags tag; - tag = streamer_read_record_start (ib); - if (tag == LTO_null) - return; - len = streamer_read_hwi (ib); - if (len > 0) - { - for (i = 0; i < len; i++) - { - eh_region r = input_eh_region (ib, data_in, i); - } - } -} -static void -input_ssa_names (struct lto_input_block *ib, struct data_in *data_in, - struct function *fn) -{ - unsigned int i, size; - while (i) - { - } -} -static void -input_struct_function_base (struct function *fn, struct data_in *data_in, - struct lto_input_block *ib) -{ - fn->static_chain_decl = streamer_hooks.read_tree(ib, data_in); -} -static void -input_function (tree fn_decl, struct data_in *data_in, - struct lto_input_block *ib) -{ - struct function *fn; - enum LTO_tags tag; - fn = ((tree_check ((fn_decl), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 807, __FUNCTION__, (FUNCTION_DECL)))->function_decl.f); - tag = streamer_read_record_start (ib); - input_struct_function_base (fn, data_in, ib); - input_ssa_names (ib, data_in, fn); - input_eh_regions (ib, data_in, fn); - ((contains_struct_check ((fn_decl), (TS_DECL_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 823, __FUNCTION__))->decl_common.initial) = streamer_hooks.read_tree(ib, data_in); -} -static void -lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, - const char *data, enum lto_section_type section_type) -{ - struct data_in *data_in; - struct lto_input_block ib_main; - input_function (fn_decl, data_in, &ib_main); -} -void -lto_input_function_body (struct lto_file_decl_data *file_data, - tree fn_decl, const char *data) -{ - lto_read_body (file_data, fn_decl, data, LTO_section_function_body); -} - diff --git a/gcc/testsuite/gcc.target/arm/pr59985.C b/gcc/testsuite/gcc.target/arm/pr59985.C deleted file mode 100644 index ecf72b190b4..00000000000 --- a/gcc/testsuite/gcc.target/arm/pr59985.C +++ /dev/null @@ -1,70 +0,0 @@ -/* { dg-do compile } */ -/* { dg-skip-if "incompatible options" { arm_thumb1 } } */ -/* { dg-options "-g -fcompare-debug -O2 -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard" } */ -/* { dg-skip-if "need hardfp abi" { *-*-* } { "-mfloat-abi=soft" } { "" } } */ - -extern void *f1 (unsigned long, unsigned long); -extern const struct line_map *f2 (void *, int, unsigned int, const char *, unsigned int); -extern unsigned int f3 (void *, unsigned int); -extern void *v1; -struct B { const char *s; int t; }; -struct C { unsigned u; unsigned long long v; void *w; }; -unsigned long long f4 (struct C *); -const char *f5 (void *, unsigned int, unsigned int *); -unsigned long long f6 (void *); - -static inline unsigned long long -f7 (struct C *x, unsigned y) -{ - unsigned long long a, b; - int u = x->u; - a = y == 64 ? -1ULL : (1ULL << y) - 1; - if (u + y > 64) - { - f6 (x->w); - x->u = y; - return b & a; - } - b = x->v; - b >>= u; - x->u = u + y; - return b & a; -} - -static const char * -f8 (const char *x) -{ - B **a; - unsigned long t = __builtin_strlen (x); - char *b; - struct B *c; - b = (char *) f1 (t + 1, 1); - c = (struct B *) f1 (1, sizeof (struct B)); - __builtin_memcpy (b, x, t + 1); - c->t = t; - struct B *d = *a; - return d->s; -} - -unsigned int -f9 (struct C *x, void *y) -{ - static const char *a; - static int b; - static int c; - bool d, e, f; - unsigned t; - bool prev_file = a != __null; - if (f7 (x, 1)) - return ((unsigned int) 0); - d = f7 (x, 1); - e = f7 (x, 1); - f = f7 (x, 1); - a = f8 (f5 (y, f4 (x), &t)); - if (e) b = f4 (x); - if (f) - if (d) - if (prev_file) - f2 (v1, 1, false, __null, 0); - return f3 (v1, c); -}