URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-old/gcc-4.2.2/gcc/testsuite/gcc.target/alpha
- from Rev 154 to Rev 816
- ↔ Reverse comparison
Rev 154 → Rev 816
/asm-1.c
0,0 → 1,82
/* Asm operands that are given as hard registers must keep the same |
hard register all the way through compilation. Example derived |
from glibc source. */ |
/* { dg-do compile { target alpha*-*-* } } */ |
/* { dg-options "-O2 -frename-registers -fcprop-registers" } */ |
/* { dg-final { scan-assembler "callsys1 .0 .19 .0 .16 .17" } } */ |
/* { dg-final { scan-assembler "callsys2 .0 .19 .0 .16 .17" } } */ |
|
struct stat { |
int dummy; |
}; |
|
struct kernel_stat { |
int dummy; |
}; |
|
extern int xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf); |
extern int *__errno_location (void) __attribute__ ((__const__)); |
|
int |
__fxstat (int vers, int fd, struct stat *buf) |
{ |
struct kernel_stat kbuf; |
int result; |
|
if (vers == 0) |
return |
({ |
long _sc_ret, _sc_err; |
{ |
register long _sc_0 __asm__("$0"); |
register long _sc_16 __asm__("$16"); |
register long _sc_17 __asm__("$17"); |
register long _sc_19 __asm__("$19"); |
_sc_0 = 91; |
_sc_16 = (long) (fd); |
_sc_17 = (long) (((struct kernel_stat *) buf)); |
__asm__("callsys1 %0 %1 %2 %3 %4" |
: "=r"(_sc_0), "=r"(_sc_19) |
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17) |
: "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", |
"$22", "$23", "$24", "$25", "$27", "$28", "memory"); |
_sc_ret = _sc_0, _sc_err = _sc_19; |
} |
if (_sc_err) |
{ |
(*__errno_location ()) = (_sc_ret); |
_sc_ret = -1L; |
} |
_sc_ret; |
}); |
|
result = |
({ |
long _sc_ret, _sc_err; |
{ |
register long _sc_0 __asm__("$0"); |
register long _sc_16 __asm__("$16"); |
register long _sc_17 __asm__("$17"); |
register long _sc_19 __asm__("$19"); |
_sc_0 = 91; |
_sc_16 = (long) (fd); |
_sc_17 = (long) ((&kbuf)); |
__asm__("callsys2 %0 %1 %2 %3 %4" |
: "=r"(_sc_0), "=r"(_sc_19) |
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17) |
: "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", |
"$22", "$23", "$24", "$25", "$27", "$28", "memory"); |
_sc_ret = _sc_0, _sc_err = _sc_19; |
} |
if (_sc_err) |
{ |
(*__errno_location ()) = (_sc_ret); |
_sc_ret = -1L; |
} |
_sc_ret; |
}); |
if (result == 0) |
result = xstat_conv (vers, &kbuf, buf); |
|
return result; |
} |
asm-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: alpha.exp
===================================================================
--- alpha.exp (nonexistent)
+++ alpha.exp (revision 816)
@@ -0,0 +1,41 @@
+# Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# .
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't an Alpha target.
+if ![istarget alpha*-*-*] then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
Index: cix-1.c
===================================================================
--- cix-1.c (nonexistent)
+++ cix-1.c (revision 816)
@@ -0,0 +1,14 @@
+/* Test that the CIX isa builtins compile. */
+/* { dg-do link { target alpha*-*-* } } */
+/* { dg-options "-mcpu=ev67" } */
+
+void test_CIX (long x)
+{
+ volatile long sink;
+
+ sink = __builtin_alpha_cttz (x);
+ sink = __builtin_alpha_ctlz (x);
+ sink = __builtin_alpha_ctpop (x);
+}
+
+int main() { return 0; }
cix-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cix-2.c
===================================================================
--- cix-2.c (nonexistent)
+++ cix-2.c (revision 816)
@@ -0,0 +1,5 @@
+/* Test that alpha-cix-1.c compiles with optimization. */
+/* { dg-do link { target alpha*-*-* } } */
+/* { dg-options "-mcpu=ev67 -O2" } */
+
+#include "cix-1.c"
cix-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: max-1.c
===================================================================
--- max-1.c (nonexistent)
+++ max-1.c (revision 816)
@@ -0,0 +1,27 @@
+/* Test that the MAX isa builtins compile. */
+/* { dg-do link { target alpha*-*-* } } */
+/* { dg-options "-mcpu=pca56" } */
+
+void test_MAX (long x, long y)
+{
+ volatile long sink;
+
+ sink = __builtin_alpha_pklb (x);
+ sink = __builtin_alpha_pkwb (x);
+ sink = __builtin_alpha_unpkbl (x);
+ sink = __builtin_alpha_unpkbw (x);
+
+ sink = __builtin_alpha_minub8 (0, x);
+ sink = __builtin_alpha_minub8 (1, x);
+ sink = __builtin_alpha_minub8 (x, y);
+ sink = __builtin_alpha_minsb8 (x, y);
+ sink = __builtin_alpha_minuw4 (x, y);
+ sink = __builtin_alpha_minsw4 (x, y);
+ sink = __builtin_alpha_maxub8 (x, y);
+ sink = __builtin_alpha_maxsb8 (x, y);
+ sink = __builtin_alpha_maxuw4 (x, y);
+ sink = __builtin_alpha_maxsw4 (x, y);
+ sink = __builtin_alpha_perr (x, y);
+}
+
+int main() { return 0; }
max-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: max-2.c
===================================================================
--- max-2.c (nonexistent)
+++ max-2.c (revision 816)
@@ -0,0 +1,5 @@
+/* Test that alpha-max-1.c compiles with optimization. */
+/* { dg-do link { target alpha*-*-* } } */
+/* { dg-options "-mcpu=pca56 -O2" } */
+
+#include "max-1.c"
max-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24178.c
===================================================================
--- pr24178.c (nonexistent)
+++ pr24178.c (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcpu=ev4" } */
+
+struct S {
+ long l;
+ unsigned char c;
+};
+unsigned long f(unsigned char *p10) {
+ struct S *p = (struct S *) (p10 + 10);
+ return p->c;
+}
+
+/* { dg-final { scan-assembler "ldl.*,18\\(" } } */
pr24178.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: 980217-1.c
===================================================================
--- 980217-1.c (nonexistent)
+++ 980217-1.c (revision 816)
@@ -0,0 +1,39 @@
+/* Test float on alpha. */
+
+/* { dg-do run { target alpha*-*-* } } */
+/* { dg-options "-mieee -O2" } */
+
+extern void abort(void);
+extern int printf(const char *, ...);
+
+typedef int int32_t __attribute__ ((__mode__ ( __SI__ ))) ;
+typedef union
+{
+ float value;
+ int32_t word;
+} ieee_float_shape_type;
+
+int isinff(float x)
+{
+ int32_t ix,t;
+ ieee_float_shape_type gf_u;
+ gf_u.value = x;
+ ix = gf_u.word;
+ printf ("%x\n", ix);
+ t = ix & 0x7fffffff;
+ t ^= 0x7f800000;
+ t |= -t;
+ return ~(t >> 31) & (1 - ((ix & 0x80000000) >> 30));
+}
+
+main ()
+{
+ float x = 1.0 / 0.0;
+ int i = isinff (x);
+
+ if (i == 0)
+ abort ();
+
+ printf ("%d\n", i);
+ return 0;
+}
980217-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: base-1.c
===================================================================
--- base-1.c (nonexistent)
+++ base-1.c (revision 816)
@@ -0,0 +1,73 @@
+/* Test that the base isa builtins compile. */
+/* { dg-do link { target alpha*-*-* } } */
+/* { dg-options "-mcpu=ev4" } */
+
+void test_BASE (long x, long y)
+{
+ volatile long sink;
+ long z;
+
+ sink = __builtin_alpha_implver ();
+ sink = __builtin_alpha_rpcc ();
+
+ sink = __builtin_alpha_amask (-1);
+ sink = __builtin_alpha_amask (x);
+
+ sink = __builtin_alpha_cmpbge (x, y);
+ sink = __builtin_alpha_cmpbge (-1, x);
+
+ sink = __builtin_alpha_extbl (x, y);
+ sink = __builtin_alpha_extwl (x, y);
+ sink = __builtin_alpha_extll (x, y);
+ sink = __builtin_alpha_extql (x, y);
+ sink = __builtin_alpha_extwh (x, y);
+ sink = __builtin_alpha_extlh (x, y);
+ sink = __builtin_alpha_extqh (x, y);
+
+ sink = __builtin_alpha_insbl (x, y);
+ sink = __builtin_alpha_inswl (x, y);
+ sink = __builtin_alpha_insll (x, y);
+ sink = __builtin_alpha_insql (x, y);
+ sink = __builtin_alpha_inswh (x, y);
+ sink = __builtin_alpha_inslh (x, y);
+ sink = __builtin_alpha_insqh (x, y);
+
+ sink = __builtin_alpha_mskbl (x, y);
+ sink = __builtin_alpha_mskwl (x, y);
+ sink = __builtin_alpha_mskll (x, y);
+ sink = __builtin_alpha_mskql (x, y);
+ sink = __builtin_alpha_mskwh (x, y);
+ sink = __builtin_alpha_msklh (x, y);
+ sink = __builtin_alpha_mskqh (x, y);
+
+ sink = __builtin_alpha_umulh (x, y);
+}
+
+void test_zap (long x, long y)
+{
+ volatile long sink;
+ long z;
+ sink = __builtin_alpha_zap (x, y);
+ sink = __builtin_alpha_zap (x, 0xaa);
+ z = 0xaa;
+ sink = __builtin_alpha_zap (x, z);
+ z = 0;
+ sink = __builtin_alpha_zap (z, x);
+ sink = __builtin_alpha_zap (x, z);
+}
+
+void test_zapnot (long x, long y)
+{
+ volatile long sink;
+ long z;
+
+ sink = __builtin_alpha_zapnot (x, y);
+ sink = __builtin_alpha_zapnot (x, 0xaa);
+ z = 0xaa;
+ sink = __builtin_alpha_zapnot (x, z);
+ z = 0;
+ sink = __builtin_alpha_zapnot (z, x);
+ sink = __builtin_alpha_zapnot (x, z);
+}
+
+int main() { return 0; }
base-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: base-2.c
===================================================================
--- base-2.c (nonexistent)
+++ base-2.c (revision 816)
@@ -0,0 +1,5 @@
+/* Test that alpha-base-1.c compiles with optimization. */
+/* { dg-do link { target alpha*-*-* } } */
+/* { dg-options "-mcpu=ev4 -O2" } */
+
+#include "base-1.c"
base-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr19518.c
===================================================================
--- pr19518.c (nonexistent)
+++ pr19518.c (revision 816)
@@ -0,0 +1,60 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcpu=ev67" } */
+
+typedef short INT16;
+typedef unsigned int CARD32;
+typedef unsigned short CARD16;
+typedef unsigned char CARD8;
+typedef struct _Picture *PicturePtr;
+typedef int FbStride;
+typedef unsigned long __m64;
+extern __m64 load8888 (__m64);
+static __inline __m64 _mm_adds_pu8(__m64 __m1, __m64 __m2)
+{
+ return __m1 + __builtin_alpha_minsb8(__m2, ~__m1);
+}
+static __inline __m64 _mm_packs_pu16(__m64 __m1, __m64 __m2)
+{
+ __m1 = __builtin_alpha_minuw4(__m1, 0x00ff00ff00ff00ff);
+ __m2 = __builtin_alpha_minuw4(__m2, 0x00ff00ff00ff00ff);
+ return __m1 | (__m2 << 32);
+}
+typedef unsigned long long ullong;
+static __inline__ __m64 pix_multiply(__m64 a)
+{
+ if (a)
+ return a;
+}
+static __inline__ __m64 over(__m64 src, __m64 srca, __m64 dest)
+{
+ return _mm_adds_pu8(src, pix_multiply(dest));
+}
+
+void fbCompositeSolid_nx8888mmx(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+ INT16 yDst, CARD16 width, CARD16 height)
+{
+ CARD32 src;
+ CARD32 *dstLine, *dst;
+ CARD16 w;
+ FbStride dstStride;
+ __m64 vsrc, vsrca;
+ vsrc = load8888(src);
+ while (height--) {
+ dst = dstLine;
+ dstLine += dstStride;
+ while (w && (unsigned long) dst & 7) {
+ *dst = _mm_packs_pu16(_mm_adds_pu8(vsrc, load8888(*dst)),
+ _mm_setzero_si64());
+ dst++;
+ }
+ while (w >= 2) {
+ __m64 dest0, dest1;
+ *(__m64 *) dst = _mm_packs_pu16(dest0, dest1);
+ w -= 2;
+ }
+ while (w) {
+ *dst = _mm_packs_pu16(_mm_adds_pu8(vsrc, pix_multiply(0)), 0);
+ w--;
+ }
+ }
+}
pr19518.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: 20011018-1.c
===================================================================
--- 20011018-1.c (nonexistent)
+++ 20011018-1.c (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do compile { target alpha*-*-* } } */
+/* { dg-options "-O2 -mieee" } */
+
+double foo (void);
+void bar (float, float);
+
+void test (void)
+{
+ float f, g;
+
+ f = foo();
+ g = foo();
+ asm ("");
+ bar (f, g);
+}
20011018-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: 20000715-1.c
===================================================================
--- 20000715-1.c (nonexistent)
+++ 20000715-1.c (revision 816)
@@ -0,0 +1,9 @@
+/* { dg-do compile { target alpha*-*-* } } */
+/* { dg-options "-O2 -mieee" } */
+
+float foo(unsigned char n)
+{
+ float r = 10 * n;
+ asm volatile("" : : : "memory");
+ return r;
+}
20000715-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property