Commit b25364a0 by Sumanth G Committed by Jayant Sonar

Adding GCC port for National Semicondutor's CR16 architecture

Co-Authored-By: Jayant R Sonar <jayant.sonar@kpitcummins.com>

From-SVN: r183832
parent 903e49f5
2012-02-02 Sumanth G <sumanth.gundapaneni@kpitcummins.com>
Jayant R Sonar <jayant.sonar@kpitcummins.com>
* configure.ac (cr16-*-*): Remove nonconfigdirs.
* configure: Regenerate.
2012-01-23 Harshit Chopra <harshit@google.com> 2012-01-23 Harshit Chopra <harshit@google.com>
* MAINTAINERS (Write After Approval): Add myself. * MAINTAINERS (Write After Approval): Add myself.
......
...@@ -3453,9 +3453,6 @@ case "${target}" in ...@@ -3453,9 +3453,6 @@ case "${target}" in
tic54x-*-*) tic54x-*-*)
noconfigdirs="$noconfigdirs target-libgloss gdb" noconfigdirs="$noconfigdirs target-libgloss gdb"
;; ;;
cr16-*-*)
noconfigdirs="$noconfigdirs gdb"
;;
d10v-*-*) d10v-*-*)
noconfigdirs="$noconfigdirs target-libgloss" noconfigdirs="$noconfigdirs target-libgloss"
;; ;;
......
...@@ -879,9 +879,6 @@ case "${target}" in ...@@ -879,9 +879,6 @@ case "${target}" in
tic54x-*-*) tic54x-*-*)
noconfigdirs="$noconfigdirs target-libgloss gdb" noconfigdirs="$noconfigdirs target-libgloss gdb"
;; ;;
cr16-*-*)
noconfigdirs="$noconfigdirs gdb"
;;
d10v-*-*) d10v-*-*)
noconfigdirs="$noconfigdirs target-libgloss" noconfigdirs="$noconfigdirs target-libgloss"
;; ;;
......
2012-02-02 Sumanth G <sumanth.gundapaneni@kpitcummins.com>
Jayant R Sonar <jayant.sonar@kpitcummins.com>
* config-list.mk (LIST): Add cr16-elf.
2012-01-02 Georg-Johann Lay <avr@gjlay.de> 2012-01-02 Georg-Johann Lay <avr@gjlay.de>
PR target/51345 PR target/51345
......
...@@ -18,7 +18,7 @@ LIST = alpha-linux-gnu alpha-freebsd6 alpha-netbsd alpha-openbsd \ ...@@ -18,7 +18,7 @@ LIST = alpha-linux-gnu alpha-freebsd6 alpha-netbsd alpha-openbsd \
arm-linux-androideabi arm-uclinux_eabi arm-ecos-elf arm-eabi \ arm-linux-androideabi arm-uclinux_eabi arm-ecos-elf arm-eabi \
arm-symbianelf arm-rtems arm-elf arm-wince-pe avr-rtems avr-elf \ arm-symbianelf arm-rtems arm-elf arm-wince-pe avr-rtems avr-elf \
bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \ bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \
c6x-elf c6x-uclinux cris-elf cris-linux crisv32-elf crisv32-linux \ c6x-elf c6x-uclinux cr16-elf cris-elf cris-linux crisv32-elf crisv32-linux \
epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \ epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \
fr30-elf frv-elf frv-linux h8300-elf h8300-rtems hppa-linux-gnu \ fr30-elf frv-elf frv-linux h8300-elf h8300-rtems hppa-linux-gnu \
hppa-linux-gnuOPT-enable-sjlj-exceptions=yes hppa64-linux-gnu \ hppa-linux-gnuOPT-enable-sjlj-exceptions=yes hppa64-linux-gnu \
......
2012-02-02 Sumanth G <sumanth.gundapaneni@kpitcummins.com>
Jayant R Sonar <jayant.sonar@kpitcummins.com>
* config.gcc: Add cr16-* support.
* doc/extend.texi: Document cr16 extensions.
* doc/install.texi: Document cr16 install.
* doc/invoke.texi: Document cr16 options.
* doc/md.texi: Document cr16 constraints.
* common/config/cr16/cr16-common.c: New file.
* config/cr16/cr16.c: New file.
* config/cr16/cr16.h: New file.
* config/cr16/cr16.md: New file.
* config/cr16/cr16.opt: New file.
* config/cr16/cr16-protos.h: New file.
* config/cr16/predicates.md: New file.
* config/cr16/constraints.md: New file.
* config/cr16/t-cr16: New file.
2012-02-02 Jakub Jelinek <jakub@redhat.com> 2012-02-02 Jakub Jelinek <jakub@redhat.com>
PR target/52086 PR target/52086
......
/* Common hooks for CR16.
Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of GCC.
GCC 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 3, or (at your option)
any later version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "common/common-target.h"
#include "common/common-target-def.h"
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
static const struct default_options cr16_option_optimization_table[] =
{
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE cr16_option_optimization_table
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
...@@ -944,6 +944,11 @@ bfin*-*) ...@@ -944,6 +944,11 @@ bfin*-*)
use_collect2=no use_collect2=no
use_gcc_stdint=wrap use_gcc_stdint=wrap
;; ;;
cr16-*-elf)
tm_file="elfos.h ${tm_file}"
tmake_file="${tmake_file} cr16/t-cr16 "
use_collect2=no
;;
crisv32-*-elf | crisv32-*-none) crisv32-*-elf | crisv32-*-none)
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}" tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
tmake_file="cris/t-cris" tmake_file="cris/t-cris"
......
;; Predicates of machine description for CR16.
;; Copyright (C) 2012 Free Software Foundation, Inc.
;; Contributed by KPIT Cummins Infosystems Limited.
;;
;; This file is part of GCC.
;;
;; GCC 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 3, or (at your
;; option) any later version.
;;
;; GCC 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 GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
;; Constraints
;; Register constraints
(define_register_constraint "b" "NOSP_REGS"
"@no sp registers")
(define_register_constraint "c" "SHORT_REGS"
"@short registers")
(define_register_constraint "d" "LONG_REGS"
"@long registers")
;; Integer constraints.
(define_constraint "I"
"A signed 4-bit immediate."
(and (match_code "const_int")
(match_test "SIGNED_INT_FITS_N_BITS (ival, 4)")))
(define_constraint "J"
"A signed 5-bit immediate."
(and (match_code "const_int")
(match_test "SIGNED_INT_FITS_N_BITS (ival, 5)")))
(define_constraint "K"
"A signed 6-bit immediate."
(and (match_code "const_int")
(match_test "SIGNED_INT_FITS_N_BITS (ival, 6)")))
(define_constraint "L"
"A unsigned 4-bit immediate."
(and (match_code "const_int")
(match_test "UNSIGNED_INT_FITS_N_BITS (ival, 4)")))
(define_constraint "M"
"A unsigned and customized 4-bit immediate."
(and (match_code "const_int")
(match_test "(IN_RANGE_P (ival, 0, 15) && ((ival != 9) && (ival != 11)))")))
(define_constraint "N"
"A signed 16-bit immediate."
(and (match_code "const_int")
(match_test "IN_RANGE_P (ival, -32768, 32767)")))
(define_constraint "O"
"A unsigned 20-bit immediate."
(and (match_code "const_int")
(match_test "IN_RANGE_P (ival, 0, 1048575)")))
(define_constraint "Q"
"A shift QI immediate."
(and (match_code "const_int")
(match_test "IN_RANGE_P (ival, 0, 7)")))
(define_constraint "R"
"A shift HI immediate."
(and (match_code "const_int")
(match_test "IN_RANGE_P (ival, 0, 15)")))
(define_constraint "S"
"A shift SI immediate."
(and (match_code "const_int")
(match_test "IN_RANGE_P (ival, 0, 31)")))
/* Prototypes for exported functions defined in cr16.c
Copyright (C) 2012 Free Software Foundation, Inc.
Contributed by KPIT Cummins Infosystems Limited.
This file is part of GCC.
GCC 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 3, or (at your
option) any later version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_CR16_PROTOS_H
#define GCC_CR16_PROTOS_H
#include "target.h"
/* Register usage. */
extern enum reg_class cr16_regno_reg_class (int);
extern int cr16_hard_regno_mode_ok (int regno, enum machine_mode);
/* Passing function arguments. */
extern int cr16_function_arg_regno_p (int);
#ifdef TREE_CODE
#ifdef RTX_CODE
extern void cr16_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
#endif /* RTX_CODE. */
#endif /* TREE_CODE. */
/* Enumeration giving the various data models we support. */
enum data_model_type
{
DM_DEFAULT, /* Default data model (in CR16C/C+ - up to 16M). */
DM_NEAR, /* Near data model (in CR16C/C+ - up to 1M). */
DM_FAR, /* Far data model (in CR16C+ - up to 4G)
(in CR16C - up to 16M). */
ILLEGAL_DM /* Illegal data model. */
};
#ifdef RTX_CODE
/* Addressing Modes. */
struct cr16_address
{
rtx base; /* Base register: Any register or register pair. */
rtx index; /* Index register: If one is present. */
rtx disp; /* Displacement or Absolute address. */
enum data_model_type data; /* data ref type. */
int code; /* Whether the address is code address.
0 - data, 1 - code label, 2 - function label. */
};
enum cr16_addrtype
{
CR16_INVALID,
CR16_REG_REL,
CR16_REGP_REL,
CR16_INDEX_REGP_REL,
CR16_ABSOLUTE
};
extern void notice_update_cc PARAMS ((rtx));
extern int cr16_operand_bit_pos (int val, int bitval);
extern void cr16_decompose_const (rtx x, int *code,
enum data_model_type *data,
bool treat_as_const);
extern enum cr16_addrtype cr16_decompose_address (rtx addr,
struct cr16_address *out,
bool debug_print,
bool treat_as_const);
extern int cr16_const_double_ok (rtx op);
extern int legitimate_pic_operand_p (rtx);
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
#endif /* RTX_CODE. */
/* Prologue/Epilogue functions. */
extern int cr16_initial_elimination_offset (int, int);
extern char *cr16_prepare_push_pop_string (int);
extern void cr16_expand_prologue (void);
extern void cr16_expand_epilogue (void);
extern const char *cr16_emit_add_sub_di (rtx *, enum rtx_code);
extern const char *cr16_emit_logical_di (rtx *, enum rtx_code);
/* Handling the "interrupt" attribute. */
extern int cr16_interrupt_function_p (void);
extern bool cr16_is_data_model (enum data_model_type);
#endif /* Not GCC_CR16_PROTOS_H. */
; Options for the National Semiconductor CR16 port of the compiler.
; Copyright (C) 2012 Free Software Foundation, Inc.
; Contributed by KPIT Cummins Infosystems Limited.
;
; This file is part of GCC.
;
; GCC 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 3, or (at your
; option) any later version.
;
; GCC 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 GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
msim
Target
-msim Use simulator runtime
mbit-ops
Target Report Mask(BIT_OPS)
Generate SBIT, CBIT instructions
mmac
Target Report Mask(MAC)
Support multiply accumulate instructions
mdebug-addr
Target RejectNegative Var(TARGET_DEBUG_ADDR) Undocumented
mdata-model=
Target RejectNegative JoinedOrMissing Var(cr16_data_model)
Treat data references as near, far or medium. medium is default
mcr16c
Target RejectNegative Mask(CR16C)
Generate code for CR16C architecture
mcr16cplus
Target RejectNegative InverseMask(CR16C,CR16CP)
Generate code for CR16C+ architecture (Default)
mint32
Target RejectNegative Mask(INT32)
Treat integers as 32-bit.
;; Predicates of machine description for CR16.
;; Copyright (C) 2012 Free Software Foundation, Inc.
;; Contributed by KPIT Cummins Infosystems Limited.
;;
;; This file is part of GCC.
;;
;; GCC 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 3, or (at your
;; option) any later version.
;;
;; GCC 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 GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
;; Predicates
;; Predicates for sbit/cbit instructions
;; bit operand used for the generation of bit insn generation
(define_predicate "bit_operand"
(match_code "mem")
{
return ((GET_CODE (op) == MEM && OK_FOR_Z (op)));
})
;; Unsigned 4-bits constant int or double value.
(define_predicate "u4bits_operand"
(match_code "const_int,const_double")
{
if (GET_CODE (op) == CONST_DOUBLE)
return cr16_const_double_ok (op);
return (UNSIGNED_INT_FITS_N_BITS(INTVAL (op), 4)) ? 1 : 0;
})
;; Operand is a constant integer where
;; only one bit is set to 1.
(define_predicate "one_bit_operand"
(match_code "const_int")
{
unsigned int val;
val = INTVAL (op);
if (mode == QImode)
val &= 0xff;
else if (mode == HImode)
val &= 0xffff;
else
gcc_unreachable();
if (val != 0)
return (val & (val - 1)) == 0; /* true if only one bit is set. */
else
return 0;
})
;; Operand is a constant integer where
;; only one bit is set to 0.
(define_predicate "rev_one_bit_operand"
(match_code "const_int")
{
unsigned int val;
val = ~INTVAL (op); /* Invert and use. */
if (mode == QImode)
val &= 0xff;
else if (mode == HImode)
val &= 0xffff;
else
gcc_unreachable();
if (val != 0)
return (val & (val - 1)) == 0; /* true if only one bit is set. */
else
return 0;
})
;; Predicates for shift instructions
;; Immediate operand predicate for count in shift operations.
;; Immediate shall be 3-bits in case operand to be operated on
;; is a qi mode operand.
(define_predicate "shift_qi_imm_operand"
(match_code "const_int")
{
return (UNSIGNED_INT_FITS_N_BITS(INTVAL (op), 3)) ? 1 : 0;
})
;; Immediate shall be 4-bits in case operand to be operated on
;; is a hi mode operand.
(define_predicate "shift_hi_imm_operand"
(match_code "const_int")
{
return (UNSIGNED_INT_FITS_N_BITS(INTVAL (op), 4)) ? 1 : 0;
})
;; Immediate shall be 3-bits in case operand to be operated on
;; is a si mode operand.
(define_predicate "shift_si_imm_operand"
(match_code "const_int")
{
return (UNSIGNED_INT_FITS_N_BITS(INTVAL (op), 5)) ? 1 : 0;
})
;; Predicates for jump/call instructions
;; Jump immediate cannot be more than 24-bits
(define_predicate "jump_imm_operand"
(match_code "const_int")
{
return (UNSIGNED_INT_FITS_N_BITS(INTVAL (op), 24)) ? 1 : 0;
})
;; Call immediate cannot be more than 24-bits
(define_predicate "call_imm_operand"
(match_operand 0 "immediate_operand")
{
if (GET_CODE (op) != CONST_INT) return 1;
return (UNSIGNED_INT_FITS_N_BITS(INTVAL (op), 24)) ? 1 : 0;
})
;; Operand is register or 4-bit immediate operand
(define_predicate "reg_or_u4bits_operand"
(ior (match_operand 0 "u4bits_operand")
(match_operand 0 "register_operand")))
;; Operand is a register or symbol reference
(define_predicate "reg_or_sym_operand"
(ior (match_code "symbol_ref")
(match_operand 0 "register_operand")))
;; Operand is a non stack pointer register
(define_predicate "nosp_reg_operand"
(and (match_operand 0 "register_operand")
(match_test "REGNO (op) != SP_REGNUM")))
(define_predicate "hard_reg_operand"
(and (match_operand 0 "register_operand")
(match_test "REGNO (op) <= 15")))
;; Operand is a memory reference and
;; not a push operand.
(define_predicate "store_operand"
(and (match_operand 0 "memory_operand")
(not (match_operand 0 "push_operand"))))
;; Helper predicate
(define_predicate "reg_or_int_operand"
(ior (match_code "const_int")
(match_operand 0 "register_operand")))
;;
;;
;; Atithmetic/logical predicates
;; QI Helper
(define_predicate "arith_qi_operand"
(match_code "const_int")
{
return (IN_RAN(INTVAL (op), 0, 15) && ((INTVAL (op) != 9)
|| (INTVAL (op) != 11))) ? 1 : 0 ;
})
;;QI Reg, subreg(reg) or const_int.
(define_predicate "reg_qi_int_operand"
(ior (match_operand 0 "arith_qi_operand")
(match_operand 0 "register_operand")))
;; HI Helper
(define_predicate "arith_hi_operand"
(match_code "const_int")
{
return (IN_RAN(INTVAL (op), -32768, 32768) ) ? 1 : 0 ;
})
;;HI Reg, subreg(reg) or const_int.
(define_predicate "reg_hi_int_operand"
(ior (match_operand 0 "arith_hi_operand")
(match_operand 0 "register_operand")))
;;SI Reg, subreg(reg) or const_int.
(define_predicate "reg_si_int_operand"
(ior (match_operand 0 "const_int_operand")
(match_operand 0 "register_operand")))
;;
;; Shift predicates
;; QI Helper
(define_predicate "shift_qi_operand"
(match_code "const_int")
{
return (IN_RAN(INTVAL (op), 0, 7) ) ? 1 : 0;
})
;;QI Reg, subreg(reg) or const_int.
(define_predicate "shift_reg_qi_int_operand"
(ior (match_operand 0 "shift_qi_operand")
(match_operand 0 "register_operand")))
;; HI Helper
(define_predicate "shift_hi_operand"
(match_code "const_int")
{
return (IN_RAN(INTVAL (op), 0, 15) ) ? 1 : 0 ;
})
;;HI Reg, subreg(reg) or const_int.
(define_predicate "shift_reg_hi_int_operand"
(ior (match_operand 0 "shift_hi_operand")
(match_operand 0 "register_operand")))
;; SI Helper
(define_predicate "shift_si_operand"
(match_code "const_int")
{
return (IN_RAN(INTVAL (op), 0, 31) ) ? 1 : 0;
})
;;SI Reg, subreg(reg) or const_int.
(define_predicate "shift_reg_si_int_operand"
(ior (match_operand 0 "shift_si_operand")
(match_operand 0 "register_operand")))
# CR16 Target Makefile
# Copyright (C) 2012 Free Software Foundation, Inc.
# Contributed by KPIT Cummins Infosystems Limited.
#
# This file is part of GCC.
#
# GCC 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 3, or (at your
# option) any later version.
#
# GCC 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 GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
MULTILIB_OPTIONS = fPIC mint32
MULTILIB_DIRNAMES = far-pic int32
MULTILIB_MATCHES =
MULTILIB_EXTRA_OPTS = mcr16cplus mdata-model=far
...@@ -2723,7 +2723,7 @@ This attribute is ignored for R8C target. ...@@ -2723,7 +2723,7 @@ This attribute is ignored for R8C target.
@item interrupt @item interrupt
@cindex interrupt handler functions @cindex interrupt handler functions
Use this attribute on the ARM, AVR, Epiphany, M32C, M32R/D, m68k, MeP, MIPS, Use this attribute on the ARM, AVR, CR16, Epiphany, M32C, M32R/D, m68k, MeP, MIPS,
RL78, RX and Xstormy16 ports to indicate that the specified function is an RL78, RX and Xstormy16 ports to indicate that the specified function is an
interrupt handler. The compiler will generate function entry and exit interrupt handler. The compiler will generate function entry and exit
sequences suitable for use in an interrupt handler when this attribute sequences suitable for use in an interrupt handler when this attribute
......
...@@ -3272,6 +3272,29 @@ is available at @uref{http://blackfin.uclinux.org} ...@@ -3272,6 +3272,29 @@ is available at @uref{http://blackfin.uclinux.org}
@html @html
<hr /> <hr />
@end html @end html
@heading @anchor{cr16}CR16
The CR16 CompactRISC architecture is a 16-bit architecture. This architecture is
used in embedded applications.
@ifnothtml
@xref{CR16 Options,, CR16 Options, gcc, Using and Porting the GNU Compiler
Collection (GCC)},
@end ifnothtml
@ifhtml
See ``CR16 Options'' in the main manual for a list of CR16-specific options.
@end ifhtml
Use @samp{configure --target=cr16-elf --enable-languages=c,c++} to configure
GCC@ for building a CR16 elf cross-compiler.
Use @samp{configure --target=cr16-uclinux --enable-languages=c,c++} to configure
GCC@ for building a CR16 uclinux cross-compiler.
@html
<hr />
@end html
@heading @anchor{cris}CRIS @heading @anchor{cris}CRIS
CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
......
...@@ -524,6 +524,12 @@ Objective-C and Objective-C++ Dialects}. ...@@ -524,6 +524,12 @@ Objective-C and Objective-C++ Dialects}.
-melf -maout -melinux -mlinux -sim -sim2 @gol -melf -maout -melinux -mlinux -sim -sim2 @gol
-mmul-bug-workaround -mno-mul-bug-workaround} -mmul-bug-workaround -mno-mul-bug-workaround}
@emph{CR16 Options}
@gccoptlist{-mmac @gol
-mcr16cplus -mcr16c @gol
-msim -mint32 -mbit-ops
-mdata-model=@var{model}}
@emph{Darwin Options} @emph{Darwin Options}
@gccoptlist{-all_load -allowable_client -arch -arch_errors_fatal @gol @gccoptlist{-all_load -allowable_client -arch -arch_errors_fatal @gol
-arch_only -bind_at_load -bundle -bundle_loader @gol -arch_only -bind_at_load -bundle -bundle_loader @gol
...@@ -10307,6 +10313,7 @@ platform. ...@@ -10307,6 +10313,7 @@ platform.
* Blackfin Options:: * Blackfin Options::
* C6X Options:: * C6X Options::
* CRIS Options:: * CRIS Options::
* CR16 Options::
* Darwin Options:: * Darwin Options::
* DEC Alpha Options:: * DEC Alpha Options::
* DEC Alpha/VMS Options:: * DEC Alpha/VMS Options::
...@@ -11634,6 +11641,46 @@ Like @option{-sim}, but pass linker options to locate initialized data at ...@@ -11634,6 +11641,46 @@ Like @option{-sim}, but pass linker options to locate initialized data at
0x40000000 and zero-initialized data at 0x80000000. 0x40000000 and zero-initialized data at 0x80000000.
@end table @end table
@node CR16 Options
@subsection CR16 Options
@cindex CR16 Options
These options are defined specifically for the CR16 ports.
@table @gcctabopt
@item -mmac
@opindex mmac
Enable the use of multiply-accumulate instructions. Disabled by default.
@item -mcr16cplus
@itemx -mcr16c
@opindex mcr16cplus
@opindex mcr16c
Generate code for CR16C or CR16C+ architecture. CR16C+ architecture
is default.
@item -msim
@opindex msim
Links the library libsim.a which is in compatible with simulator. Applicable
to elf compiler only.
@item -mint32
@opindex mint32
Choose integer type as 32-bit wide.
@item -mbit-ops
@opindex mbit-ops
Generates sbit/cbit instructions for bit manipulations.
@item -mdata-model=@var{model}
@opindex mdata-model
Choose a data model. The choices for @var{model} are @samp{near},
@samp{far} or @samp{medium}. @samp{medium} is default.
However, @samp{far} is not valid when -mcr16c option is chosen as
CR16C architecture does not support far data model.
@end table
@node Darwin Options @node Darwin Options
@subsection Darwin Options @subsection Darwin Options
@cindex Darwin options @cindex Darwin options
......
...@@ -1843,6 +1843,40 @@ Matches control register values to switch fp mode, which are encapsulated in ...@@ -1843,6 +1843,40 @@ Matches control register values to switch fp mode, which are encapsulated in
@code{UNSPEC_FP_MODE}. @code{UNSPEC_FP_MODE}.
@end table @end table
@item CR16 Architecture---@file{config/cr16/cr16.h}
@table @code
@item b
Registers from r0 to r14 (registers without stack pointer)
@item t
Register from r0 to r11 (all 16-bit registers)
@item p
Register from r12 to r15 (all 32-bit registers)
@item I
Signed constant that fits in 4 bits
@item J
Signed constant that fits in 5 bits
@item K
Signed constant that fits in 6 bits
@item L
Unsigned constant that fits in 4 bits
@item M
Signed constant that fits in 32 bits
@item N
Check for 64 bits wide constants for add/sub instructions
@item G
Floating point constant that is legal for store immediate
@end table
@item Hewlett-Packard PA-RISC---@file{config/pa/pa.h} @item Hewlett-Packard PA-RISC---@file{config/pa/pa.h}
@table @code @table @code
@item a @item a
......
2012-02-02 Sumanth G <sumanth.gundapaneni@kpitcummins.com>
Jayant R Sonar <jayant.sonar@kpitcummins.com>
* config.host: Add National Semiconductor CR16 target (cr16-*-*).
* config/cr16/crti.S: New file.
* config/cr16/crtlibid.S: New file.
* config/cr16/crtn.S: New file.
* config/cr16/lib1funcs.S: New file.
* config/cr16/t-cr16: New file.
* config/cr16/t-crtlibid: New file.
* config/cr16/unwind-dw2.h: New file.
* config/cr16/unwind-cr16.c: New file.
* config/cr16/divmodhi3.c: New file.
2012-01-25 Alan Modra <amodra@gmail.com> 2012-01-25 Alan Modra <amodra@gmail.com>
* config/rs6000/t-linux64: Delete. Move.. * config/rs6000/t-linux64: Delete. Move..
......
...@@ -98,6 +98,8 @@ avr-*-*) ...@@ -98,6 +98,8 @@ avr-*-*)
bfin*-*) bfin*-*)
cpu_type=bfin cpu_type=bfin
;; ;;
cr16-*-*)
;;
fido-*-*) fido-*-*)
cpu_type=m68k cpu_type=m68k
;; ;;
...@@ -415,6 +417,10 @@ bfin*-*) ...@@ -415,6 +417,10 @@ bfin*-*)
tmake_file="$tmake_file bfin/t-bfin t-fdpbit" tmake_file="$tmake_file bfin/t-bfin t-fdpbit"
extra_parts="crtbegin.o crtend.o crti.o crtn.o" extra_parts="crtbegin.o crtend.o crti.o crtn.o"
;; ;;
cr16-*-elf)
tmake_file="${tmake_file} cr16/t-cr16 cr16/t-crtlibid t-fdpbit"
extra_parts="$extra_parts crti.o crtn.o crtlibid.o"
;;
crisv32-*-elf) crisv32-*-elf)
tmake_file="$tmake_file cris/t-cris t-fdpbit" tmake_file="$tmake_file cris/t-cris t-fdpbit"
;; ;;
......
# Specialized code needed to support construction and destruction of
# file-scope objects in C++ and Java code, and to support exception handling.
# Copyright (C) 2012 Free Software Foundation, Inc.
# Contributed by KPIT Cummins Infosystems Limited.
# This file 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 3, or (at your option) any
# later version.
#
# This file 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.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the GCC Runtime Library Exception, version
# 3.1, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License and
# a copy of the GCC Runtime Library Exception along with this program;
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
/* This file just supplies function prologues for the .init and .fini
sections. It is linked in before crtbegin.o. */
.ident "GNU C crti.o"
.section .init
.globl __init
.type __init,@function
__init:
#if defined (__ID_SHARED_LIB__)
push $2, r12, ra
movd $__current_shared_library_r12_offset_, (r1,r0)
loadd [r12]0(r1,r0), (r12)
#else
push ra
#endif
.section .fini
.globl __fini
.type __fini,@function
__fini:
#if defined (__ID_SHARED_LIB__)
push $2, r12, ra
movd $__current_shared_library_r12_offset_, (r1,r0)
loadd [r12]0(r1,r0), (r12)
#else
push ra
#endif
# Provide a weak definition of the library ID, for the benefit of certain
# configure scripts.
# Copyright (C) 2012 Free Software Foundation, Inc.
# Contributed by KPIT Cummins Infosystems Limited.
# This file 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 3, or (at your option) any
# later version.
#
# This file 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.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the GCC Runtime Library Exception, version
# 3.1, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License and
# a copy of the GCC Runtime Library Exception along with this program;
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
.ident "GNU C crtlibid.o"
.weak __current_shared_library_r12_offset_
.set __current_shared_library_r12_offset_, 0
# Specialized code needed to support construction and destruction of
# file-scope objects in C++ and Java code, and to support exception handling.
# Copyright (C) 2012 Free Software Foundation, Inc.
# Contributed by KPIT Cummins Infosystems Limited.
# This file 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 3, or (at your option) any
# later version.
#
# This file 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.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the GCC Runtime Library Exception, version
# 3.1, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License and
# a copy of the GCC Runtime Library Exception along with this program;
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
/* This file supplies function epilogues for the .init and .fini sections.
It is linked in after all other files. */
.ident "GNU C crtn.o"
.section .init
#if defined (__ID_SHARED_LIB__)
popret $2, r12, ra
#else
popret ra
#endif
.section .fini
#if defined (__ID_SHARED_LIB__)
popret $2, r12, ra
#else
popret ra
#endif
/* Libgcc Target specific implementation - Emulating div and mod.
Copyright (C) 2012 Free Software Foundation, Inc.
Contributed by KPIT Cummins Infosystems Limited.
This file is part of GCC.
GCC 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 3, or (at your option)
any later version.
GCC 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.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* Emulate the division and modulus operation. */
unsigned short
udivmodhi4 (unsigned short num, unsigned short den, short modwanted)
{
unsigned short bit = 1;
unsigned short res = 0;
while (den < num && bit && !(den & (1 << 15)))
{
den <<= 1;
bit <<= 1;
}
while (bit)
{
if (num >= den)
{
num -= den;
res |= bit;
}
bit >>= 1;
den >>= 1;
}
if (modwanted)
return num;
return res;
}
short
__divhi3 (short a, short b)
{
short neg = 0;
short res;
if (a < 0)
{
a = -a;
neg = !neg;
}
if (b < 0)
{
b = -b;
neg = !neg;
}
res = udivmodhi4 (a, b, 0);
if (neg)
res = -res;
return res;
}
short
__modhi3 (short a, short b)
{
short neg = 0;
short res;
if (a < 0)
{
a = -a;
neg = 1;
}
if (b < 0)
b = -b;
res = udivmodhi4 (a, b, 1);
if (neg)
res = -res;
return res;
}
short
__udivhi3 (short a, short b)
{
return udivmodhi4 (a, b, 0);
}
short
__umodhi3 (short a, short b)
{
return udivmodhi4 (a, b, 1);
}
# Makefile fragment for building LIBGCC for the Renesas CR16 target.
# Copyright (C) 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC 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 3, or (at your
# option) any later version.
#
# GCC 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 GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
LIB1ASMSRC = cr16/lib1funcs.S
LIB1ASMFUNCS = _mulsi3 _lshrdi3 _muldi3 _divdi3 _udivdi3 _udivmoddi3 \
_umoddi3 _moddi3
LIB2ADD = $(srcdir)/config/cr16/divmodhi3.c \
$(srcdir)/udivmodsi4.c \
$(srcdir)/udivmod.c \
$(srcdir)/divmod.c
LIB2ADDEH = $(srcdir)/config/cr16/unwind-cr16.c
# Makefile fragment for building LIBGCC for the Renesas CR16 target.
# Copyright (C) 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC 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 3, or (at your
# option) any later version.
#
# GCC 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 GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
# Assemble startup files.
crtlibid.o: $(srcdir)/config/cr16/crtlibid.S
$(gcc_compile) -c -x assembler-with-cpp $<
/* DWARF2 frame unwind data structure.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2009,
2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
GCC 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 3, or (at your option)
any later version.
GCC 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.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* A target can override (perhaps for backward compatibility) how
many dwarf2 columns are unwound. */
#ifndef DWARF_FRAME_REGISTERS
#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
#endif
/* The result of interpreting the frame unwind info for a frame.
This is all symbolic at this point, as none of the values can
be resolved until the target pc is located. */
typedef struct
{
/* Each register save state can be described in terms of a CFA slot,
another register, or a location expression. */
struct frame_state_reg_info
{
struct {
union {
_Unwind_Word reg;
_Unwind_Sword offset;
const unsigned char *exp;
} loc;
enum {
REG_UNSAVED,
REG_SAVED_OFFSET,
REG_SAVED_REG,
REG_SAVED_EXP,
REG_SAVED_VAL_OFFSET,
REG_SAVED_VAL_EXP,
REG_UNDEFINED
} how;
} reg[DWARF_FRAME_REGISTERS+1];
/* Used to implement DW_CFA_remember_state. */
struct frame_state_reg_info *prev;
/* The CFA can be described in terms of a reg+offset or a
location expression. */
_Unwind_Sword cfa_offset;
_Unwind_Word cfa_reg;
const unsigned char *cfa_exp;
enum {
CFA_UNSET,
CFA_REG_OFFSET,
CFA_EXP
} cfa_how;
} regs;
/* The PC described by the current frame state. */
void *pc;
/* The information we care about from the CIE/FDE. */
_Unwind_Personality_Fn personality;
_Unwind_Sword data_align;
_Unwind_Word code_align;
_Unwind_Word retaddr_column;
unsigned char fde_encoding;
unsigned char lsda_encoding;
unsigned char saw_z;
unsigned char signal_frame;
void *eh_ptr;
} _Unwind_FrameState;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment