OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [common/] [config/] [m68k/] [m68k-common.c] - Blame information for rev 708

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 708 jeremybenn
/* Common hooks for Motorola 68000 family.
2
   Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3
   2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4
   Free Software Foundation, Inc.
5
 
6
This file is part of GCC.
7
 
8
GCC is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 3, or (at your option)
11
any later version.
12
 
13
GCC is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17
 
18
You should have received a copy of the GNU General Public License
19
along with GCC; see the file COPYING3.  If not see
20
<http://www.gnu.org/licenses/>.  */
21
 
22
#include "config.h"
23
#include "system.h"
24
#include "coretypes.h"
25
#include "diagnostic-core.h"
26
#include "tm.h"
27
#include "common/common-target.h"
28
#include "common/common-target-def.h"
29
#include "opts.h"
30
#include "flags.h"
31
 
32
/* Implement TARGET_HANDLE_OPTION.  */
33
 
34
static bool
35
m68k_handle_option (struct gcc_options *opts,
36
                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
37
                    const struct cl_decoded_option *decoded,
38
                    location_t loc)
39
{
40
  size_t code = decoded->opt_index;
41
  const char *arg = decoded->arg;
42
  int value = decoded->value;
43
 
44
  switch (code)
45
    {
46
    case OPT_m68020_40:
47
      opts->x_m68k_tune_option = u68020_40;
48
      opts->x_m68k_cpu_option = m68020;
49
      return true;
50
 
51
    case OPT_m68020_60:
52
      opts->x_m68k_tune_option = u68020_60;
53
      opts->x_m68k_cpu_option = m68020;
54
      return true;
55
 
56
    case OPT_mshared_library_id_:
57
      if (value > MAX_LIBRARY_ID)
58
        error_at (loc, "-mshared-library-id=%s is not between 0 and %d",
59
                  arg, MAX_LIBRARY_ID);
60
      else
61
        {
62
          char *tmp;
63
          asprintf (&tmp, "%d", (value * -4) - 4);
64
          opts->x_m68k_library_id_string = tmp;
65
        }
66
      return true;
67
 
68
    default:
69
      return true;
70
    }
71
}
72
 
73
#undef TARGET_HANDLE_OPTION
74
#define TARGET_HANDLE_OPTION m68k_handle_option
75
 
76
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;

powered by: WebSVN 2.1.0

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