aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/cpu
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-07-28 09:13:58 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2004-07-28 09:13:58 +0000
commit312209c6a5ff3828335e698a9d0c872a48411fdf (patch)
tree2832c8ac927a0a8fe44a9bd387766c2f8b2c9081 /libstdc++-v3/config/cpu
parent0871761b07caa5c85920d72b0bf7b282b1864a1b (diff)
downloadgcc-312209c6a5ff3828335e698a9d0c872a48411fdf.zip
gcc-312209c6a5ff3828335e698a9d0c872a48411fdf.tar.gz
gcc-312209c6a5ff3828335e698a9d0c872a48411fdf.tar.bz2
Introduce sh4a support.
gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
Diffstat (limited to 'libstdc++-v3/config/cpu')
-rw-r--r--libstdc++-v3/config/cpu/sh/atomicity.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/libstdc++-v3/config/cpu/sh/atomicity.h b/libstdc++-v3/config/cpu/sh/atomicity.h
new file mode 100644
index 0000000..b7d6c60
--- /dev/null
+++ b/libstdc++-v3/config/cpu/sh/atomicity.h
@@ -0,0 +1,123 @@
+// Low-level functions for atomic operations: Generic version -*- C++ -*-
+
+// Copyright (C) 1999, 2001, 2002, 2003 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
+
+#ifdef __SH4A__
+
+typedef int _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __result;
+
+ __asm__ __volatile__
+ ("0:\n"
+ "\tmovli.l\t@%2,r0\n"
+ "\tmov\tr0,%1\n"
+ "\tadd\t%3,r0\n"
+ "\tmovco.l\tr0,@%2\n"
+ "\tbf\t0b"
+ : "+m" (*__mem), "=r" (__result)
+ : "r" (__mem), "rI08" (__val)
+ : "r0");
+
+ return __result;
+}
+
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add (volatile _Atomic_word* __mem, int __val)
+{
+ asm("0:\n"
+ "\tmovli.l\t@%1,r0\n"
+ "\tadd\t%2,r0\n"
+ "\tmovco.l\tr0,@%1\n"
+ "\tbf\t0b"
+ : "+m" (*__mem)
+ : "r" (__mem), "rI08" (__val)
+ : "r0");
+}
+
+#else
+
+/* This is generic/atomicity.h */
+
+#include <bits/gthr.h>
+
+#define _GLIBCPP_NEED_GENERIC_MUTEX
+
+typedef int _Atomic_word;
+
+namespace __gnu_cxx
+{
+ extern __gthread_mutex_t _Atomic_add_mutex;
+
+#ifndef __GTHREAD_MUTEX_INIT
+ extern __gthread_once_t _Atomic_add_mutex_once;
+ extern void __gthread_atomic_add_mutex_once();
+#endif
+}
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word* __mem, int __val)
+{
+#ifndef __GTHREAD_MUTEX_INIT
+ __gthread_once (&__gnu_cxx::_Atomic_add_mutex_once,
+ __gnu_cxx::__gthread_atomic_add_mutex_once);
+#endif
+
+ _Atomic_word __result;
+
+ __gthread_mutex_lock (&__gnu_cxx::_Atomic_add_mutex);
+
+ __result = *__mem;
+ *__mem += __val;
+
+ __gthread_mutex_unlock (&__gnu_cxx::_Atomic_add_mutex);
+ return __result;
+}
+
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add (volatile _Atomic_word* __mem, int __val)
+{
+ (void) __exchange_and_add (__mem, __val);
+}
+
+
+#endif
+
+#endif /* atomicity.h */