bfin-modes.def: New file.

* config/bfin/bfin-modes.def: New file.
	* config/bfin/bfin-protos.h: New file.
	* config/bfin/bfin.c: New file.
	* config/bfin/bfin.h: New file.
	* config/bfin/bfin.md: New file.
	* config/bfin/bfin.opt: New file.
	* config/bfin/crti.s: New file.
	* config/bfin/crtn.s: New file.
	* config/bfin/elf.h: New file.
	* config/bfin/lib1funcs.asm: New file.
	* config/bfin/predicates.md: New file.
	* config/bfin/t-bfin: New file.
	* config/bfin/t-bfin-elf: New file.
	* doc/extend.texi (exception_handler, kspisusp, nesting, nmi_handler):
	Document new attributes.
	(interrupt, interrupt_handler, saveall): Update documentation for
	these attributes.
	* doc/install.texi (Specific): Add entry for the Blackfin.
	* doc/invoke.texi (Blackfin Options): New section.
	* doc/md.texi (Blackfin family): New section to document constraints.
	* config.gcc: Add bfin*-* and bfin*-elf configurations.

From-SVN: r97622
This commit is contained in:
Bernd Schmidt 2005-04-05 11:26:48 +00:00 committed by Bernd Schmidt
parent fcec20a758
commit 0d4a78eb9e
19 changed files with 6602 additions and 9 deletions

View file

@ -1,3 +1,27 @@
2005-04-05 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin-modes.def: New file.
* config/bfin/bfin-protos.h: New file.
* config/bfin/bfin.c: New file.
* config/bfin/bfin.h: New file.
* config/bfin/bfin.md: New file.
* config/bfin/bfin.opt: New file.
* config/bfin/crti.s: New file.
* config/bfin/crtn.s: New file.
* config/bfin/elf.h: New file.
* config/bfin/lib1funcs.asm: New file.
* config/bfin/predicates.md: New file.
* config/bfin/t-bfin: New file.
* config/bfin/t-bfin-elf: New file.
* doc/extend.texi (exception_handler, kspisusp, nesting, nmi_handler):
Document new attributes.
(interrupt, interrupt_handler, saveall): Update documentation for
these attributes.
* doc/install.texi (Specific): Add entry for the Blackfin.
* doc/invoke.texi (Blackfin Options): New section.
* doc/md.texi (Blackfin family): New section to document constraints.
* config.gcc: Add bfin*-* and bfin*-elf configurations.
2005-04-05 Olivier Hainque <hainque@adacore.com>
* config/mips/iris6.h (DWARF_FRAME_RETURN_COLUMN): Redefine to

View file

@ -248,6 +248,9 @@ arm*-*-*)
cpu_type=arm
extra_headers="mmintrin.h"
;;
bfin*-*)
cpu_type=bfin
;;
ep9312*-*-*)
cpu_type=arm
;;
@ -727,6 +730,16 @@ avr-*-*)
tm_file="avr/avr.h dbxelf.h"
use_fixproto=yes
;;
bfin*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
tmake_file=bfin/t-bfin-elf
use_collect2=no
;;
bfin*-*)
tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
tmake_file=bfin/t-bfin
use_collect2=no
;;
c4x-*-rtems* | tic4x-*-rtems*)
tmake_file="c4x/t-c4x t-rtems c4x/t-rtems"
tm_file="c4x/c4x.h c4x/rtems.h rtems.h"

View file

@ -0,0 +1,25 @@
/* Definitions of target machine for GNU compiler, for Blackfin.
Copyright (C) 2005 Free Software Foundation, Inc.
Contributed by Analog Devices.
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 2, 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 COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
/* PDImode for the 40 bit accumulators. */
PARTIAL_INT_MODE (DI);
VECTOR_MODE (INT, HI, 2); /* V2HI */

View file

@ -0,0 +1,88 @@
/* Prototypes for Blackfin functions used in the md file & elsewhere.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 2, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Function prototypes that cannot exist in bfin.h due to dependency
complications. */
#ifndef GCC_BFIN_PROTOS_H
#define GCC_BFIN_PROTOS_H
#define Mmode enum machine_mode
extern rtx function_arg (CUMULATIVE_ARGS *, Mmode, tree, int);
extern void function_arg_advance (CUMULATIVE_ARGS *, Mmode, tree, int);
extern bool function_arg_regno_p (int);
extern const char *output_load_immediate (rtx *);
extern const char *output_casesi_internal (rtx *);
extern char *bfin_asm_long (void);
extern char *bfin_asm_short (void);
extern int log2constp (unsigned HOST_WIDE_INT);
extern rtx legitimize_address (rtx, rtx, Mmode);
extern int hard_regno_mode_ok (int, Mmode);
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
extern int bfin_frame_pointer_required (void);
extern HOST_WIDE_INT bfin_initial_elimination_offset (int, int);
extern int effective_address_32bit_p (rtx, Mmode);
extern int symbolic_reference_mentioned_p (rtx);
extern rtx bfin_gen_compare (rtx, Mmode);
extern void expand_move (rtx *, Mmode);
extern void bfin_expand_call (rtx, rtx, rtx, int);
extern bool bfin_expand_strmov (rtx, rtx, rtx, rtx);
extern void conditional_register_usage (void);
extern int bfin_register_move_cost (enum machine_mode, enum reg_class,
enum reg_class);
extern int bfin_memory_move_cost (enum machine_mode, enum reg_class, int in);
extern enum reg_class secondary_input_reload_class (enum reg_class, Mmode,
rtx);
extern enum reg_class secondary_output_reload_class (enum reg_class, Mmode,
rtx);
extern char *section_asm_op_1 (SECT_ENUM_T);
extern char *section_asm_op (SECT_ENUM_T);
extern void override_options (void);
extern void print_operand (FILE *, rtx, char);
extern void print_address_operand (FILE *, rtx);
extern void split_di (rtx [], int, rtx [], rtx []);
extern int split_load_immediate (rtx []);
extern rtx legitimize_pic_address (rtx, rtx);
extern void emit_pic_move (rtx *, Mmode);
extern void override_options (void);
extern void asm_conditional_branch (rtx, rtx *, int, int);
extern rtx bfin_gen_compare (rtx, Mmode);
extern int bfin_return_in_memory (tree);
extern void initialize_trampoline (rtx, rtx, rtx);
extern bool bfin_legitimate_address_p (Mmode, rtx, int);
extern rtx bfin_va_arg (tree, tree);
extern void bfin_expand_prologue (void);
extern void bfin_expand_epilogue (int, int);
extern int push_multiple_operation (rtx, Mmode);
extern int pop_multiple_operation (rtx, Mmode);
extern void output_push_multiple (rtx, rtx *);
extern void output_pop_multiple (rtx, rtx *);
extern int bfin_hard_regno_rename_ok (unsigned int, unsigned int);
extern rtx bfin_return_addr_rtx (int);
#undef Mmode
#endif

2728
gcc/config/bfin/bfin.c Normal file

File diff suppressed because it is too large Load diff

1168
gcc/config/bfin/bfin.h Normal file

File diff suppressed because it is too large Load diff

1902
gcc/config/bfin/bfin.md Normal file

File diff suppressed because it is too large Load diff

36
gcc/config/bfin/bfin.opt Normal file
View file

@ -0,0 +1,36 @@
; Options for the Blackfin port of the compiler
;
; Copyright (C) 2005 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 2, 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 COPYING. If not, write to the Free
; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
; 02111-1307, USA.
momit-leaf-frame-pointer
Target Report Mask(OMIT_LEAF_FRAME_POINTER)
Omit frame pointer for leaf functions
mlow64k
Target Report Mask(LOW_64K)
Program is entirely located in low 64k of memory.
mcsync
Target Report Mask(CSYNC)
Avoid speculative loads by inserting CSYNC or equivalent
mid-shared-library
Target Report Mask(ID_SHARED_LIBRARY)
Enabled ID based shared library

47
gcc/config/bfin/crti.s Normal file
View file

@ -0,0 +1,47 @@
/* Specialized code needed to support construction and destruction of
file-scope objects in C++ and Java code, and to support exception handling.
Copyright (C) 2005 Free Software Foundation, Inc.
Contributed by Analog Devices.
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 2, 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 COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/*
* This file just supplies function prologues for the .init and .fini
* sections. It is linked in before crtbegin.o.
*/
.file "crti.o"
.ident "GNU C crti.o"
.section .init
.globl _init
.type _init,@function
_init:
LINK 0;
.section .fini
.globl _fini
.type _fini,@function
_fini:
LINK 0;

43
gcc/config/bfin/crtn.s Normal file
View file

@ -0,0 +1,43 @@
/* Specialized code needed to support construction and destruction of
file-scope objects in C++ and Java code, and to support exception handling.
Copyright (C) 2005 Free Software Foundation, Inc.
Contributed by Analog Devices.
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 2, 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 COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/*
* This file supplies function epilogues for the .init and .fini sections.
* It is linked in after all other files.
*/
.file "crtn.o"
.ident "GNU C crtn.o"
.section .init
unlink;
rts;
.section .fini
unlink;
rts;

16
gcc/config/bfin/elf.h Normal file
View file

@ -0,0 +1,16 @@
#define OBJECT_FORMAT_ELF
#define LOCAL_LABEL_PREFIX "L$"
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf (LABEL, "*%s%s$%d", LOCAL_LABEL_PREFIX, PREFIX, (int) NUM)
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"

View file

@ -0,0 +1,120 @@
/* libgcc functions for Blackfin.
Copyright (C) 2005 Free Software Foundation, Inc.
Contributed by Analog Devices.
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 2, 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 COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
#ifdef L_divsi3
.text
.align 2
.global ___divsi3;
.type ___divsi3, STT_FUNC;
___divsi3:
[--SP]= RETS;
[--SP] = R7;
R2 = -R0;
CC = R0 < 0;
IF CC R0 = R2;
R7 = CC;
R2 = -R1;
CC = R1 < 0;
IF CC R1 = R2;
R2 = CC;
R7 = R7 ^ R2;
CALL ___udivsi3;
CC = R7;
R1 = -R0;
IF CC R0 = R1;
R7 = [SP++];
RETS = [SP++];
RTS;
#endif
#ifdef L_modsi3
.align 2
.global ___modsi3;
.type ___modsi3, STT_FUNC;
___modsi3:
[--SP] = RETS;
/* P1 and P2 are preserved by divsi3 and udivsi3. */
P1 = R0;
P2 = R1;
CALL ___divsi3;
R1 = P1;
R2 = P2;
R2 *= R0;
R0 = R1 - R2;
RETS = [SP++];
RTS;
#endif
#ifdef L_udivsi3
.align 2
.global ___udivsi3;
.type ___udivsi3, STT_FUNC;
___udivsi3:
P0 = 32;
LSETUP (0f, 1f) LC0 = P0;
/* upper half of dividend */
R3 = 0;
0:
/* The first time round in the loop we shift in garbage, but since we
perform 33 shifts, it doesn't matter. */
R0 = ROT R0 BY 1;
R3 = ROT R3 BY 1;
R2 = R3 - R1;
CC = R3 < R1 (IU);
1:
/* Last instruction of the loop. */
IF ! CC R3 = R2;
/* Shift in the last bit. */
R0 = ROT R0 BY 1;
/* R0 is the result, R3 contains the remainder. */
R0 = ~ R0;
RTS;
#endif
#ifdef L_umodsi3
.align 2
.global ___umodsi3;
.type ___umodsi3, STT_FUNC;
___umodsi3:
P1 = RETS;
CALL ___udivsi3;
R0 = R3;
RETS = P1;
RTS;
#endif

View file

@ -0,0 +1,127 @@
;; Predicate definitions for the Blackfin.
;;
;; 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 2, 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 COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;; Return nonzero iff OP is one of the integer constants 1 or 2.
(define_predicate "pos_scale_operand"
(and (match_code "const_int")
(match_test "INTVAL (op) == 1 || INTVAL (op) == 2")))
;; Return nonzero iff OP is one of the integer constants 2 or 4.
(define_predicate "scale_by_operand"
(and (match_code "const_int")
(match_test "INTVAL (op) == 2 || INTVAL (op) == 4")))
;; Return nonzero if OP is a constant that consists of two parts; lower
;; bits all zero and upper bits all ones. In this case, we can perform
;; an AND operation with a sequence of two shifts. Don't return nonzero
;; if the constant would be cheap to load.
(define_predicate "highbits_operand"
(and (match_code "const_int")
(match_test "log2constp (-INTVAL (op)) && !CONST_7BIT_IMM_P (INTVAL (op))")))
;; Return nonzero if OP is suitable as a right-hand side operand for an
;; andsi3 operation.
(define_predicate "rhs_andsi3_operand"
(ior (match_operand 0 "register_operand")
(and (match_code "const_int")
(match_test "log2constp (~INTVAL (op)) || INTVAL (op) == 255 || INTVAL (op) == 65535"))))
;; Return nonzero if OP is a register or a constant with exactly one bit
;; set.
(define_predicate "regorlog2_operand"
(ior (match_operand 0 "register_operand")
(and (match_code "const_int")
(match_test "log2constp (INTVAL (op))"))))
;; Like register_operand, but make sure that hard regs have a valid mode.
(define_predicate "valid_reg_operand"
(match_operand 0 "register_operand")
{
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
if (REGNO (op) < FIRST_PSEUDO_REGISTER)
return HARD_REGNO_MODE_OK (REGNO (op), mode);
return 1;
})
;; Return nonzero if OP is the CC register.
(define_predicate "cc_operand"
(and (match_code "reg")
(match_test "REGNO (op) == REG_CC && GET_MODE (op) == BImode")))
;; Return nonzero if OP is a register or a 7 bit signed constant.
(define_predicate "reg_or_7bit_operand"
(ior (match_operand 0 "register_operand")
(and (match_code "const_int")
(match_test "CONST_7BIT_IMM_P (INTVAL (op))"))))
;; Used for secondary reloads, this function returns 1 if OP is of the
;; form (plus (fp) (const_int)).
(define_predicate "fp_plus_const_operand"
(match_code "plus")
{
rtx op1, op2;
op1 = XEXP (op, 0);
op2 = XEXP (op, 1);
return (REG_P (op1)
&& (REGNO (op1) == FRAME_POINTER_REGNUM
|| REGNO (op1) == STACK_POINTER_REGNUM)
&& GET_CODE (op2) == CONST_INT);
})
;; Returns 1 if OP is a symbolic operand, i.e. a symbol_ref or a label_ref,
;; possibly with an offset.
(define_predicate "symbolic_operand"
(ior (match_code "symbol_ref,label_ref")
(and (match_code "const")
(match_test "GET_CODE (XEXP (op,0)) == PLUS
&& (GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
|| GET_CODE (XEXP (XEXP (op, 0), 0)) == LABEL_REF)
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT"))))
;; Returns 1 if OP is a plain constant or matched by symbolic_operand.
(define_predicate "symbolic_or_const_operand"
(ior (match_code "const_int,const_double")
(match_operand 0 "symbolic_operand")))
;; True for any non-virtual or eliminable register. Used in places where
;; instantiation of such a register may cause the pattern to not be recognized.
(define_predicate "register_no_elim_operand"
(match_operand 0 "register_operand")
{
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
return !(op == arg_pointer_rtx
|| op == frame_pointer_rtx
|| (REGNO (op) >= FIRST_PSEUDO_REGISTER
&& REGNO (op) <= LAST_VIRTUAL_REGISTER));
})
;; Test for a valid operand for a call instruction. Don't allow the
;; arg pointer register or virtual regs since they may decay into
;; reg + const, which the patterns can't handle.
;; We only allow SYMBOL_REF if !flag_pic.
(define_predicate "call_insn_operand"
(ior (and (match_test "!flag_pic") (match_code "symbol_ref"))
(match_operand 0 "register_no_elim_operand")))
;; Test for an operator valid in a conditional branch
(define_predicate "bfin_cbranch_operator"
(match_code "eq,ne"))

29
gcc/config/bfin/t-bfin Normal file
View file

@ -0,0 +1,29 @@
## Target part of the Makefile
LIB1ASMSRC = bfin/lib1funcs.asm
LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3
EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
FPBIT = fp-bit.c
DPBIT = dp-bit.c
dp-bit.c: $(srcdir)/config/fp-bit.c
cat $(srcdir)/config/fp-bit.c > dp-bit.c
fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
# This shouldn't be needed here. I added it to the specs file for now, until
# it is fixed in binutils (if it is necessary).
GCC_CFLAGS += -N
# Assemble startup files.
$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s
$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s

View file

@ -0,0 +1,29 @@
## Target part of the Makefile
LIB1ASMSRC = bfin/lib1funcs.asm
LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3
EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
FPBIT = fp-bit.c
DPBIT = dp-bit.c
dp-bit.c: $(srcdir)/config/fp-bit.c
cat $(srcdir)/config/fp-bit.c > dp-bit.c
fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
# This shouldn't be needed here. I added it to the specs file for now, until
# it is fixed in binutils (if it is necessary).
GCC_CFLAGS += -N
# Assemble startup files.
$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s
$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s

View file

@ -1724,6 +1724,13 @@ on data in the eight bit data area. Note the eight bit data area is limited to
You must use GAS and GLD from GNU binutils version 2.7 or later for
this attribute to work correctly.
@item exception_handler
@cindex exception handler functions on the Blackfin processor
Use this attribute on the Blackfin to indicate that the specified function
is an exception handler. The compiler will generate function entry and
exit sequences suitable for use in an exception handler when this
attribute is present.
@item far
@cindex functions which handle memory bank switching
On 68HC11 and 68HC12 the @code{far} attribute causes the compiler to
@ -1872,8 +1879,8 @@ that the specified function is an interrupt handler. The compiler will
generate function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present.
Note, interrupt handlers for the m68k, H8/300, H8/300H, H8S, and SH processors
can be specified via the @code{interrupt_handler} attribute.
Note, interrupt handlers for the Blackfin, m68k, H8/300, H8/300H, H8S, and
SH processors can be specified via the @code{interrupt_handler} attribute.
Note, on the AVR, interrupts will be enabled inside the function.
@ -1887,11 +1894,17 @@ void f () __attribute__ ((interrupt ("IRQ")));
Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT and UNDEF@.
@item interrupt_handler
@cindex interrupt handler functions on the m68k, H8/300 and SH processors
Use this attribute on the m68k, H8/300, H8/300H, H8S, and SH to indicate that
the specified function is an interrupt handler. The compiler will generate
function entry and exit sequences suitable for use in an interrupt
handler when this attribute is present.
@cindex interrupt handler functions on the Blackfin, m68k, H8/300 and SH processors
Use this attribute on the Blackfin, m68k, H8/300, H8/300H, H8S, and SH to
indicate that the specified function is an interrupt handler. The compiler
will generate function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present.
@item kspisusp
@cindex User stack pointer in interrupts on the Blackfin
When used together with @code{interrupt_handler}, @code{exception_handler}
or @code{nmi_handler}, code will be generated to load the stack pointer
from the USP register in the function prologue.
@item long_call/short_call
@cindex indirect calls on ARM
@ -1971,6 +1984,19 @@ use the normal calling convention based on @code{jsr} and @code{rts}.
This attribute can be used to cancel the effect of the @option{-mlong-calls}
option.
@item nesting
@cindex Allow nesting in an interrupt handler on the Blackfin processor.
Use this attribute together with @code{interrupt_handler},
@code{exception_handler} or @code{nmi_handler} to indicate that the function
entry code should enable nested interrupts or exceptions.
@item nmi_handler
@cindex NMI handler functions on the Blackfin processor
Use this attribute on the Blackfin to indicate that the specified function
is an NMI handler. The compiler will generate function entry and
exit sequences suitable for use in an NMI handler when this
attribute is present.
@item no_instrument_function
@cindex @code{no_instrument_function} function attribute
@opindex finstrument-functions
@ -2125,8 +2151,8 @@ The @code{longjmp}-like counterpart of such function, if any, might need
to be marked with the @code{noreturn} attribute.
@item saveall
@cindex save all registers on the H8/300, H8/300H, and H8S
Use this attribute on the H8/300, H8/300H, and H8S to indicate that
@cindex save all registers on the Blackfin, H8/300, H8/300H, and H8S
Use this attribute on the Blackfin, H8/300, H8/300H, and H8S to indicate that
all registers except the stack pointer should be saved in the prologue
regardless of whether they are used or not.

View file

@ -2176,6 +2176,8 @@ GNU Compiler Collection on your machine.
@item
@uref{#avr,,avr}
@item
@uref{#bfin,,Blackfin}
@item
@uref{#c4x,,c4x}
@item
@uref{#dos,,DOS}
@ -2487,6 +2489,23 @@ The following error:
indicates that you should upgrade to a newer version of the binutils.
@html
<hr />
@end html
@heading @anchor{bfin}Blackfin
The Blackfin processor, an Analog Devices DSP.
@ifnothtml
@xref{Blackfin Options,, Blackfin Options, gcc, Using and Porting the GNU
Compiler Collection (GCC)},
@end ifnothtml
@ifhtml
See ``Blackfin Options'' in the main manual
@end ifhtml
More information, and a version of binutils with support for this processor,
is available at @uref{http://blackfin.uclinux.org}
@html
<hr />
@end html

View file

@ -401,6 +401,11 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol
-mcall-prologues -mno-tablejump -mtiny-stack -mint8}
@emph{Blackfin Options}
@gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer -mcsync @gol
-mno-csync -mlow-64k -mno-low64k -mid-shared-library @gol
-mno-id-shared-library -mshared-library-id=@var{n} @gol}
@emph{CRIS Options}
@gccoptlist{-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol
-mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol
@ -6730,6 +6735,7 @@ that macro, which enables you to change the defaults.
* ARC Options::
* ARM Options::
* AVR Options::
* Blackfin Options::
* CRIS Options::
* Darwin Options::
* DEC Alpha Options::
@ -7181,6 +7187,57 @@ comply to the C standards, but it will provide you with smaller code
size.
@end table
@node Blackfin Options
@subsection Blackfin Options
@cindex Blackfin Options
@table @gcctabopt
@item -momit-leaf-frame-pointer
@opindex momit-leaf-frame-pointer
Don't keep the frame pointer in a register for leaf functions. This
avoids the instructions to save, set up and restore frame pointers and
makes an extra register available in leaf functions. The option
@option{-fomit-frame-pointer} removes the frame pointer for all functions
which might make debugging harder.
@item -mcsync
@opindex mcsync
When enabled, the compiler will ensure that the generated code does not
contain speculative loads after jump instructions. This option is enabled
by default.
@item -mno-csync
@opindex mno-csync
Don't generate extra code to prevent speculative loads from occurring.
@item -mlow-64k
@opindex
When enabled, the compiler is free to take advantage of the knowledge that
the entire program fits into the low 64k of memory.
@item -mno-low-64k
@opindex mno-low-64k
Assume that the program is arbitrarily large. This is the default.
@item -mid-shared-library
@opindex mid-shared-library
Generate code that supports shared libraries via the library ID method.
This allows for execute in place and shared libraries in an environment
without virtual memory management. This option implies @option{-fPIC}.
@item -mno-id-shared-library
@opindex mno-id-shared-library
Generate code that doesn't assume ID based shared libraries are being used.
This is the default.
@item -mshared-library-id=n
@opindex mshared-library-id
Specified the identification number of the ID based shared library being
compiled. Specifying a value of 0 will generate more compact code, specifying
other values will force the allocation of that number to the current
library but is no more space or time efficient than omitting this option.
@end table
@node CRIS Options
@subsection CRIS Options
@cindex CRIS Options

View file

@ -2069,6 +2069,102 @@ range of 1 to 2047.
@end table
@item Blackfin family---@file{bfin.h}
@table @code
@item a
P register
@item d
D register
@item z
A call clobbered P register.
@item D
Even-numbered D register
@item W
Odd-numbered D register
@item e
Accumulator register.
@item A
Even-numbered accumulator register.
@item B
Odd-numbered accumulator register.
@item b
I register
@item B
B register
@item f
M register
@item c
Registers used for circular buffering, i.e. I, B, or L registers.
@item C
The CC register.
@item x
Any D, P, B, M, I or L register.
@item y
Additional registers typically used only in prologues and epilogues: RETS,
RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and USP.
@item w
Any register except accumulators or CC.
@item Ksh
Signed 16 bit integer (in the range -32768 to 32767)
@item Kuh
Unsigned 16 bit integer (in the range 0 to 65535)
@item Ks7
Signed 7 bit integer (in the range -64 to 63)
@item Ku7
Unsigned 7 bit integer (in the range 0 to 127)
@item Ku5
Unsigned 5 bit integer (in the range 0 to 31)
@item Ks4
Signed 4 bit integer (in the range -8 to 7)
@item Ks3
Signed 3 bit integer (in the range -3 to 4)
@item Ku3
Unsigned 3 bit integer (in the range 0 to 7)
@item P@var{n}
Constant @var{n}, where @var{n} is a single-digit constant in the range 0 to 4.
@item M1
Constant 255.
@item M2
Constant 65535.
@item J
An integer constant with exactly a single bit set.
@item L
An integer constant with all bits set except exactly one.
@item H
@item Q
Any SYMBOL_REF.
@end table
@item IP2K---@file{ip2k.h}
@table @code
@item a