OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc
    from Rev 322 to Rev 323
    Reverse comparison

Rev 322 → Rev 323

/trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/interrupts.c
0,0 → 1,58
/* { dg-do compile } */
/* { dg-options "-mint-register=3 -msave-acc-in-interrupts" } */
 
/* Verify that the RX specific function attributes work. */
 
void fast_interrupt (void) __attribute__((__fast_interrupt__));
void interrupt (void) __attribute__((__interrupt__));
int naked (int) __attribute__((__naked__));
 
int flag = 0;
 
/* Fast interrupt handler. Only uses registers marked as fixed
by the -fixed-xxx gcc command line option. Returns via RTFI. */
 
void
fast_interrupt (void)
{
flag = 1;
}
 
/* Interrupt handler. Must preserve any register it uses, even
call clobbered ones. Returns via RTE. */
 
void
interrupt (void)
{
switch (flag)
{
case 0:
flag = -1;
break;
case 1:
case 2:
case 4:
flag = flag - 2;
break;
case 5:
case 7:
case 6:
flag ^= 3;
break;
default:
naked (flag * 2);
break;
}
}
 
/* Naked function. The programmer must supply the function's
prologue and epilogue instructions. */
 
int
naked (int arg)
{
flag = arg;
}
 
/* { dg-final { scan-assembler "rtfi" } } */
/* { dg-final { scan-assembler "rte" } } */
trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/interrupts.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: trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/rx.exp =================================================================== --- trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/rx.exp (nonexistent) +++ trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/rx.exp (revision 323) @@ -0,0 +1,43 @@ +# Copyright (C) 2008 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 this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't the right target. +if { ![istarget rx-*-*] } 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 "" +} + +# Initialize `dg'. +dg-init + +# Find all tests +set tests [lsort [find $srcdir/$subdir *.\[cS\]]] + +# Main loop. +gcc-dg-runtest $tests $DEFAULT_CFLAGS + +# All done. +dg-finish Index: trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/rx-abi-function-tests.c =================================================================== --- trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/rx-abi-function-tests.c (nonexistent) +++ trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/rx-abi-function-tests.c (revision 323) @@ -0,0 +1,159 @@ +/* { dg-do run } */ +/* { dg-options "-msim" } */ +/* Note: The -msim above is actually there to override the default + options which include -ansi -pendantic and -Wlong-long... */ + +extern int printf (const char *, ...); +extern void exit (int); +extern void abort (void); + +extern signed long _COM_CONVf32s (float); +extern unsigned long _COM_CONVf32u (float); +extern float _COM_CONV32sf (signed long); +extern float _COM_CONV32uf (unsigned long); +extern float _COM_ADDf (float, float); +extern float _COM_SUBf (float, float); +extern float _COM_MULf (float, float); +extern float _COM_DIVf (float, float); +extern int _COM_CMPLTf (float, float); + +extern long long _COM_MUL64 (long long, long long); +extern signed long long _COM_DIV64s (long long, long long); +extern unsigned long long _COM_DIV64u (unsigned long long, unsigned long long); +extern long long _COM_SHLL64 (long long, int); +extern long long _COM_SHLR64 (long long, int); +extern long long _COM_SHAR64 (long long, int); +extern signed long long _COM_CONVf64s (float); +extern unsigned long long _COM_CONVf64u (float); +extern signed long long _COM_CONVd64s (double); +extern unsigned long long _COM_CONVd64u (double); +extern float _COM_CONV64sf (signed long long); +extern float _COM_CONV64uf (unsigned long long); +extern double _COM_CONV64sd (signed long long); +extern double _COM_CONV64ud (unsigned long long); +extern signed long long _COM_MOD64s (long long, long long); +extern unsigned long long _COM_MOD64u (unsigned long long, unsigned long long); +extern int _COM_CMPLT64s (long long, long long); +extern int _COM_CMPLT64u (unsigned long long, unsigned long long); +extern int _COM_CMPGT64s (long long, long long); +extern int _COM_CMPGT64u (unsigned long long, unsigned long long); +extern int _COM_CMPLE64s (long long, long long); +extern int _COM_CMPLE64u (unsigned long long, unsigned long long); +extern int _COM_CMPGE64s (long long, long long); +extern int _COM_CMPGE64u (unsigned long long, unsigned long long); +extern int _COM_CMPEQ64 (long long, long long); +extern int _COM_CMPNE64 (long long, long long); + +extern double _COM_ADDd (double, double); +extern double _COM_SUBd (double, double); +extern double _COM_MULd (double, double); +extern double _COM_DIVd (double, double); +extern signed long _COM_CONVd32s (double); +extern unsigned long _COM_CONVd32u (double); +extern double _COM_CONV32sd (signed long); +extern double _COM_CONV32ud (unsigned long); +extern double _COM_CONVfd (float); +extern float _COM_CONVdf (double); +extern double _COM_NEGd (double); + + +/* #define DEBUG 1 */ + +#ifdef DEBUG +# define TEST1(func,arg1,result) if (func (arg1) != result) printf ("fail: " #func " (" #arg1 ") returns %x rather than " #result "\n", func (arg1)) +# define TEST2(func,arg1,arg2,result) if (func (arg1, arg2) != result) printf ("fail: " #func " (" #arg1 ", " #arg2 ") returns %x rather than " #result "\n", func (arg1, arg2)) +# define TEST_CMP(func, low_arg, high_arg, lt_result, eq_result, gt_result) \ + do \ + { \ + int res; \ + \ + if ((res = func (low_arg, high_arg)) != lt_result) printf ("fail: " #func " (" #low_arg ", " #high_arg ") returns %d rather than %d\n", res, lt_result); \ + if ((res = func (high_arg, low_arg)) != gt_result) printf ("fail: " #func " (" #high_arg ", " #low_arg ") returns %d rather than %d\n", res, gt_result); \ + if ((res = func (low_arg, low_arg)) != eq_result) printf ("fail: " #func " (" #low_arg ", " #low_arg ") returns %d rather than %d\n", res, eq_result); \ + } \ + while (0) +#else +# define TEST1(func,arg1,result) if (func (arg1) != result) abort () +# define TEST2(func,arg1,arg2,result) if (func (arg1, arg2) != result) abort () +# define TEST_CMP(func,low,high,lt_res,eq_res,gt_res) \ + if ( (func (low, high) != lt_res) \ + || (func (high, low) != gt_res) \ + || (func (low, low) != eq_res)) \ + abort (); +#endif + + +int +main (void) +{ +#ifdef DEBUG + printf ("Tests starting\n"); +#endif + + TEST1 (_COM_CONVf32s, -2.0f, -2); + TEST1 (_COM_CONVf32u, -2.0f, (unsigned) -2); + TEST1 (_COM_CONV32sf, -2, -2.0f); + TEST1 (_COM_CONV32uf, 2, 2.0f); + TEST2 (_COM_ADDf, 1.0f, 2.0f, 3.0f); + TEST2 (_COM_SUBf, 3.0f, 2.0f, 1.0f); + TEST2 (_COM_MULf, 2.0f, 3.0f, 6.0f); + TEST2 (_COM_DIVf, 6.0f, 2.0f, 3.0f); + TEST_CMP (_COM_CMPLTf, 1.0f, 2.0f, 1, 0, 0); + TEST_CMP (_COM_CMPGTf, 1.0f, 2.0f, 0, 0, 1); + TEST_CMP (_COM_CMPLEf, 1.0f, 2.0f, 1, 1, 0); + TEST_CMP (_COM_CMPGEf, 1.0f, 2.0f, 0, 1, 1); + TEST_CMP (_COM_CMPEQf, 1.0f, 2.0f, 0, 1, 0); + TEST_CMP (_COM_CMPNEf, 1.0f, 2.0f, 1, 0, 1); + + + TEST2 (_COM_MUL64, 2LL, 4LL, 8LL); + TEST2 (_COM_DIV64s, 6LL, 3LL, 2LL); + TEST2 (_COM_DIV64u, 6ULL, 3ULL, 2ULL); + TEST2 (_COM_SHLL64, 6LL, 3, 48LL); + TEST2 (_COM_SHLR64, 8LL, 2, 2LL); + TEST2 (_COM_SHAR64, -1LL, 2, -1LL); + TEST1 (_COM_CONVf64s, -2.0f, -2LL); + TEST1 (_COM_CONVf64u, 2.0f, 2ULL); + TEST1 (_COM_CONVd64s, -2.0, -2LL); + TEST1 (_COM_CONVd64u, 2.0, 2ULL); + TEST1 (_COM_CONV64sf, -2LL, -2.0f); + TEST1 (_COM_CONV64uf, 2ULL, 2.0f); + TEST1 (_COM_CONV64sd, -2LL, -2.0); + TEST1 (_COM_CONV64ud, 2ULL, 2.0); + TEST2 (_COM_MOD64s, 4LL, 3LL, 1LL); + TEST2 (_COM_MOD64u, 4ULL, 3ULL, 1ULL); + TEST_CMP (_COM_CMPLT64s, 1LL, 2LL, 1, 0, 0); + TEST_CMP (_COM_CMPLT64u, 1ULL, 2ULL, 1, 0, 0); + TEST_CMP (_COM_CMPGT64s, 1LL, 2LL, 0, 0, 1); + TEST_CMP (_COM_CMPGT64u, 1ULL, 2ULL, 0, 0, 1); + TEST_CMP (_COM_CMPLE64s, 1LL, 2LL, 1, 1, 0); + TEST_CMP (_COM_CMPLE64u, 1ULL, 2ULL, 1, 1, 0); + TEST_CMP (_COM_CMPGE64s, 1LL, 2LL, 0, 1, 1); + TEST_CMP (_COM_CMPGE64u, 1ULL, 2ULL, 0, 1, 1); + TEST_CMP (_COM_CMPEQ64, 1LL, 2LL, 0, 1, 0); + TEST_CMP (_COM_CMPNE64, 1LL, 2LL, 1, 0, 1); + + + TEST2 (_COM_ADDd, 1.0, 2.0, 3.0); + TEST2 (_COM_SUBd, 3.0, 2.0, 1.0); + TEST2 (_COM_MULd, 2.0, 3.0, 6.0); + TEST2 (_COM_DIVd, 6.0, 2.0, 3.0); + TEST1 (_COM_CONVd32s, -2.0, -2); + TEST1 (_COM_CONVd32u, -2.0, (unsigned) -2); + TEST1 (_COM_CONV32sd, -2, -2.0); + TEST1 (_COM_CONV32ud, 2, 2.0); + TEST1 (_COM_CONVfd, 2.0f, 2.0); + TEST1 (_COM_CONVdf, 2.0, 2.0f); + TEST1 (_COM_NEGd, -2.0, 2.0); + TEST_CMP (_COM_CMPLTd, 1.0, 2.0, 1, 0, 0); + TEST_CMP (_COM_CMPGTd, 1.0, 2.0, 0, 0, 1); + TEST_CMP (_COM_CMPLEd, 1.0, 2.0, 1, 1, 0); + TEST_CMP (_COM_CMPGEd, 1.0, 2.0, 0, 1, 1); + TEST_CMP (_COM_CMPEQd, 1.0, 2.0, 0, 1, 0); + TEST_CMP (_COM_CMPNEd, 1.0, 2.0, 1, 0, 1); + +#ifdef DEBUG + printf ("Tests finished\n"); +#endif + exit (0); +}
trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/rx-abi-function-tests.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: trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/builtins.c =================================================================== --- trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/builtins.c (nonexistent) +++ trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/builtins.c (revision 323) @@ -0,0 +1,171 @@ +/* { dg-do run } */ +/* { dg-options "-fno-ipa-cp-clone" } */ + +/* Verify that the RX specific builtin functions work. */ + +/* IPA CP cloning is disabled because the constant propagation + has no understanding of the saturation behaviour of the + __builtin_rx_sat function and so it will optimize away the + saturation addition test. */ + +#include +#include + +/* We need to prevent these functions from being inlined + as otherwise gcc will attempt to optimize away their + arguments and we need the operations on them in order + to correctly set the psw flags. */ + +int saturate_add (int, int) __attribute__((__noinline__)); +int exchange (int, int) __attribute__((__noinline__)); + +int +half_word_swap (int arg) +{ + return __builtin_rx_revw (arg); +} + +int +saturate_add (int arg1, int arg2) +{ + arg1 += arg2; + return __builtin_rx_sat (arg1); +} + +int +exchange (int arg1, int arg2) +{ + arg1 = __builtin_rx_xchg (arg2); + return arg1; +} + +long +multiply_and_accumulate (long arg1, long arg2, long arg3) +{ + __builtin_rx_mvtaclo (0); + __builtin_rx_mvtachi (0); + + __builtin_rx_mullo (arg1, arg2); + __builtin_rx_mulhi (arg1, arg2); + __builtin_rx_maclo (arg1, arg3); + __builtin_rx_machi (arg1, arg3); + + __builtin_rx_racw (1); + + arg1 = __builtin_rx_mvfachi (); + arg1 += __builtin_rx_mvfacmi (); + + return arg1; +} + +int +rxround (float arg) +{ + return __builtin_rx_round (arg); +} + +/* #define DEBUG 1 */ + +#ifdef DEBUG +#define CHECK_0ARG(func, result) \ + if (func () != result) \ + { \ + printf (#func " () fails: %x not %x\n", func (), result); \ + abort (); \ + } + +#define CHECK_1ARG(func, arg, result) \ + if (func (arg) != result) \ + { \ + printf (#func " (" #arg ") fails: %x not %x\n", func (arg), result); \ + abort (); \ + } + +#define CHECK_2ARG(func, arg1, arg2, result) \ + if (func (arg1, arg2) != result) \ + { \ + printf (#func " (" #arg1 "," #arg2 ") fails: %x not %x\n", \ + func (arg1, arg2), result); \ + abort (); \ + } + +#define CHECK_3ARG(func, arg1, arg2, arg3, result) \ + if (func (arg1, arg2, arg3) != result) \ + { \ + printf (#func " (" #arg1 "," #arg2 "," #arg3 ") fails: %x not %x\n", \ + func (arg1, arg2, arg3), result); \ + abort (); \ + } +#else +#define CHECK_0ARG(func, result) \ + if (func () != result) \ + abort (); + +#define CHECK_1ARG(func, arg, result) \ + if (func (arg) != result) \ + abort (); + +#define CHECK_2ARG(func, arg1, arg2, result) \ + if (func (arg1, arg2) != result) \ + abort (); + +#define CHECK_3ARG(func, arg1, arg2, arg3, result) \ + if (func (arg1, arg2, arg3) != result) \ + abort (); +#endif + +int +main (void) +{ + CHECK_1ARG (half_word_swap, 0x12345678, 0x34127856); + CHECK_2ARG (saturate_add, 0x80000000, 0x80000000, 0x80000000); + CHECK_3ARG (multiply_and_accumulate, 0x111, 0x222, 0x333, 0x70007); + CHECK_1ARG (rxround, 0.5, 1); + return 0; +} + +/* The following builtins are compiled but + not executed because they need OS support. */ + +void +rxbreak (void) +{ + __builtin_rx_brk (); +} + +void +interrupt (void) +{ + __builtin_rx_int (0x12); +} + +int +get_stack_pointer (void) +{ + return __builtin_rx_mvfc (2); +} + +void +set_stack_pointer (int value) +{ + __builtin_rx_mvtc (2, value); + __builtin_rx_mvtc (2, 0x1234); +} + +void +wait (void) +{ + __builtin_rx_wait (); +} + +void +rmpa (int * multiplicand, int * multiplier, int num) +{ + __builtin_rx_rmpa (); +} + +void +set_interrupts (void) +{ + __builtin_mvtipl (3); +}
trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/builtins.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: trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/packed-struct.c =================================================================== --- trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/packed-struct.c (nonexistent) +++ trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/packed-struct.c (revision 323) @@ -0,0 +1,55 @@ +/* { dg-do compile } */ + +struct unpacked +{ + int i; + char c; +}; + +#pragma pack(1) + +struct packed +{ + int i; + char c; +}; + +struct packed_contains_unpacked +{ + char c; + struct unpacked uuuu; /* This should generate an error message. */ +}; /* { dg-error "unpacked structure/union inside a packed struct" "XFAILed until patch for generic GCC structure layout code is accepted" { xfail rx-*-* } } */ + +union contains_unpacked +{ + char c; + struct unpacked uuuu; /* This should not. */ +}; + +struct packed_contains_packed +{ + char c; + struct packed ppppp; /* This should not. */ +}; + +#pragma pack() + +struct unpacked_contains_packed +{ + char c; + struct packed p; +}; + +struct unpacked_contains_unpacked +{ + char c; + struct unpacked u; +}; + + +int s1 = sizeof (struct unpacked); +int s2 = sizeof (struct packed); +int s3 = sizeof (struct packed_contains_unpacked); +int s4 = sizeof (struct packed_contains_packed); +int s5 = sizeof (struct unpacked_contains_packed); +int s6 = sizeof (struct unpacked_contains_unpacked);
trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/packed-struct.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: trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/zero-width-bitfield.c =================================================================== --- trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/zero-width-bitfield.c (nonexistent) +++ trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/zero-width-bitfield.c (revision 323) @@ -0,0 +1,32 @@ +/* { dg-do run { xfail rx-*-* } } */ +/* { dg-skip-if "skipped until patch for generic zero=width bit-field handling is accepted" { rx-*-* } { "*" } { "" } } */ +/* { dg-options "-msim" } */ +/* Note: The -msim abiove is actually there to override the default + options which do not allow the GCC extension of zero-width bitfields. */ + +extern void abort (void); +extern void exit (int); + +struct S_zero +{ + int f1: 4; + int f2: 0; + short f3: 4; +} S_zero; + +struct S_norm +{ + int f1: 4; + short f3: 4; +} S_norm; + + +int +main (void) +{ + if (sizeof (S_zero) != 4 || sizeof (S_norm) != 8) + abort (); + + exit (0); + return 0; +}
trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/zero-width-bitfield.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: trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/i272091.c =================================================================== --- trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/i272091.c (nonexistent) +++ trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/i272091.c (revision 323) @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-msmall-data-limit=100" } */ + +double a=6.76,b=7.34,c=0.54; +double x_1= 45.46; +static double SD_1; +static double SD_init = 45.54; +double DD_1; +double DD_init=769.0; + + +int main() +{ + volatile double x,y,z; + + x = 56.76; + y = 4.5645; + + z = x + y; + z = x - 4.65; + z = 4.566 - x; + z = x * y; + b = 8; + c = 34; + return 0; +} +
trunk/gnu-src/gcc-4.5.1/gcc/testsuite/gcc.target/rx/i272091.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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.