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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [config/] [mips/] [sdemtk.h] - Diff between revs 282 and 338

Only display areas with differences | Details | Blame | View Log

Rev 282 Rev 338
/* Definitions of target machine for GNU compiler.
/* Definitions of target machine for GNU compiler.
   MIPS SDE version, for use with the SDE C library rather than newlib.
   MIPS SDE version, for use with the SDE C library rather than newlib.
   Copyright (C) 2007, 2008, 2009
   Copyright (C) 2007, 2008, 2009
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
 
 
This file is part of GCC.
This file is part of GCC.
 
 
GCC is free software; you can redistribute it and/or modify
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
the Free Software Foundation; either version 3, or (at your option)
any later version.
any later version.
 
 
GCC is distributed in the hope that it will be useful,
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
GNU General Public License for more details.
 
 
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */
<http://www.gnu.org/licenses/>.  */
 
 
#define TARGET_OS_CPP_BUILTINS()                        \
#define TARGET_OS_CPP_BUILTINS()                        \
  do                                                    \
  do                                                    \
    {                                                   \
    {                                                   \
      builtin_assert ("system=sde");                    \
      builtin_assert ("system=sde");                    \
      builtin_assert ("system=posix");                  \
      builtin_assert ("system=posix");                  \
      builtin_define ("__SDE_MIPS__");                  \
      builtin_define ("__SDE_MIPS__");                  \
                                                        \
                                                        \
      /* Deprecated: use __mips_isa_rev >= 2.  */       \
      /* Deprecated: use __mips_isa_rev >= 2.  */       \
      if (ISA_MIPS32R2)                                 \
      if (ISA_MIPS32R2)                                 \
        builtin_define ("__mipsr2");                    \
        builtin_define ("__mipsr2");                    \
                                                        \
                                                        \
      /* Deprecated: use __mips_fpr == 64.  */          \
      /* Deprecated: use __mips_fpr == 64.  */          \
      if (TARGET_FLOAT64)                               \
      if (TARGET_FLOAT64)                               \
        builtin_define ("__mipsfp64");                  \
        builtin_define ("__mipsfp64");                  \
                                                        \
                                                        \
      if (TARGET_NO_FLOAT)                              \
      if (TARGET_NO_FLOAT)                              \
        {                                               \
        {                                               \
          builtin_define ("__NO_FLOAT");                \
          builtin_define ("__NO_FLOAT");                \
          builtin_define ("__mips_no_float");           \
          builtin_define ("__mips_no_float");           \
        }                                               \
        }                                               \
      else if (TARGET_SOFT_FLOAT_ABI)                   \
      else if (TARGET_SOFT_FLOAT_ABI)                   \
        builtin_define ("__SOFT_FLOAT");                \
        builtin_define ("__SOFT_FLOAT");                \
      else if (TARGET_SINGLE_FLOAT)                     \
      else if (TARGET_SINGLE_FLOAT)                     \
        builtin_define ("__SINGLE_FLOAT");              \
        builtin_define ("__SINGLE_FLOAT");              \
                                                        \
                                                        \
      if (TARGET_BIG_ENDIAN)                            \
      if (TARGET_BIG_ENDIAN)                            \
        {                                               \
        {                                               \
          builtin_assert ("endian=big");                \
          builtin_assert ("endian=big");                \
          builtin_assert ("cpu=mipseb");                \
          builtin_assert ("cpu=mipseb");                \
        }                                               \
        }                                               \
      else                                              \
      else                                              \
        {                                               \
        {                                               \
          builtin_assert ("endian=little");             \
          builtin_assert ("endian=little");             \
          builtin_assert ("cpu=mipsel");                \
          builtin_assert ("cpu=mipsel");                \
        }                                               \
        }                                               \
    }                                                   \
    }                                                   \
  while (0)
  while (0)
 
 
#undef SUBTARGET_OVERRIDE_OPTIONS
#undef SUBTARGET_OVERRIDE_OPTIONS
#define SUBTARGET_OVERRIDE_OPTIONS                      \
#define SUBTARGET_OVERRIDE_OPTIONS                      \
  do                                                    \
  do                                                    \
    {                                                   \
    {                                                   \
      if (TARGET_NO_FLOAT)                              \
      if (TARGET_NO_FLOAT)                              \
        {                                               \
        {                                               \
          target_flags |= MASK_SOFT_FLOAT_ABI;          \
          target_flags |= MASK_SOFT_FLOAT_ABI;          \
          target_flags_explicit |= MASK_SOFT_FLOAT_ABI; \
          target_flags_explicit |= MASK_SOFT_FLOAT_ABI; \
        }                                               \
        }                                               \
    }                                                   \
    }                                                   \
  while (0)
  while (0)
 
 
/* For __clear_cache in libgcc2.c.  */
/* For __clear_cache in libgcc2.c.  */
#ifdef IN_LIBGCC2
#ifdef IN_LIBGCC2
extern void mips_sync_icache (void *beg, unsigned long len);
extern void mips_sync_icache (void *beg, unsigned long len);
#undef CLEAR_INSN_CACHE
#undef CLEAR_INSN_CACHE
#define CLEAR_INSN_CACHE(beg, end) \
#define CLEAR_INSN_CACHE(beg, end) \
  mips_sync_icache (beg, end - beg)
  mips_sync_icache (beg, end - beg)
#endif
#endif
 
 
/* For mips_cache_flush_func in mips.opt.  */
/* For mips_cache_flush_func in mips.opt.  */
#undef CACHE_FLUSH_FUNC
#undef CACHE_FLUSH_FUNC
#define CACHE_FLUSH_FUNC "mips_sync_icache"
#define CACHE_FLUSH_FUNC "mips_sync_icache"
 
 
/* For inline code which needs to sync the icache and dcache,
/* For inline code which needs to sync the icache and dcache,
   noting that the SDE library takes arguments (address, size).  */
   noting that the SDE library takes arguments (address, size).  */
#undef MIPS_ICACHE_SYNC
#undef MIPS_ICACHE_SYNC
#define MIPS_ICACHE_SYNC(ADDR, SIZE)                                    \
#define MIPS_ICACHE_SYNC(ADDR, SIZE)                                    \
  emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \
  emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \
                     LCT_NORMAL, VOIDmode, 2, ADDR, Pmode,              \
                     LCT_NORMAL, VOIDmode, 2, ADDR, Pmode,              \
                     SIZE, TYPE_MODE (sizetype))
                     SIZE, TYPE_MODE (sizetype))
 
 
/* This version of _mcount does not pop 2 words from the stack.  */
/* This version of _mcount does not pop 2 words from the stack.  */
#undef FUNCTION_PROFILER
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO)                                \
#define FUNCTION_PROFILER(FILE, LABELNO)                                \
  {                                                                     \
  {                                                                     \
    mips_push_asm_switch (&mips_noat);                                  \
    mips_push_asm_switch (&mips_noat);                                  \
    /* _mcount treats $2 as the static chain register.  */              \
    /* _mcount treats $2 as the static chain register.  */              \
    if (cfun->static_chain_decl != NULL)                                \
    if (cfun->static_chain_decl != NULL)                                \
      fprintf (FILE, "\tmove\t%s,%s\n", reg_names[2],                   \
      fprintf (FILE, "\tmove\t%s,%s\n", reg_names[2],                   \
               reg_names[STATIC_CHAIN_REGNUM]);                         \
               reg_names[STATIC_CHAIN_REGNUM]);                         \
    /* MIPS16 code passes saved $ra in $v1 instead of $at.  */          \
    /* MIPS16 code passes saved $ra in $v1 instead of $at.  */          \
    fprintf (FILE, "\tmove\t%s,%s\n",                                   \
    fprintf (FILE, "\tmove\t%s,%s\n",                                   \
             reg_names[GP_REG_FIRST + (TARGET_MIPS16 ? 3 : 1)],         \
             reg_names[GP_REG_FIRST + (TARGET_MIPS16 ? 3 : 1)],         \
             reg_names[RETURN_ADDR_REGNUM]);                            \
             reg_names[RETURN_ADDR_REGNUM]);                            \
    fprintf (FILE, "\tjal\t_mcount\n");                                 \
    fprintf (FILE, "\tjal\t_mcount\n");                                 \
    mips_pop_asm_switch (&mips_noat);                                   \
    mips_pop_asm_switch (&mips_noat);                                   \
    /* _mcount treats $2 as the static chain register.  */              \
    /* _mcount treats $2 as the static chain register.  */              \
    if (cfun->static_chain_decl != NULL)                                \
    if (cfun->static_chain_decl != NULL)                                \
      fprintf (FILE, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], \
      fprintf (FILE, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], \
               reg_names[2]);                                           \
               reg_names[2]);                                           \
  }
  }
 
 
/* ...nor does the call sequence preserve $31.  */
/* ...nor does the call sequence preserve $31.  */
#undef MIPS_SAVE_REG_FOR_PROFILING_P
#undef MIPS_SAVE_REG_FOR_PROFILING_P
#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == RETURN_ADDR_REGNUM)
#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == RETURN_ADDR_REGNUM)
 
 

powered by: WebSVN 2.1.0

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