aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8.1/gcc/testsuite/gcc.target/arm/pr55073.C
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2016-01-14 16:43:34 -0800
committerDan Albert <danalbert@google.com>2016-01-22 14:51:24 -0800
commit3186be22b6598fbd467b126347d1c7f48ccb7f71 (patch)
tree2b176d3ce027fa5340160978effeb88ec9054aaa /gcc-4.8.1/gcc/testsuite/gcc.target/arm/pr55073.C
parenta45222a0e5951558bd896b0513bf638eb376e086 (diff)
downloadtoolchain_gcc-3186be22b6598fbd467b126347d1c7f48ccb7f71.tar.gz
toolchain_gcc-3186be22b6598fbd467b126347d1c7f48ccb7f71.tar.bz2
toolchain_gcc-3186be22b6598fbd467b126347d1c7f48ccb7f71.zip
Check in a pristine copy of GCC 4.8.1.
The copy of GCC that we use for Android is still not working for mingw. Rather than finding all the differences that have crept into our GCC, just check in a copy from ftp://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.8.1.tar.bz2. GCC 4.8.1 was chosen because it is what we have been using for mingw thus far, and the emulator doesn't yet work when upgrading to 4.9. Bug: http://b/26523949 Change-Id: Iedc0f05243d4332cc27ccd46b8a4b203c88dcaa3
Diffstat (limited to 'gcc-4.8.1/gcc/testsuite/gcc.target/arm/pr55073.C')
-rw-r--r--gcc-4.8.1/gcc/testsuite/gcc.target/arm/pr55073.C74
1 files changed, 74 insertions, 0 deletions
diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/arm/pr55073.C b/gcc-4.8.1/gcc/testsuite/gcc.target/arm/pr55073.C
new file mode 100644
index 000000000..5575cf779
--- /dev/null
+++ b/gcc-4.8.1/gcc/testsuite/gcc.target/arm/pr55073.C
@@ -0,0 +1,74 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_neon } */
+
+#include <arm_neon.h>
+#include <stdlib.h>
+
+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);
+}