This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
CRIS port, part 4: libstdc++-v3 parts
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Subject: CRIS port, part 4: libstdc++-v3 parts
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Sat, 29 Sep 2001 17:54:42 +0200
Greatly helped by porting.texi. Note that the default value for
__glibcpp_long_double_bits is 128, which seems counter to most
targets, including CRIS, where "long double" is just an alias
for double.
Ok to commit?
Part 4, libstdc++-v3 port bits:
* configure.target (LIMITSH): Set for cris.
(cpu_include_dir): Set for cris-*-*.
* config/cpu/cris/bits/atomicity.h: New file.
* config/cpu/cris/bits/limits.h: New file.
Index: libstdc++-v3/configure.target
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.target,v
retrieving revision 1.28
diff -p -c -r1.28 configure.target
*** configure.target 2001/08/18 19:22:25 1.28
--- configure.target 2001/09/29 15:02:16
*************** case "${target_cpu}" in
*** 30,35 ****
--- 30,38 ----
arm*)
cpu_include_dir="config/cpu/arm"
;;
+ cris)
+ cpu_include_dir="config/cpu/cris"
+ ;;
ia64)
cpu_include_dir="config/cpu/ia64"
;;
*************** case "${target}" in
*** 139,144 ****
--- 142,150 ----
;;
powerpc-*-*)
LIMITSH=config/cpu/powerpc
+ ;;
+ cris-*-*)
+ LIMITSH=config/cpu/cris
;;
*)
LIMITSH=config/cpu/generic
diff -cprN libstdc++-v3/config/cpu/nothing/bits/atomicity.h libstdc++-v3/config/cpu/cris/bits/atomicity.h
*** libstdc++-v3/config/cpu/nothing/bits/atomicity.h Thu Jan 1 01:00:00 1970
--- libstdc++-v3/config/cpu/cris/bits/atomicity.h Thu Sep 27 17:34:01 2001
***************
*** 0 ****
--- 1,79 ----
+ // Low-level functions for atomic operations: Generic version -*- C++ -*-
+
+ // Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library 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 2, or (at your option)
+ // any later version.
+
+ // This library 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 library; see the file COPYING. If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction. Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License. This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
+ #ifndef _BITS_ATOMICITY_H
+ #define _BITS_ATOMICITY_H 1
+
+ // This entity must not cross a page boundary.
+ typedef int _Atomic_word __attribute__ ((__aligned__ (4)));
+
+ static inline _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add (_Atomic_word* __mem, int __val)
+ {
+ int __tmp;
+ _Atomic_word __result;
+
+ #if (__CRIS_arch_version >= 10)
+ __asm__ __volatile__ (" clearf \n"
+ "0: \n"
+ " move.d %4,%2 \n"
+ " move.d [%3],%0 \n"
+ " add.d %0,%2 \n"
+ " ax \n"
+ " move.d %2,[%3] \n"
+ " bwf 0b \n"
+ " clearf \n"
+ : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
+ : "r" (__mem), "g" (__val), "m" (*__mem)
+ : "memory");
+ #else
+ __asm__ __volatile__ (" move $ccr,$r9 \n"
+ " di \n"
+ " move.d %4,%2 \n"
+ " move.d [%3],%0 \n"
+ " add.d %0,%2 \n"
+ " move.d %2,[%3] \n"
+ " move $r9,$ccr \n"
+ : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
+ : "r" (__mem), "g" (__val), "m" (*__mem)
+ : "memory", "r9");
+ #endif
+
+ return __result;
+ }
+
+ static inline void
+ __attribute__ ((__unused__))
+ __atomic_add (_Atomic_word* __mem, int __val)
+ {
+ __exchange_and_add (__mem, __val);
+ }
+
+ #endif /* atomicity.h */
diff -cprN libstdc++-v3/config/cpu/nothing/bits/limits.h libstdc++-v3/config/cpu/cris/bits/limits.h
*** libstdc++-v3/config/cpu/nothing/bits/limits.h Thu Jan 1 01:00:00 1970
--- libstdc++-v3/config/cpu/cris/bits/limits.h Wed Sep 19 01:05:19 2001
***************
*** 0 ****
--- 1,33 ----
+ // Copyright (C) 2001 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library 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 2, or (at your option)
+ // any later version.
+
+ // This library 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 library; see the file COPYING. If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction. Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License. This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
+ #ifndef _GLIBCPP_CPU_LIMITS
+ #define _GLIBCPP_CPU_LIMITS 1
+
+ #define __glibcpp_long_double_bits 64
+
+ #endif
brgds, H-P