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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 708 jeremybenn
/* Common hooks for IBM S/390 and zSeries.
2
   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
3
   2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
4
 
5
This file is part of GCC.
6
 
7
GCC is free software; you can redistribute it and/or modify it under
8
the terms of the GNU General Public License as published by the Free
9
Software Foundation; either version 3, or (at your option) any later
10
version.
11
 
12
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13
WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15
for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with GCC; see the file COPYING3.  If not see
19
<http://www.gnu.org/licenses/>.  */
20
 
21
#include "config.h"
22
#include "system.h"
23
#include "coretypes.h"
24
#include "diagnostic-core.h"
25
#include "tm.h"
26
#include "common/common-target.h"
27
#include "common/common-target-def.h"
28
#include "opts.h"
29
#include "flags.h"
30
 
31
EXPORTED_CONST int processor_flags_table[] =
32
  {
33
    /* g5 */     PF_IEEE_FLOAT,
34
    /* g6 */     PF_IEEE_FLOAT,
35
    /* z900 */   PF_IEEE_FLOAT | PF_ZARCH,
36
    /* z990 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT,
37
    /* z9-109 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
38
                 | PF_EXTIMM,
39
    /* z9-ec */  PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
40
                 | PF_EXTIMM | PF_DFP,
41
    /* z10 */    PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
42
                 | PF_EXTIMM | PF_DFP | PF_Z10,
43
    /* z196 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
44
                 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196
45
  };
46
 
47
/* Change optimizations to be performed, depending on the
48
   optimization level.  */
49
 
50
static const struct default_options s390_option_optimization_table[] =
51
  {
52
    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
53
 
54
    /* ??? There are apparently still problems with -fcaller-saves.  */
55
    { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
56
 
57
    /* Use MVCLE instructions to decrease code size if requested.  */
58
    { OPT_LEVELS_SIZE, OPT_mmvcle, NULL, 1 },
59
 
60
    { OPT_LEVELS_NONE, 0, NULL, 0 }
61
  };
62
 
63
/* Implement TARGET_OPTION_INIT_STRUCT.  */
64
 
65
static void
66
s390_option_init_struct (struct gcc_options *opts)
67
{
68
  /* By default, always emit DWARF-2 unwind info.  This allows debugging
69
     without maintaining a stack frame back-chain.  */
70
  opts->x_flag_asynchronous_unwind_tables = 1;
71
}
72
 
73
/* Implement TARGET_HANDLE_OPTION.  */
74
 
75
static bool
76
s390_handle_option (struct gcc_options *opts,
77
                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
78
                    const struct cl_decoded_option *decoded,
79
                    location_t loc)
80
{
81
  size_t code = decoded->opt_index;
82
  const char *arg = decoded->arg;
83
  int value = decoded->value;
84
 
85
  switch (code)
86
    {
87
    case OPT_march_:
88
      opts->x_s390_arch_flags = processor_flags_table[value];
89
      opts->x_s390_arch_string = arg;
90
      return true;
91
 
92
    case OPT_mstack_guard_:
93
      if (exact_log2 (value) == -1)
94
        error_at (loc, "stack guard value must be an exact power of 2");
95
      return true;
96
 
97
    case OPT_mstack_size_:
98
      if (exact_log2 (value) == -1)
99
        error_at (loc, "stack size must be an exact power of 2");
100
      return true;
101
 
102
    case OPT_mtune_:
103
      opts->x_s390_tune_flags = processor_flags_table[value];
104
      return true;
105
 
106
    case OPT_mwarn_framesize_:
107
      return sscanf (arg, HOST_WIDE_INT_PRINT_DEC,
108
                     &opts->x_s390_warn_framesize) == 1;
109
 
110
    default:
111
      return true;
112
    }
113
}
114
 
115
#undef TARGET_DEFAULT_TARGET_FLAGS
116
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
117
 
118
#undef TARGET_HANDLE_OPTION
119
#define TARGET_HANDLE_OPTION s390_handle_option
120
 
121
#undef TARGET_OPTION_OPTIMIZATION_TABLE
122
#define TARGET_OPTION_OPTIMIZATION_TABLE s390_option_optimization_table
123
 
124
#undef TARGET_OPTION_INIT_STRUCT
125
#define TARGET_OPTION_INIT_STRUCT s390_option_init_struct
126
 
127
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.