source: rtems-tools/tools/4.11/gcc/sparc/gcc-4.9.2-leon3v7.diff @ d8a82fd

4.104.115
Last change on this file since d8a82fd was d8a82fd, checked in by Sebastian Huber <sebastian.huber@…>, on 12/04/14 at 12:02:27

Add SPARC patches for GCC 4.9.2

These patches are already present in the GCC 4.9 branch and will be
available with GCC 4.9.3.

  • Property mode set to 100644
File size: 10.6 KB
  • gcc/config.gcc

    From cd763e49bec71fd5ecda42c3fcd7a27fbcbddc5e Mon Sep 17 00:00:00 2001
    From: danielh <danielh@138bc75d-0d04-0410-961f-82ee72b054a4>
    Date: Thu, 6 Nov 2014 10:58:33 +0000
    Subject: [PATCH] 	Backport from mainline 	2014-11-06  Daniel Hellstrom 
     <daniel@gaisler.com>
    
    	* config.gcc (sparc*-*-*): Accept mcpu=leon3v7 processor.
    	* doc/invoke.texi (SPARC options): Add mcpu=leon3v7 comment.
    	* config/sparc/leon.md (leon3_load, leon_store, leon_fp_*): Handle
    	leon3v7 as leon3.
    	* config/sparc/sparc-opts.h (enum processor_type): Add LEON3V7.
    	* config/sparc/sparc.c (sparc_option_override): Add leon3v7 support.
    	* config/sparc/sparc.h (TARGET_CPU_leon3v7): New define.
    	* config/sparc/sparc.md (cpu): Add leon3v7.
    	* config/sparc/sparc.opt (enum processor_type): Add leon3v7.
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@217187 138bc75d-0d04-0410-961f-82ee72b054a4
    ---
     gcc/config.gcc                |  5 ++++-
     gcc/config/sparc/leon.md      | 14 +++++++-------
     gcc/config/sparc/sparc-opts.h |  1 +
     gcc/config/sparc/sparc.c      |  3 +++
     gcc/config/sparc/sparc.h      | 40 +++++++++++++++++++++++++---------------
     gcc/config/sparc/sparc.md     |  1 +
     gcc/config/sparc/sparc.opt    |  3 +++
     gcc/doc/invoke.texi           | 16 ++++++++--------
     9 files changed, 64 insertions(+), 31 deletions(-)
    
    diff --git a/gcc/config.gcc b/gcc/config.gcc
    index 9d3fa57..b36da74 100644
    a b if test x$with_cpu = x ; then 
    32053205        *-leon[3-9]*)
    32063206          with_cpu=leon3
    32073207          ;;
     3208        *-leon[3-9]v7*)
     3209          with_cpu=leon3v7
     3210          ;;
    32083211        *)
    32093212          with_cpu="`echo ${target} | sed 's/-.*$//'`"
    32103213          ;;
    case "${target}" in 
    39933996                        case ${val} in
    39943997                        "" | sparc | sparcv9 | sparc64 \
    39953998                        | v7 | cypress \
    3996                         | v8 | supersparc | hypersparc | leon | leon3 \
     3999                        | v8 | supersparc | hypersparc | leon | leon3 | leon3v7 \
    39974000                        | sparclite | f930 | f934 | sparclite86x \
    39984001                        | sparclet | tsc701 \
    39994002                        | v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
  • gcc/config/sparc/leon.md

    diff --git a/gcc/config/sparc/leon.md b/gcc/config/sparc/leon.md
    index 82b6a0d..ad22e3b 100644
    a b  
    2929
    3030;; Use a double reservation to work around the load pipeline hazard on UT699.
    3131(define_insn_reservation "leon3_load" 1
    32   (and (eq_attr "cpu" "leon3") (eq_attr "type" "load,sload"))
     32  (and (eq_attr "cpu" "leon3,leon3v7") (eq_attr "type" "load,sload"))
    3333  "leon_memory*2")
    3434
    3535(define_insn_reservation "leon_store" 2
    36   (and (eq_attr "cpu" "leon,leon3") (eq_attr "type" "store"))
     36  (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "store"))
    3737  "leon_memory*2")
    3838
    3939;; This describes Gaisler Research's FPU
     
    4444(define_cpu_unit "grfpu_ds" "grfpu")
    4545
    4646(define_insn_reservation "leon_fp_alu" 4
    47   (and (eq_attr "cpu" "leon,leon3") (eq_attr "type" "fp,fpcmp,fpmul"))
     47  (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fp,fpcmp,fpmul"))
    4848  "grfpu_alu, nothing*3")
    4949
    5050(define_insn_reservation "leon_fp_divs" 16
    51   (and (eq_attr "cpu" "leon,leon3") (eq_attr "type" "fpdivs"))
     51  (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpdivs"))
    5252  "grfpu_ds*14, nothing*2")
    5353
    5454(define_insn_reservation "leon_fp_divd" 17
    55   (and (eq_attr "cpu" "leon,leon3") (eq_attr "type" "fpdivd"))
     55  (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpdivd"))
    5656  "grfpu_ds*15, nothing*2")
    5757
    5858(define_insn_reservation "leon_fp_sqrts" 24
    59   (and (eq_attr "cpu" "leon,leon3") (eq_attr "type" "fpsqrts"))
     59  (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpsqrts"))
    6060  "grfpu_ds*22, nothing*2")
    6161
    6262(define_insn_reservation "leon_fp_sqrtd" 25
    63   (and (eq_attr "cpu" "leon,leon3") (eq_attr "type" "fpsqrtd"))
     63  (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpsqrtd"))
    6464  "grfpu_ds*23, nothing*2")
  • gcc/config/sparc/sparc-opts.h

    diff --git a/gcc/config/sparc/sparc-opts.h b/gcc/config/sparc/sparc-opts.h
    index 13b375a..26017ed 100644
    a b enum processor_type { 
    3131  PROCESSOR_HYPERSPARC,
    3232  PROCESSOR_LEON,
    3333  PROCESSOR_LEON3,
     34  PROCESSOR_LEON3V7,
    3435  PROCESSOR_SPARCLITE,
    3536  PROCESSOR_F930,
    3637  PROCESSOR_F934,
  • gcc/config/sparc/sparc.c

    diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
    index 5b00cca..b77e808 100644
    a b sparc_option_override (void) 
    12461246    { TARGET_CPU_hypersparc, PROCESSOR_HYPERSPARC },
    12471247    { TARGET_CPU_leon, PROCESSOR_LEON },
    12481248    { TARGET_CPU_leon3, PROCESSOR_LEON3 },
     1249    { TARGET_CPU_leon3v7, PROCESSOR_LEON3V7 },
    12491250    { TARGET_CPU_sparclite, PROCESSOR_F930 },
    12501251    { TARGET_CPU_sparclite86x, PROCESSOR_SPARCLITE86X },
    12511252    { TARGET_CPU_sparclet, PROCESSOR_TSC701 },
    sparc_option_override (void) 
    12741275    { "hypersparc",     MASK_ISA, MASK_V8|MASK_FPU },
    12751276    { "leon",           MASK_ISA, MASK_V8|MASK_LEON|MASK_FPU },
    12761277    { "leon3",          MASK_ISA, MASK_V8|MASK_LEON3|MASK_FPU },
     1278    { "leon3v7",        MASK_ISA, MASK_LEON3|MASK_FPU },
    12771279    { "sparclite",      MASK_ISA, MASK_SPARCLITE },
    12781280    /* The Fujitsu MB86930 is the original sparclite chip, with no FPU.  */
    12791281    { "f930",           MASK_ISA|MASK_FPU, MASK_SPARCLITE },
    sparc_option_override (void) 
    15261528      sparc_costs = &leon_costs;
    15271529      break;
    15281530    case PROCESSOR_LEON3:
     1531    case PROCESSOR_LEON3V7:
    15291532      sparc_costs = &leon3_costs;
    15301533      break;
    15311534    case PROCESSOR_SPARCLET:
  • gcc/config/sparc/sparc.h

    diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
    index dd2b5ad..79dbba2 100644
    a b extern enum cmodel sparc_cmodel; 
    137137#define TARGET_CPU_hypersparc   3
    138138#define TARGET_CPU_leon         4
    139139#define TARGET_CPU_leon3        5
    140 #define TARGET_CPU_sparclite    6
    141 #define TARGET_CPU_f930         6       /* alias */
    142 #define TARGET_CPU_f934         6       /* alias */
    143 #define TARGET_CPU_sparclite86x 7
    144 #define TARGET_CPU_sparclet     8
    145 #define TARGET_CPU_tsc701       8       /* alias */
    146 #define TARGET_CPU_v9           9       /* generic v9 implementation */
    147 #define TARGET_CPU_sparcv9      9       /* alias */
    148 #define TARGET_CPU_sparc64      9       /* alias */
    149 #define TARGET_CPU_ultrasparc   10
    150 #define TARGET_CPU_ultrasparc3  11
    151 #define TARGET_CPU_niagara      12
    152 #define TARGET_CPU_niagara2     13
    153 #define TARGET_CPU_niagara3     14
    154 #define TARGET_CPU_niagara4     15
     140#define TARGET_CPU_leon3v7      6
     141#define TARGET_CPU_sparclite    7
     142#define TARGET_CPU_f930         7       /* alias */
     143#define TARGET_CPU_f934         7       /* alias */
     144#define TARGET_CPU_sparclite86x 8
     145#define TARGET_CPU_sparclet     9
     146#define TARGET_CPU_tsc701       9       /* alias */
     147#define TARGET_CPU_v9           10      /* generic v9 implementation */
     148#define TARGET_CPU_sparcv9      10      /* alias */
     149#define TARGET_CPU_sparc64      10      /* alias */
     150#define TARGET_CPU_ultrasparc   11
     151#define TARGET_CPU_ultrasparc3  12
     152#define TARGET_CPU_niagara      13
     153#define TARGET_CPU_niagara2     14
     154#define TARGET_CPU_niagara3     15
     155#define TARGET_CPU_niagara4     16
    155156
    156157#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \
    157158 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \
    extern enum cmodel sparc_cmodel; 
    239240#define ASM_CPU32_DEFAULT_SPEC AS_LEON_FLAG
    240241#endif
    241242
     243#if TARGET_CPU_DEFAULT == TARGET_CPU_leon3v7
     244#define CPP_CPU32_DEFAULT_SPEC "-D__leon__"
     245#define ASM_CPU32_DEFAULT_SPEC AS_LEONV7_FLAG
     246#endif
     247
    242248#endif
    243249
    244250#if !defined(CPP_CPU32_DEFAULT_SPEC) || !defined(CPP_CPU64_DEFAULT_SPEC)
    extern enum cmodel sparc_cmodel; 
    285291%{mcpu=hypersparc:-D__hypersparc__ -D__sparc_v8__} \
    286292%{mcpu=leon:-D__leon__ -D__sparc_v8__} \
    287293%{mcpu=leon3:-D__leon__ -D__sparc_v8__} \
     294%{mcpu=leon3v7:-D__leon__} \
    288295%{mcpu=v9:-D__sparc_v9__} \
    289296%{mcpu=ultrasparc:-D__sparc_v9__} \
    290297%{mcpu=ultrasparc3:-D__sparc_v9__} \
    extern enum cmodel sparc_cmodel; 
    334341%{mcpu=hypersparc:-Av8} \
    335342%{mcpu=leon:" AS_LEON_FLAG "} \
    336343%{mcpu=leon3:" AS_LEON_FLAG "} \
     344%{mcpu=leon3v7:" AS_LEONV7_FLAG "} \
    337345%{mv8plus:-Av8plus} \
    338346%{mcpu=v9:-Av9} \
    339347%{mcpu=ultrasparc:%{!mv8plus:-Av9a}} \
    extern int sparc_indent_opcode; 
    17601768
    17611769#ifdef HAVE_AS_LEON
    17621770#define AS_LEON_FLAG "-Aleon"
     1771#define AS_LEONV7_FLAG "-Aleon"
    17631772#else
    17641773#define AS_LEON_FLAG "-Av8"
     1774#define AS_LEONV7_FLAG "-Av7"
    17651775#endif
    17661776
    17671777/* We use gcc _mcount for profiling.  */
  • gcc/config/sparc/sparc.md

    diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
    index 76c3315..954c297 100644
    a b  
    221221   hypersparc,
    222222   leon,
    223223   leon3,
     224   leon3v7,
    224225   sparclite,
    225226   f930,
    226227   f934,
  • gcc/config/sparc/sparc.opt

    diff --git a/gcc/config/sparc/sparc.opt b/gcc/config/sparc/sparc.opt
    index 64e4095..3cd2b60 100644
    a b EnumValue 
    153153Enum(sparc_processor_type) String(leon3) Value(PROCESSOR_LEON3)
    154154
    155155EnumValue
     156Enum(sparc_processor_type) String(leon3v7) Value(PROCESSOR_LEON3V7)
     157
     158EnumValue
    156159Enum(sparc_processor_type) String(sparclite) Value(PROCESSOR_SPARCLITE)
    157160
    158161EnumValue
  • gcc/doc/invoke.texi

    diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
    index bea8be2..7bb83ed 100644
    a b the rules of the ABI@. 
    2109921099Set the instruction set, register set, and instruction scheduling parameters
    2110021100for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
    2110121101@samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
    21102 @samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934},
    21103 @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
     21102@samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
     21103@samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
    2110421104@samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
    2110521105@samp{niagara3} and @samp{niagara4}.
    2110621106
    implementations. 
    2111821118
    2111921119@table @asis
    2112021120@item v7
    21121 cypress
     21121cypress, leon3v7
    2112221122
    2112321123@item v8
    2112421124supersparc, hypersparc, leon, leon3
    option @option{-mcpu=@var{cpu_type}} does. 
    2118321183The same values for @option{-mcpu=@var{cpu_type}} can be used for
    2118421184@option{-mtune=@var{cpu_type}}, but the only useful values are those
    2118521185that select a particular CPU implementation.  Those are @samp{cypress},
    21186 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930},
    21187 @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
    21188 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and
    21189 @samp{niagara4}.  With native Solaris and GNU/Linux toolchains, @samp{native}
    21190 can also be used.
     21186@samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
     21187@samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
     21188@samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
     21189@samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
     21190toolchains, @samp{native} can also be used.
    2119121191
    2119221192@item -mv8plus
    2119321193@itemx -mno-v8plus
Note: See TracBrowser for help on using the repository browser.