Commit 385c9217 by Stephane Carrez Committed by Stephane Carrez

m68hc11.md: New file, machine description for 68HC11 & 68HC12.

	* config/m68hc11/m68hc11.md: New file, machine description for
	68HC11 & 68HC12.
	* config/m68hc11/m68hc11.h: New file, definitions for 68HC11 & 68HC12.
	* config/m68hc11/m68hc11.c: New file, functions for 68HC11 & 68HC12.
	* config/m68hc11/m68hc12.h: New file, definitions for 68HC12.
	* config/m68hc11/m68hc11-protos.h: New file.
	* config/m68hc11/m68hc11-crt0.S: New file, startup code.
	* config/m68hc11/t-m68hc11-gas: New file, makefile fragment.
	* config/m68hc11/xm-m68hc11.h: New file, target defs.
	* config/m68hc11/larith.asm: New file, libgcc routines.

From-SVN: r36276
parent e0b7ed05
2000-09-08 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.md: New file, machine description for
68HC11 & 68HC12.
* config/m68hc11/m68hc11.h: New file, definitions for 68HC11 & 68HC12.
* config/m68hc11/m68hc11.c: New file, functions for 68HC11 & 68HC12.
* config/m68hc11/m68hc12.h: New file, definitions for 68HC12.
* config/m68hc11/m68hc11-protos.h: New file.
* config/m68hc11/m68hc11-crt0.S: New file, startup code.
* config/m68hc11/t-m68hc11-gas: New file, makefile fragment.
* config/m68hc11/xm-m68hc11.h: New file, target defs.
* config/m68hc11/larith.asm: New file, libgcc routines.
2000-09-08 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* Makefile.in (DPBIT_FUNCS): Add _usi_to_df.
(FPBIT_FUNCS): Add _usi_to_sf.
* config/fp-bit.c (usi_to_float): New function.
......
/* Startup code for M68HC11.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
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 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file with other programs, and to distribute
those programs without any restriction coming from the use of this
file. (The General Public License restrictions do apply in other
respects; for example, they cover modification of the file, and
distribution when not linked into another program.)
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.
You should have received a copy of the GNU General Public License
along with this program; 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 other files,
some of which are compiled with GCC, to produce an executable,
this library does not by itself 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. */
;-----------------------------------------
; startup code
;-----------------------------------------
.file "crt0.s"
;;
;;
;; The linker concatenate the .install* sections in the following order:
;;
;; .install0 Setup the stack pointer
;; .install1 Place holder for applications
;; .install2 Optional installation of data section in memory
;; .install3 Place holder for applications
;; .install4 Invokes the main
;;
.sect .install0,"ax",@progbits
.globl _start
_start:
;;
;; At this step, the stack is not initialized and interrupts are masked.
;; Applications only have 64 cycles to initialize some registers.
;;
;; To have a generic/configurable startup, initialize the stack to
;; the end of some memory region. The _stack symbol is defined by
;; the linker.
;;
lds #_stack
.sect .install2,"ax",@progbits
;;
;; Call a specific initialization operation. The default is empty.
;; It can be overriden by applications. It is intended to initialize
;; the 68hc11 registers. Function prototype is:
;;
;; int __premain(void);
;;
jsr __premain
;;
;;
;;
.sect .install4,"ax",@progbits
jsr main
fatal:
jsr exit
bra fatal
;-----------------------------------------
; end startup code
;-----------------------------------------
;; Force loading of data section mapping and bss clear
.2byte __map_data_section
.2byte __init_bss_section
/* Prototypes for exported functions defined in m68hc11.c
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@worldnet.fr)
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. */
extern int m68hc11_override_options PARAMS((void));
extern void m68hc11_conditional_register_usage PARAMS((void));
extern int hard_regno_mode_ok PARAMS((int, enum machine_mode));
extern int m68hc11_total_frame_size PARAMS((void));
extern int m68hc11_initial_frame_pointer_offset PARAMS((void));
extern int m68hc11_initial_elimination_offset PARAMS((int, int));
extern void expand_prologue PARAMS((void));
extern void expand_epilogue PARAMS((void));
extern void output_function_prologue PARAMS((FILE*, int));
extern void output_function_epilogue PARAMS((FILE*, int));
extern int m68hc11_function_block_profiler PARAMS((FILE*,int));
extern int m68hc11_block_profiler PARAMS((FILE*,int));
extern void m68hc11_asm_file_start PARAMS((FILE*, char*));
#ifdef TREE_CODE
extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*,
enum machine_mode,
tree,
int));
extern int m68hc11_valid_decl_attribute_p PARAMS((tree, tree,
tree, tree));
extern int m68hc11_valid_type_attribute_p PARAMS((tree, tree,
tree, tree));
extern int m68hc11_comp_type_attributes PARAMS((tree, tree));
extern void m68hc11_set_default_type_attributes PARAMS((tree));
extern void m68hc11_encode_section_info PARAMS((tree));
#endif
#ifdef RTX_CODE
#if GCC_VERSION > 2095
extern rtx m68hc11_compare_op0;
extern rtx m68hc11_compare_op1;
#endif
extern rtx m68hc11_soft_tmp_reg;
extern rtx iy_reg;
extern rtx d_reg;
extern rtx m68hc11_expand_compare_and_branch PARAMS((enum rtx_code,
rtx, rtx, rtx));
extern enum reg_class preferred_reload_class PARAMS((rtx, enum reg_class));
extern int m68hc11_go_if_legitimate_address PARAMS((rtx,
enum machine_mode,
int));
extern int m68hc11_legitimize_address PARAMS((rtx*, rtx, enum machine_mode));
extern void m68hc11_notice_update_cc PARAMS((rtx, rtx));
extern void m68hc11_reorg PARAMS((rtx));
extern void m68hc11_gen_movqi PARAMS((rtx, rtx*));
extern void m68hc11_gen_movhi PARAMS((rtx, rtx*));
extern void m68hc11_gen_rotate PARAMS((enum rtx_code, rtx, rtx*));
extern void m68hc11_output_swap PARAMS((rtx,rtx*));
extern int next_insn_test_reg PARAMS((rtx,rtx));
extern void print_operand PARAMS((FILE*,rtx,int));
extern void print_operand_address PARAMS((FILE*,rtx));
extern int m68hc11_reload_operands PARAMS((rtx*));
extern int dead_register_here PARAMS((rtx, rtx));
extern int push_pop_operand_p PARAMS((rtx));
extern void m68hc11_split_move PARAMS((rtx, rtx, rtx));
extern void m68hc11_split_compare_and_branch PARAMS((enum rtx_code,
rtx, rtx, rtx));
extern void aux_restore_IX_IY PARAMS((rtx));
extern void aux_validate_IX_IY PARAMS((rtx));
extern rtx m68hc11_gen_lowpart PARAMS((enum machine_mode, rtx));
extern rtx m68hc11_gen_highpart PARAMS((enum machine_mode, rtx));
#ifdef HAVE_MACHINE_MODES
extern int m68hc11_memory_move_cost PARAMS((enum machine_mode, enum reg_class,
int));
extern int m68hc11_register_move_cost PARAMS((enum reg_class, enum reg_class));
extern int m68hc11_rtx_costs PARAMS((rtx, enum rtx_code, enum rtx_code));
extern int m68hc11_address_cost PARAMS((rtx));
extern void m68hc11_emit_libcall PARAMS((const char*, enum rtx_code,
enum machine_mode, enum machine_mode,
int, rtx*));
extern int m68hc11_small_indexed_indirect_p PARAMS((rtx, enum machine_mode));
extern int go_if_legitimate_address2 PARAMS((rtx, enum machine_mode, int));
extern int reg_or_indexed_operand PARAMS((rtx,enum machine_mode));
extern int tst_operand PARAMS((rtx,enum machine_mode));
extern int cmp_operand PARAMS((rtx,enum machine_mode));
extern int memory_indexed_operand PARAMS((rtx, enum machine_mode));
extern void m68hc11_split_logical PARAMS((enum machine_mode, int, rtx*));
extern int m68hc11_register_indirect_p PARAMS((rtx, enum machine_mode));
extern int symbolic_memory_operand PARAMS((rtx, enum machine_mode));
extern int memory_reload_operand PARAMS((rtx, enum machine_mode));
extern int stack_register_operand PARAMS((rtx, enum machine_mode));
extern int d_register_operand PARAMS((rtx, enum machine_mode));
extern int hard_addr_reg_operand PARAMS((rtx, enum machine_mode));
extern int arith_src_operand PARAMS((rtx, enum machine_mode));
extern int m68hc11_logical_operator PARAMS((rtx, enum machine_mode));
extern int m68hc11_arith_operator PARAMS((rtx, enum machine_mode));
extern int m68hc11_non_shift_operator PARAMS((rtx, enum machine_mode));
extern int m68hc11_unary_operator PARAMS((rtx, enum machine_mode));
extern int non_push_operand PARAMS((rtx, enum machine_mode));
extern int hard_reg_operand PARAMS((rtx, enum machine_mode));
extern int soft_reg_operand PARAMS((rtx, enum machine_mode));
extern int reg_or_some_mem_operand PARAMS((rtx, enum machine_mode));
extern enum reg_class limit_reload_class PARAMS((enum machine_mode, enum reg_class));
#if defined TREE_CODE
extern void m68hc11_init_cumulative_args PARAMS((CUMULATIVE_ARGS*,
tree,
rtx));
extern rtx m68hc11_function_arg PARAMS((const CUMULATIVE_ARGS* ,
enum machine_mode,
tree, int));
extern int m68hc11_function_arg_pass_by_reference PARAMS((const CUMULATIVE_ARGS*,
enum machine_mode,
tree,
int));
extern int m68hc11_function_arg_padding PARAMS((enum machine_mode, tree));
extern void m68hc11_expand_builtin_va_start PARAMS((int, tree, rtx));
extern rtx m68hc11_va_arg PARAMS((tree,tree));
extern void m68hc11_expand_builtin_va_start PARAMS((int,tree,rtx));
extern void m68hc11_function_epilogue PARAMS((FILE*,int));
#endif /* TREE_CODE */
#if GCC_VERSION > 2095
extern HOST_WIDE_INT m68hc11_min_offset;
extern HOST_WIDE_INT m68hc11_max_offset;
#endif
#endif /* HAVE_MACHINE_MODES */
#endif /* RTX_CODE */
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/* Definitions of target machine for GNU compiler, for m68hc12.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@worldnet.fr).
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. */
/* Compile and assemble for a 68hc12 unless there is a -m68hc11 option. */
#define ASM_SPEC "%{m68hc11:-m68hc11}%{!m68hc11:-m68hc12}"
#define LIB_SPEC ""
#define CC1_SPEC ""
/* We need to tell the linker the target elf format. Just pass an
emulation option. This can be overriden by -Wl option of gcc. */
#define LINK_SPEC "%{m68hc11:-m m68hc11elf}%{!m68hc11:-m m68hc12elf}"
#define CPP_SPEC \
"%{mshort:-D__HAVE_SHORT_INT__ -D__INT__=16 -D__INT_MAX__=32767}\
%{!mshort:-D__INT__=32 -D__INT_MAX__=2147483647}\
%{m68hc11:-Dmc6811 -DMC6811 -Dmc68hc11}\
%{!m68hc11:-Dmc6812 -DMC6812 -Dmc68hc12}"
/* Default target_flags if no switches specified. */
#define TARGET_DEFAULT (MASK_M6812)
#define TARGET_M68HC12
#include "m68hc11/m68hc11.h"
RANLIB_FOR_TARGET = ` \
if [ -f $(objdir)/../binutils/ranlib ] ; then \
echo $(objdir)/../binutils/ranlib ; \
else \
if [ "$(host_canonical)" = "$(target)" ] ; then \
echo ranlib; \
else \
if [ -f $(bindir)/$(target_alias)-ranlib ] ; then \
echo $(bindir)/$(target_alias)-ranlib ; \
else \
t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \
fi; \
fi; \
fi`
T_CPPFLAGS = -DUSE_GAS
CROSS_LIBGCC1 = libgcc1-asm.a
LIB1ASMSRC = m68hc11/larith.asm
LIB1ASMFUNCS = _mulsi3 \
_mulqi3 _ashlsi3 _ashrsi3 _lshrsi3 \
_divmodhi4 _mulhi3 _mulhi32 \
_memcpy _memset _negsi2 _one_cmplsi2 \
_regs_min _regs_d1_8 _regs_d8_16 _regs_d17_32 \
_premain __exit _abort _cleanup \
_adddi3 _subdi3 _notdi2 \
_ashrhi3 _lshrhi3 _lshlhi3 _ashrqi3 _lshlqi3 _map_data _init_bss
TARGET_LIBGCC2_CFLAGS = -DUSE_GAS -DIN_GCC
# 32-bit div/mod from the mn10200 port. Prototypes have been added
# to avoid problems in passing 16/32-bit int (last param of udivmodsi4).
LIB2FUNCS_EXTRA = $(srcdir)/config/m68hc11/udivmodsi4.c \
$(srcdir)/config/m68hc11/divmod.c $(srcdir)/config/m68hc11/udivmod.c
# Don't compile with -g1 this reduces the size of some sections (.eh_frame).
LIBGCC2_DEBUG_CFLAGS =
LIBGCC2_CFLAGS = -Os $(LIBGCC2_INCLUDES) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2
MULTILIB_OPTIONS = m68hc11/m68hc12 mshort fshort-double
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68hc11=m6811 m68hc12=m6812
MULTILIB_EXCEPTIONS = -mnoshort -mno68hc11
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
FPBIT = fp-bit.c
DPBIT = dp-bit.c
dp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define SMALL_MACHINE' >> dp-bit.c
echo '#define CMPtype HItype' >> dp-bit.c
echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
echo '#endif' >> dp-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
echo '#define CMPtype HItype' >> fp-bit.c
echo '#define SMALL_MACHINE' >> fp-bit.c
echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
echo '#endif' >> fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
CRT0_S = $(srcdir)/config/m68hc11/m68hc11-crt0.S
MCRT0_S= $(srcdir)/config/m68hc11/m68hc11-crt0.S
CRT0STUFF_T_CFLAGS =
# Assemble startup files.
$(T)crt1.o: $(CRT0_S) $(GCC_PASSES)
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o -x assembler-with-cpp $(CRT0_S)
EXTRA_MULTILIB_PARTS = crt1.o
/* Configuration for GNU C-compiler for Motorola 68HC11 and 68HC12.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@worldnet.fr)
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. */
#include "tm.h"
#define inhibit_libc
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