i * libgcc1-test.c, libgcc1.c, config/i386/perform.h: Delete file.
* testsuite/gcc.dg/complete-port.c: New (revised version of
libgcc1-test.c)
* po/POTFILES.in: Remove libgcc1-test.c and libgcc1.c.
* Makefile.in: Delete variables: OLDCC, CCLIBFLAGS, OLDAR,
OLDAR_FLAGS, LIBGCC1, LIBGCC1_TEST, CROSS_LIBGCC1,
LIB1FUNCS, and LIB1FUNCS_EXTRA. Delete rules: libgcc1-test,
libgcc1-test.o. Clarify commentary now that libgcc1 no longer exists.
* cross-make: Don't set LIBGCC1.
* mklibgcc.in: Delete all code for building from libgcc1.c.
Always honor LIB1ASMFUNCS if set.
* crtstuff.c, floatlib.c, longlong.h, config/fp-bit.c,
config/arc/lib1funcs.asm, config/arm/lib1funcs.asm,
config/d30v/libgcc1.asm, config/fr30/lib1funcs.asm,
config/h8300/lib1funcs.asm, config/i386/cygwin.asm,
config/i386/uwin.asm, config/m68hc11/larith.asm,
config/m68k/lb1sf68.asm, config/mcore/lib1.asm,
config/mn10200/lib1funcs.asm, config/sh/lib1funcs.asm,
config/sparc/lb1spc.asm, config/sparc/lb1spl.asm,
config/v850/lib1funcs.asm, config/c4x/libgcc.S:
Delete or update references to libgcc1 in commentary.
* config/t-libc-ok, config/t-linux, config/t-linux-aout,
config/t-netbsd, config/a29k/t-a29kbare, config/a29k/t-vx29k,
config/alpha/t-interix, config/alpha/t-osf, config/alpha/t-vms,
config/arc/t-arc, config/arm/t-arm-aout, config/arm/t-arm-coff,
config/arm/t-arm-elf, config/arm/t-linux, config/arm/t-pe,
config/arm/t-semi, config/arm/t-strongarm-coff,
config/arm/t-strongarm-elf, config/arm/t-strongarm-pe,
config/arm/t-xscale-coff, config/arm/t-xscale-elf, config/avr/t-avr,
config/c4x/t-c4x, config/d30v/t-d30v, config/fr30/t-fr30,
config/h8300/t-h8300, config/i386/t-beos, config/i386/t-cygwin,
config/i386/t-i386elf, config/i386/t-interix, config/i386/t-netware,
config/i386/t-next, config/i386/t-rtems-i386, config/i386/t-sol2,
config/i960/t-960bare, config/i960/t-vxworks960, config/ia64/t-ia64,
config/m32r/t-m32r, config/m68hc11/t-m68hc11-gas, config/m68k/t-lynx,
config/m68k/t-m68kbare, config/m68k/t-m68kelf,
config/m68k/t-mot3300-gald, config/m68k/t-mot3300-gas,
config/m68k/t-next, config/m68k/t-vxworks68, config/m88k/t-bug,
config/m88k/t-dgux, config/m88k/t-dgux-gas, config/m88k/t-dguxbcs,
config/m88k/t-luna, config/m88k/t-luna-gas, config/m88k/t-m88k,
config/m88k/t-m88k-gas, config/m88k/t-sysv4, config/mcore/t-mcore,
config/mcore/t-mcore-pe, config/mips/t-bsd, config/mips/t-bsd-gas,
config/mips/t-cross64, config/mips/t-ecoff, config/mips/t-elf,
config/mips/t-iris6, config/mips/t-r3900, config/mips/t-svr3,
config/mips/t-svr3-gas, config/mips/t-svr4, config/mips/t-svr4-gas,
config/mips/t-ultrix, config/mn10200/t-mn10200,
config/mn10300/t-mn10300, config/pa/t-linux, config/pa/t-linux64,
config/pa/t-pa, config/pa/t-pa64, config/pa/t-pro,
config/pdp11/t-pdp11, config/pj/t-pj, config/rs6000/t-aix43,
config/rs6000/t-beos, config/rs6000/t-darwin, config/rs6000/t-newas,
config/rs6000/t-ppccomm, config/rs6000/t-rs6000, config/sh/t-linux,
config/sh/t-sh, config/sparc/t-chorus-elf, config/sparc/t-elf,
config/sparc/t-sol2, config/sparc/t-sp86x, config/sparc/t-sparcbare,
config/sparc/t-sparclite, config/sparc/t-splet,
config/sparc/t-sunos41, config/sparc/t-vxsparc,
config/sparc/t-vxsparc64, config/v850/t-v850:
Don't set any of LIBGCC1, CROSS_LIBGCC1, or LIBGCC1_TEST.
* config/alpha/alpha.h, config/i386/i386.h, config/i860/i860.h:
Don't set FLOAT_VALUE_TYPE, FLOAT_ARG_TYPE, INTIFY, or FLOATIFY.
* config/d30v/d30v.h: Don't mention LIBGCC_NEEDS_DOUBLE,
FLOAT_VALUE_TYPE, FLOAT_ARG_TYPE, FLOATIFY, INTIFY,
nongcc_SI_type, nongcc_word_type, or perform_*
* config/i860/fx2800: Don't define perform_umodsi3 or perform_modsi3.
* config/i386/386bsd.h, config/i386/beos-elf.h,
config/i386/linux-aout.h, config/i386/linux-oldld.h,
config/i386/linux.h, config/i386/mach.h, config/i386/netbsd.h,
config/i386/openbsd.h, config/i386/osfrose.h, config/i386/rtemself.h:
Don't include i386/perform.h.
* config/a29k/t-a29k, config/arm/t-semiaof, config/i370/t-i370,
config/i370/t-linux, config/i370/t-mvs, config/i370/t-oe,
config/i386/t-djgpp, config/i386/t-i386bare, config/i386/t-vsta,
config/ia64/t-hpux, config/mips/t-mips, config/mips/t-mips-gas,
config/mips/t-osfrose, config/sparc/t-sp64, config/sparc/t-sunos40,
config/vax/t-openbsd, config/vax/t-vax: Delete.
* config.gcc: Remove references to deleted files.
(arm-semi-aof): Use arm/t-semi for tmake_file.
* gcc.texi, install.texi, invoke.texi, tm.texi:
Delete or rewrite text which is no longer relevant now that
libgcc1 no longer exists.
* config/t-openbsd, config/alpha/t-interix, config/i386/t-interix:
No need to set INSTALL_ASSERT_H. (Missed in previous sweep.)
From-SVN: r42188
2001-05-17 05:16:18 +02:00
|
|
|
@ libgcc routines for ARM cpu.
|
1996-01-19 11:11:00 +01:00
|
|
|
@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2015-01-05 13:33:28 +01:00
|
|
|
/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
|
1995-05-12 18:30:52 +02:00
|
|
|
|
|
|
|
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
|
2009-04-09 17:00:19 +02:00
|
|
|
Free Software Foundation; either version 3, or (at your option) any
|
1995-05-12 18:30:52 +02:00
|
|
|
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.
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
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/>. */
|
2006-11-03 01:59:32 +01:00
|
|
|
|
|
|
|
/* An executable stack is *not* required for these functions. */
|
|
|
|
#if defined(__ELF__) && defined(__linux__)
|
|
|
|
.section .note.GNU-stack,"",%progbits
|
|
|
|
.previous
|
2009-06-21 22:48:15 +02:00
|
|
|
#endif /* __ELF__ and __linux__ */
|
|
|
|
|
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
/* Some attributes that are common to all routines in this file. */
|
2010-04-17 17:34:25 +02:00
|
|
|
/* Tag_ABI_align_needed: This code does not require 8-byte
|
2009-06-21 22:48:15 +02:00
|
|
|
alignment from the caller. */
|
|
|
|
/* .eabi_attribute 24, 0 -- default setting. */
|
2010-04-17 17:34:25 +02:00
|
|
|
/* Tag_ABI_align_preserved: This code preserves 8-byte
|
2009-06-21 22:48:15 +02:00
|
|
|
alignment in any callee. */
|
|
|
|
.eabi_attribute 25, 1
|
|
|
|
#endif /* __ARM_EABI__ */
|
2000-08-11 02:30:55 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
2000-08-22 21:50:12 +02:00
|
|
|
|
|
|
|
/* We need to know what prefix to add to function names. */
|
|
|
|
|
1998-10-27 16:15:11 +01:00
|
|
|
#ifndef __USER_LABEL_PREFIX__
|
|
|
|
#error __USER_LABEL_PREFIX__ not defined
|
|
|
|
#endif
|
|
|
|
|
1998-12-23 15:34:18 +01:00
|
|
|
/* ANSI concatenation macros. */
|
|
|
|
|
|
|
|
#define CONCAT1(a, b) CONCAT2(a, b)
|
|
|
|
#define CONCAT2(a, b) a ## b
|
|
|
|
|
|
|
|
/* Use the right prefix for global labels. */
|
|
|
|
|
|
|
|
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
|
|
|
|
|
1999-04-07 15:53:22 +02:00
|
|
|
#ifdef __ELF__
|
2000-04-08 16:29:53 +02:00
|
|
|
#ifdef __thumb__
|
2000-08-11 02:30:55 +02:00
|
|
|
#define __PLT__ /* Not supported in Thumb assembler (for now). */
|
config.gcc (arm-wrs-vxworks): Remove dbxelf.h from tm_file.
gcc/
* config.gcc (arm-wrs-vxworks): Remove dbxelf.h from tm_file.
Add vx-common.h. Include vxworks.h between vx-common.h and
arm/vxworks.h.
* config/vx-common.h (DWARF2_UNWIND_INFO): Undefine before
redefining.
* config/vxworks.h (TARGET_ASM_CONSTRUCTOR): Likewise.
(TARGET_ASM_DESTRUCTOR): Likewise.
* config/arm/vxworks.h (TARGET_OS_CPP_BUILTINS): Check arm_arch_xscale
instead of arm_is_xscale. Use VXWORKS_OS_CPP_BUILTINS.
(OVERRIDE_OPTIONS, SUBTARGET_CPP_SPEC): Define.
(CC1_SPEC): Add -tstrongarm. Line up backslashes.
(VXWORKS_ENDIAN_SPEC): Define.
(ASM_SPEC): Add VXWORKS_ENDIAN_SPEC.
(LIB_SPEC, STARTFILE_SPEC, ENDFILE_SPEC): Redefine to their
VXWORKS_* equivalents.
(LINK_SPEC): Likewise, but add VXWORKS_ENDIAN_SPEC.
(ASM_FILE_START): Delete.
(TARGET_VERSION): Reformat.
(FPUTYPE_DEFAULT, FUNCTION_PROFILER): Define.
(DEFAULT_STRUCTURE_SIZE_BOUNDARY): Define.
* config/arm/t-vxworks (LIB1ASMSRC, LIB1ASMFUNCS): Define.
(FPBIT, DPBIT): Define.
(fp-bit.c, dp-bit.c): New rules.
(MULTILIB_OPTIONS): Add strongarm, -mrtp and -mrtp/-fPIC multilibs.
(MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Define.
* config/arm/arm-protos.h (arm_emit_call_insn): Declare.
* config/arm/arm.h: Include vxworks-dummy.h.
* config/arm/arm.c (arm_elf_asm_constructor, arm_elf_asm_destructor):
Mark with ATTRIBUTE_UNUSED.
(arm_override_options): Do not allow VxWorks RTP PIC to be used
for Thumb. Force r9 to be the PIC register for VxWorks RTPs and
make it incompatible with -msingle-pic-base.
(arm_function_ok_for_sibcall): Return false for calls that might
go through a VxWorks PIC PLT entry.
(require_pic_register): New function, split out from...
(legitimize_pic_address): ...here. Do not use GOTOFF accesses
for VxWorks RTPs.
(arm_load_pic_register): Handle the VxWorks RTP initialization
sequence. Use pic_reg as a shorthand for cfun->machine->pic_reg.
(arm_emit_call_insn): New function.
(arm_assemble_integer): Do not use GOTOFF accesses for VxWorks RTP.
* config/arm/arm.md (UNSPEC_PIC_OFFSET): New unspec number.
(pic_offset_arm): New pattern.
(call, call_value): Use arm_emit_call_insn.
(call_internal, call_value_internal): New expanders.
* config/arm/lib1funcs.asm (__PLT__): Define to empty for
VxWorks unless __PIC__.
From-SVN: r125196
2007-05-30 21:04:09 +02:00
|
|
|
#elif defined __vxworks && !defined __PIC__
|
|
|
|
#define __PLT__ /* Not supported by the kernel loader. */
|
2000-04-08 16:29:53 +02:00
|
|
|
#else
|
1998-10-27 12:13:39 +01:00
|
|
|
#define __PLT__ (PLT)
|
2000-04-08 16:29:53 +02:00
|
|
|
#endif
|
1998-10-27 12:13:39 +01:00
|
|
|
#define TYPE(x) .type SYM(x),function
|
|
|
|
#define SIZE(x) .size SYM(x), . - SYM(x)
|
2003-05-12 15:14:32 +02:00
|
|
|
#define LSYM(x) .x
|
1998-10-27 12:13:39 +01:00
|
|
|
#else
|
|
|
|
#define __PLT__
|
|
|
|
#define TYPE(x)
|
|
|
|
#define SIZE(x)
|
2003-05-12 15:14:32 +02:00
|
|
|
#define LSYM(x) x
|
1998-10-27 12:13:39 +01:00
|
|
|
#endif
|
|
|
|
|
arm.h (TARGET_APCS_32): Delete.
* arm.h (TARGET_APCS_32): Delete.
(TARGET_MMU_TRAPS): Delete.
(TARGET_CPU_CPP_BUILTINS): Unconditionally define __APCS_32__. Never
define __APCS_26__.
(CPP_SPEC): Remove checking of -mapcs-{26,32}.
(ARM_FLAG_APCS_32, ARM_FLAG_MMU_TRAPS): Delete.
(TARGET_SWITCHES): Remove alignment_traps and apcs-{26,32} switches.
(prog_mode_type): Delete.
(PROMOTE_MODE): Always promote unsigned for HImode.
(SECONDARY_INPUT_RELOAD_CLASS): Simplify.
(MASK_RETURN_ADDR): Simplify.
* arm.c (arm_prgmode): Delete.
(arm_override_options, arm_gen_rotated_half_load): Simplify.
(print_multi_reg, output_return_instruction): Simplify.
(arm_output_epilogue, arm_final_prescan_insn): Simplify.
(arm_return_addr): Simplify.
* arm.md (prog_mode): Delete.
(conds): Simplify.
(zero_extendhisi2, extendhisi2, movhi, movhi_bytes): Simplify.
(rotated_loadsi, movhi_insn_littleend, movhi_insn_bigend): Delete.
(loadhi_si_bigend, loadhi_preinc, loadhi_shiftpreinc): Delete.
(loadhi_shiftpredec): Delete.
(peephole for post-increment on HImode load): Delete.
* arm/crtn.asm: (FUNC_END): Simplify.
* arm/lib1funcs.asm: Remove APCS-26 return macros.
* arm/aof.h, arm/coff.h arm/elf.h arm/linux-elf.h arm/netbsd-elf.h
* arm/netbsd.h arm/pe.h arm/semi.h arm/semiaof.h arm/unknown-elf.h
* arm/vxworks.h arm/wince-pe.h: Tidy TARGET_DEFAULTS and
MULTILIB_DEFAULTS as required.
* arm/t-arm-elf arm/t-linux arm/t-pe arm/t-semi arm/t-wince-pe
* arm/t-xscale-coff arm/t-xscale-elf arm/uclinux-elf: Tidy MULTILIB
variables as required.
* doc/invoke.texi (ARM Options): Remove obsolete flags.
From-SVN: r81881
2004-05-15 14:41:35 +02:00
|
|
|
/* Function end macros. Variants for interworking. */
|
2000-08-22 21:50:12 +02:00
|
|
|
|
2007-05-20 13:18:27 +02:00
|
|
|
#if defined(__ARM_ARCH_2__)
|
|
|
|
# define __ARM_ARCH__ 2
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_3__)
|
|
|
|
# define __ARM_ARCH__ 3
|
|
|
|
#endif
|
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
#if defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__) \
|
|
|
|
|| defined(__ARM_ARCH_4T__)
|
|
|
|
/* We use __ARM_ARCH__ set to 4 here, but in reality it's any processor with
|
|
|
|
long multiply instructions. That includes v3M. */
|
|
|
|
# define __ARM_ARCH__ 4
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
|
2004-04-28 15:24:30 +02:00
|
|
|
|| defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
|
|
|
|
|| defined(__ARM_ARCH_5TEJ__)
|
2003-08-30 17:55:18 +02:00
|
|
|
# define __ARM_ARCH__ 5
|
|
|
|
#endif
|
|
|
|
|
2004-10-12 17:38:30 +02:00
|
|
|
#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
|
|
|
|
|| defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
|
2008-03-03 15:30:48 +01:00
|
|
|
|| defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
|
|
|
|
|| defined(__ARM_ARCH_6M__)
|
2004-04-28 15:24:30 +02:00
|
|
|
# define __ARM_ARCH__ 6
|
|
|
|
#endif
|
|
|
|
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
|
2010-05-24 15:19:51 +02:00
|
|
|
|| defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
|
|
|
|
|| defined(__ARM_ARCH_7EM__)
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
# define __ARM_ARCH__ 7
|
2012-10-18 12:49:23 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_8A__)
|
|
|
|
# define __ARM_ARCH__ 8
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
#endif
|
|
|
|
|
2005-08-12 15:18:36 +02:00
|
|
|
#ifndef __ARM_ARCH__
|
|
|
|
#error Unable to determine architecture.
|
|
|
|
#endif
|
|
|
|
|
2010-02-18 18:29:58 +01:00
|
|
|
/* There are times when we might prefer Thumb1 code even if ARM code is
|
|
|
|
permitted, for example, the code might be smaller, or there might be
|
|
|
|
interworking problems with switching to ARM state if interworking is
|
|
|
|
disabled. */
|
|
|
|
#if (defined(__thumb__) \
|
|
|
|
&& !defined(__thumb2__) \
|
|
|
|
&& (!defined(__THUMB_INTERWORK__) \
|
|
|
|
|| defined (__OPTIMIZE_SIZE__) \
|
|
|
|
|| defined(__ARM_ARCH_6M__)))
|
|
|
|
# define __prefer_thumb__
|
|
|
|
#endif
|
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
/* How to return from a function call depends on the architecture variant. */
|
|
|
|
|
arm.h (TARGET_APCS_32): Delete.
* arm.h (TARGET_APCS_32): Delete.
(TARGET_MMU_TRAPS): Delete.
(TARGET_CPU_CPP_BUILTINS): Unconditionally define __APCS_32__. Never
define __APCS_26__.
(CPP_SPEC): Remove checking of -mapcs-{26,32}.
(ARM_FLAG_APCS_32, ARM_FLAG_MMU_TRAPS): Delete.
(TARGET_SWITCHES): Remove alignment_traps and apcs-{26,32} switches.
(prog_mode_type): Delete.
(PROMOTE_MODE): Always promote unsigned for HImode.
(SECONDARY_INPUT_RELOAD_CLASS): Simplify.
(MASK_RETURN_ADDR): Simplify.
* arm.c (arm_prgmode): Delete.
(arm_override_options, arm_gen_rotated_half_load): Simplify.
(print_multi_reg, output_return_instruction): Simplify.
(arm_output_epilogue, arm_final_prescan_insn): Simplify.
(arm_return_addr): Simplify.
* arm.md (prog_mode): Delete.
(conds): Simplify.
(zero_extendhisi2, extendhisi2, movhi, movhi_bytes): Simplify.
(rotated_loadsi, movhi_insn_littleend, movhi_insn_bigend): Delete.
(loadhi_si_bigend, loadhi_preinc, loadhi_shiftpreinc): Delete.
(loadhi_shiftpredec): Delete.
(peephole for post-increment on HImode load): Delete.
* arm/crtn.asm: (FUNC_END): Simplify.
* arm/lib1funcs.asm: Remove APCS-26 return macros.
* arm/aof.h, arm/coff.h arm/elf.h arm/linux-elf.h arm/netbsd-elf.h
* arm/netbsd.h arm/pe.h arm/semi.h arm/semiaof.h arm/unknown-elf.h
* arm/vxworks.h arm/wince-pe.h: Tidy TARGET_DEFAULTS and
MULTILIB_DEFAULTS as required.
* arm/t-arm-elf arm/t-linux arm/t-pe arm/t-semi arm/t-wince-pe
* arm/t-xscale-coff arm/t-xscale-elf arm/uclinux-elf: Tidy MULTILIB
variables as required.
* doc/invoke.texi (ARM Options): Remove obsolete flags.
From-SVN: r81881
2004-05-15 14:41:35 +02:00
|
|
|
#if (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__)
|
2003-08-30 17:55:18 +02:00
|
|
|
|
|
|
|
# define RET bx lr
|
|
|
|
# define RETc(x) bx##x lr
|
|
|
|
|
2005-04-30 21:40:53 +02:00
|
|
|
/* Special precautions for interworking on armv4t. */
|
|
|
|
# if (__ARM_ARCH__ == 4)
|
|
|
|
|
|
|
|
/* Always use bx, not ldr pc. */
|
|
|
|
# if (defined(__thumb__) || defined(__THUMB_INTERWORK__))
|
|
|
|
# define __INTERWORKING__
|
|
|
|
# endif /* __THUMB__ || __THUMB_INTERWORK__ */
|
|
|
|
|
|
|
|
/* Include thumb stub before arm mode code. */
|
|
|
|
# if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
|
|
|
|
# define __INTERWORKING_STUBS__
|
|
|
|
# endif /* __thumb__ && !__THUMB_INTERWORK__ */
|
|
|
|
|
|
|
|
#endif /* __ARM_ARCH == 4 */
|
2003-08-30 17:55:18 +02:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
# define RET mov pc, lr
|
|
|
|
# define RETc(x) mov##x pc, lr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2005-05-17 17:12:27 +02:00
|
|
|
.macro cfi_pop advance, reg, cfa_offset
|
|
|
|
#ifdef __ELF__
|
|
|
|
.pushsection .debug_frame
|
|
|
|
.byte 0x4 /* DW_CFA_advance_loc4 */
|
|
|
|
.4byte \advance
|
|
|
|
.byte (0xc0 | \reg) /* DW_CFA_restore */
|
|
|
|
.byte 0xe /* DW_CFA_def_cfa_offset */
|
|
|
|
.uleb128 \cfa_offset
|
|
|
|
.popsection
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
.macro cfi_push advance, reg, offset, cfa_offset
|
|
|
|
#ifdef __ELF__
|
|
|
|
.pushsection .debug_frame
|
|
|
|
.byte 0x4 /* DW_CFA_advance_loc4 */
|
|
|
|
.4byte \advance
|
|
|
|
.byte (0x80 | \reg) /* DW_CFA_offset */
|
|
|
|
.uleb128 (\offset / -4)
|
|
|
|
.byte 0xe /* DW_CFA_def_cfa_offset */
|
|
|
|
.uleb128 \cfa_offset
|
|
|
|
.popsection
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
.macro cfi_start start_label, end_label
|
|
|
|
#ifdef __ELF__
|
|
|
|
.pushsection .debug_frame
|
|
|
|
LSYM(Lstart_frame):
|
|
|
|
.4byte LSYM(Lend_cie) - LSYM(Lstart_cie) @ Length of CIE
|
|
|
|
LSYM(Lstart_cie):
|
|
|
|
.4byte 0xffffffff @ CIE Identifier Tag
|
|
|
|
.byte 0x1 @ CIE Version
|
|
|
|
.ascii "\0" @ CIE Augmentation
|
|
|
|
.uleb128 0x1 @ CIE Code Alignment Factor
|
|
|
|
.sleb128 -4 @ CIE Data Alignment Factor
|
|
|
|
.byte 0xe @ CIE RA Column
|
|
|
|
.byte 0xc @ DW_CFA_def_cfa
|
|
|
|
.uleb128 0xd
|
|
|
|
.uleb128 0x0
|
|
|
|
|
|
|
|
.align 2
|
|
|
|
LSYM(Lend_cie):
|
|
|
|
.4byte LSYM(Lend_fde)-LSYM(Lstart_fde) @ FDE Length
|
|
|
|
LSYM(Lstart_fde):
|
|
|
|
.4byte LSYM(Lstart_frame) @ FDE CIE offset
|
|
|
|
.4byte \start_label @ FDE initial location
|
|
|
|
.4byte \end_label-\start_label @ FDE address range
|
|
|
|
.popsection
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
.macro cfi_end end_label
|
|
|
|
#ifdef __ELF__
|
|
|
|
.pushsection .debug_frame
|
|
|
|
.align 2
|
|
|
|
LSYM(Lend_fde):
|
|
|
|
.popsection
|
|
|
|
\end_label:
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
/* Don't pass dirn, it's there just to get token pasting right. */
|
|
|
|
|
2005-05-17 17:12:27 +02:00
|
|
|
.macro RETLDM regs=, cond=, unwind=, dirn=ia
|
arm.h (TARGET_APCS_32): Delete.
* arm.h (TARGET_APCS_32): Delete.
(TARGET_MMU_TRAPS): Delete.
(TARGET_CPU_CPP_BUILTINS): Unconditionally define __APCS_32__. Never
define __APCS_26__.
(CPP_SPEC): Remove checking of -mapcs-{26,32}.
(ARM_FLAG_APCS_32, ARM_FLAG_MMU_TRAPS): Delete.
(TARGET_SWITCHES): Remove alignment_traps and apcs-{26,32} switches.
(prog_mode_type): Delete.
(PROMOTE_MODE): Always promote unsigned for HImode.
(SECONDARY_INPUT_RELOAD_CLASS): Simplify.
(MASK_RETURN_ADDR): Simplify.
* arm.c (arm_prgmode): Delete.
(arm_override_options, arm_gen_rotated_half_load): Simplify.
(print_multi_reg, output_return_instruction): Simplify.
(arm_output_epilogue, arm_final_prescan_insn): Simplify.
(arm_return_addr): Simplify.
* arm.md (prog_mode): Delete.
(conds): Simplify.
(zero_extendhisi2, extendhisi2, movhi, movhi_bytes): Simplify.
(rotated_loadsi, movhi_insn_littleend, movhi_insn_bigend): Delete.
(loadhi_si_bigend, loadhi_preinc, loadhi_shiftpreinc): Delete.
(loadhi_shiftpredec): Delete.
(peephole for post-increment on HImode load): Delete.
* arm/crtn.asm: (FUNC_END): Simplify.
* arm/lib1funcs.asm: Remove APCS-26 return macros.
* arm/aof.h, arm/coff.h arm/elf.h arm/linux-elf.h arm/netbsd-elf.h
* arm/netbsd.h arm/pe.h arm/semi.h arm/semiaof.h arm/unknown-elf.h
* arm/vxworks.h arm/wince-pe.h: Tidy TARGET_DEFAULTS and
MULTILIB_DEFAULTS as required.
* arm/t-arm-elf arm/t-linux arm/t-pe arm/t-semi arm/t-wince-pe
* arm/t-xscale-coff arm/t-xscale-elf arm/uclinux-elf: Tidy MULTILIB
variables as required.
* doc/invoke.texi (ARM Options): Remove obsolete flags.
From-SVN: r81881
2004-05-15 14:41:35 +02:00
|
|
|
#if defined (__INTERWORKING__)
|
2003-08-30 17:55:18 +02:00
|
|
|
.ifc "\regs",""
|
2005-05-17 17:12:27 +02:00
|
|
|
ldr\cond lr, [sp], #8
|
2003-08-30 17:55:18 +02:00
|
|
|
.else
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
# if defined(__thumb2__)
|
|
|
|
pop\cond {\regs, lr}
|
|
|
|
# else
|
2003-08-30 17:55:18 +02:00
|
|
|
ldm\cond\dirn sp!, {\regs, lr}
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
# endif
|
2005-05-17 17:12:27 +02:00
|
|
|
.endif
|
|
|
|
.ifnc "\unwind", ""
|
|
|
|
/* Mark LR as restored. */
|
|
|
|
97: cfi_pop 97b - \unwind, 0xe, 0x0
|
2003-08-30 17:55:18 +02:00
|
|
|
.endif
|
|
|
|
bx\cond lr
|
|
|
|
#else
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
/* Caller is responsible for providing IT instruction. */
|
2003-08-30 17:55:18 +02:00
|
|
|
.ifc "\regs",""
|
2005-05-17 17:12:27 +02:00
|
|
|
ldr\cond pc, [sp], #8
|
2003-08-30 17:55:18 +02:00
|
|
|
.else
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
# if defined(__thumb2__)
|
|
|
|
pop\cond {\regs, pc}
|
|
|
|
# else
|
2007-02-09 00:49:59 +01:00
|
|
|
ldm\cond\dirn sp!, {\regs, pc}
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
# endif
|
2003-08-30 17:55:18 +02:00
|
|
|
.endif
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
/* The Unified assembly syntax allows the same code to be assembled for both
|
|
|
|
ARM and Thumb-2. However this is only supported by recent gas, so define
|
|
|
|
a set of macros to allow ARM code on older assemblers. */
|
|
|
|
#if defined(__thumb2__)
|
|
|
|
.macro do_it cond, suffix=""
|
|
|
|
it\suffix \cond
|
|
|
|
.endm
|
|
|
|
.macro shift1 op, arg0, arg1, arg2
|
|
|
|
\op \arg0, \arg1, \arg2
|
|
|
|
.endm
|
|
|
|
#define do_push push
|
|
|
|
#define do_pop pop
|
|
|
|
#define COND(op1, op2, cond) op1 ## op2 ## cond
|
|
|
|
/* Perform an arithmetic operation with a variable shift operand. This
|
|
|
|
requires two instructions and a scratch register on Thumb-2. */
|
|
|
|
.macro shiftop name, dest, src1, src2, shiftop, shiftreg, tmp
|
|
|
|
\shiftop \tmp, \src2, \shiftreg
|
|
|
|
\name \dest, \src1, \tmp
|
|
|
|
.endm
|
|
|
|
#else
|
|
|
|
.macro do_it cond, suffix=""
|
|
|
|
.endm
|
|
|
|
.macro shift1 op, arg0, arg1, arg2
|
|
|
|
mov \arg0, \arg1, \op \arg2
|
|
|
|
.endm
|
|
|
|
#define do_push stmfd sp!,
|
|
|
|
#define do_pop ldmfd sp!,
|
|
|
|
#define COND(op1, op2, cond) op1 ## cond ## op2
|
|
|
|
.macro shiftop name, dest, src1, src2, shiftop, shiftreg, tmp
|
|
|
|
\name \dest, \src1, \src2, \shiftop \shiftreg
|
|
|
|
.endm
|
|
|
|
#endif
|
2003-08-30 17:55:18 +02:00
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
.macro ARM_LDIV0 name signed
|
|
|
|
cmp r0, #0
|
|
|
|
.ifc \signed, unsigned
|
|
|
|
movne r0, #0xffffffff
|
|
|
|
.else
|
|
|
|
movgt r0, #0x7fffffff
|
|
|
|
movlt r0, #0x80000000
|
|
|
|
.endif
|
|
|
|
b SYM (__aeabi_idiv0) __PLT__
|
|
|
|
.endm
|
|
|
|
#else
|
|
|
|
.macro ARM_LDIV0 name signed
|
2005-05-17 17:12:27 +02:00
|
|
|
str lr, [sp, #-8]!
|
|
|
|
98: cfi_push 98b - __\name, 0xe, -0x8, 0x8
|
2000-08-11 02:30:55 +02:00
|
|
|
bl SYM (__div0) __PLT__
|
|
|
|
mov r0, #0 @ About as wrong as it could be.
|
2005-05-17 17:12:27 +02:00
|
|
|
RETLDM unwind=98b
|
2000-08-11 02:30:55 +02:00
|
|
|
.endm
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#endif
|
2003-08-30 17:55:18 +02:00
|
|
|
|
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
.macro THUMB_LDIV0 name signed
|
|
|
|
#if defined(__ARM_ARCH_6M__)
|
|
|
|
.ifc \signed, unsigned
|
|
|
|
cmp r0, #0
|
|
|
|
beq 1f
|
|
|
|
mov r0, #0
|
|
|
|
mvn r0, r0 @ 0xffffffff
|
|
|
|
1:
|
|
|
|
.else
|
|
|
|
cmp r0, #0
|
|
|
|
beq 2f
|
|
|
|
blt 3f
|
|
|
|
mov r0, #0
|
|
|
|
mvn r0, r0
|
|
|
|
lsr r0, r0, #1 @ 0x7fffffff
|
|
|
|
b 2f
|
|
|
|
3: mov r0, #0x80
|
|
|
|
lsl r0, r0, #24 @ 0x80000000
|
|
|
|
2:
|
|
|
|
.endif
|
|
|
|
push {r0, r1, r2}
|
|
|
|
ldr r0, 4f
|
|
|
|
adr r1, 4f
|
|
|
|
add r0, r1
|
|
|
|
str r0, [sp, #8]
|
|
|
|
@ We know we are not on armv4t, so pop pc is safe.
|
|
|
|
pop {r0, r1, pc}
|
|
|
|
.align 2
|
|
|
|
4:
|
|
|
|
.word __aeabi_idiv0 - 4b
|
|
|
|
#elif defined(__thumb2__)
|
|
|
|
.syntax unified
|
|
|
|
.ifc \signed, unsigned
|
|
|
|
cbz r0, 1f
|
|
|
|
mov r0, #0xffffffff
|
|
|
|
1:
|
|
|
|
.else
|
|
|
|
cmp r0, #0
|
|
|
|
do_it gt
|
|
|
|
movgt r0, #0x7fffffff
|
|
|
|
do_it lt
|
|
|
|
movlt r0, #0x80000000
|
|
|
|
.endif
|
|
|
|
b.w SYM(__aeabi_idiv0) __PLT__
|
|
|
|
#else
|
|
|
|
.align 2
|
|
|
|
bx pc
|
|
|
|
nop
|
|
|
|
.arm
|
|
|
|
cmp r0, #0
|
|
|
|
.ifc \signed, unsigned
|
|
|
|
movne r0, #0xffffffff
|
|
|
|
.else
|
|
|
|
movgt r0, #0x7fffffff
|
|
|
|
movlt r0, #0x80000000
|
|
|
|
.endif
|
|
|
|
b SYM(__aeabi_idiv0) __PLT__
|
|
|
|
.thumb
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
#else
|
|
|
|
.macro THUMB_LDIV0 name signed
|
2005-05-17 17:12:27 +02:00
|
|
|
push { r1, lr }
|
|
|
|
98: cfi_push 98b - __\name, 0xe, -0x4, 0x8
|
2000-08-11 02:30:55 +02:00
|
|
|
bl SYM (__div0)
|
|
|
|
mov r0, #0 @ About as wrong as it could be.
|
2003-08-30 17:55:18 +02:00
|
|
|
#if defined (__INTERWORKING__)
|
2005-05-17 17:12:27 +02:00
|
|
|
pop { r1, r2 }
|
|
|
|
bx r2
|
2003-08-30 17:55:18 +02:00
|
|
|
#else
|
2005-05-17 17:12:27 +02:00
|
|
|
pop { r1, pc }
|
2000-08-11 02:30:55 +02:00
|
|
|
#endif
|
2003-08-30 17:55:18 +02:00
|
|
|
.endm
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#endif
|
2000-08-11 02:30:55 +02:00
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
.macro FUNC_END name
|
2003-08-30 17:55:18 +02:00
|
|
|
SIZE (__\name)
|
|
|
|
.endm
|
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
.macro DIV_FUNC_END name signed
|
2005-05-17 17:12:27 +02:00
|
|
|
cfi_start __\name, LSYM(Lend_div0)
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Ldiv0):
|
2000-08-22 21:50:12 +02:00
|
|
|
#ifdef __thumb__
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
THUMB_LDIV0 \name \signed
|
2000-08-22 21:50:12 +02:00
|
|
|
#else
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
ARM_LDIV0 \name \signed
|
2000-08-22 21:50:12 +02:00
|
|
|
#endif
|
2005-05-17 17:12:27 +02:00
|
|
|
cfi_end LSYM(Lend_div0)
|
2003-08-30 17:55:18 +02:00
|
|
|
FUNC_END \name
|
2000-08-22 21:50:12 +02:00
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro THUMB_FUNC_START name
|
|
|
|
.globl SYM (\name)
|
|
|
|
TYPE (\name)
|
|
|
|
.thumb_func
|
|
|
|
SYM (\name):
|
|
|
|
.endm
|
|
|
|
|
|
|
|
/* Function start macros. Variants for ARM and Thumb. */
|
|
|
|
|
2000-04-08 16:29:53 +02:00
|
|
|
#ifdef __thumb__
|
|
|
|
#define THUMB_FUNC .thumb_func
|
|
|
|
#define THUMB_CODE .force_thumb
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
# if defined(__thumb2__)
|
|
|
|
#define THUMB_SYNTAX .syntax divided
|
|
|
|
# else
|
|
|
|
#define THUMB_SYNTAX
|
|
|
|
# endif
|
2000-04-08 16:29:53 +02:00
|
|
|
#else
|
|
|
|
#define THUMB_FUNC
|
|
|
|
#define THUMB_CODE
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
#define THUMB_SYNTAX
|
2000-04-08 16:29:53 +02:00
|
|
|
#endif
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
|
2014-11-27 14:38:51 +01:00
|
|
|
.macro FUNC_START name sp_section=
|
|
|
|
.ifc \sp_section, function_section
|
|
|
|
.section .text.__\name,"ax",%progbits
|
|
|
|
.else
|
2000-04-08 16:29:53 +02:00
|
|
|
.text
|
2014-11-27 14:38:51 +01:00
|
|
|
.endif
|
2000-04-08 16:29:53 +02:00
|
|
|
.globl SYM (__\name)
|
|
|
|
TYPE (__\name)
|
|
|
|
.align 0
|
|
|
|
THUMB_CODE
|
|
|
|
THUMB_FUNC
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
THUMB_SYNTAX
|
2000-04-08 16:29:53 +02:00
|
|
|
SYM (__\name):
|
|
|
|
.endm
|
2003-08-30 17:55:18 +02:00
|
|
|
|
2014-11-27 14:38:51 +01:00
|
|
|
.macro ARM_SYM_START name
|
|
|
|
TYPE (\name)
|
|
|
|
.align 0
|
|
|
|
SYM (\name):
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro SYM_END name
|
|
|
|
SIZE (\name)
|
|
|
|
.endm
|
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
/* Special function that will always be coded in ARM assembly, even if
|
|
|
|
in Thumb-only compilation. */
|
|
|
|
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
#if defined(__thumb2__)
|
|
|
|
|
|
|
|
/* For Thumb-2 we build everything in thumb mode. */
|
2014-11-27 14:38:51 +01:00
|
|
|
.macro ARM_FUNC_START name sp_section=
|
|
|
|
FUNC_START \name \sp_section
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
.syntax unified
|
|
|
|
.endm
|
|
|
|
#define EQUIV .thumb_set
|
|
|
|
.macro ARM_CALL name
|
|
|
|
bl __\name
|
|
|
|
.endm
|
|
|
|
|
|
|
|
#elif defined(__INTERWORKING_STUBS__)
|
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
.macro ARM_FUNC_START name
|
|
|
|
FUNC_START \name
|
|
|
|
bx pc
|
|
|
|
nop
|
|
|
|
.arm
|
2004-08-12 18:14:52 +02:00
|
|
|
/* A hook to tell gdb that we've switched to ARM mode. Also used to call
|
|
|
|
directly from other local arm routines. */
|
|
|
|
_L__\name:
|
2003-08-30 17:55:18 +02:00
|
|
|
.endm
|
2004-01-15 17:56:34 +01:00
|
|
|
#define EQUIV .thumb_set
|
2004-08-12 18:14:52 +02:00
|
|
|
/* Branch directly to a function declared with ARM_FUNC_START.
|
|
|
|
Must be called in arm mode. */
|
2004-08-11 04:50:14 +02:00
|
|
|
.macro ARM_CALL name
|
|
|
|
bl _L__\name
|
|
|
|
.endm
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
|
|
|
|
#else /* !(__INTERWORKING_STUBS__ || __thumb2__) */
|
|
|
|
|
2008-03-03 15:30:48 +01:00
|
|
|
#ifdef __ARM_ARCH_6M__
|
|
|
|
#define EQUIV .thumb_set
|
|
|
|
#else
|
2014-11-27 14:38:51 +01:00
|
|
|
.macro ARM_FUNC_START name sp_section=
|
|
|
|
.ifc \sp_section, function_section
|
|
|
|
.section .text.__\name,"ax",%progbits
|
|
|
|
.else
|
2004-01-15 17:56:34 +01:00
|
|
|
.text
|
2014-11-27 14:38:51 +01:00
|
|
|
.endif
|
2004-01-15 17:56:34 +01:00
|
|
|
.globl SYM (__\name)
|
|
|
|
TYPE (__\name)
|
|
|
|
.align 0
|
|
|
|
.arm
|
|
|
|
SYM (__\name):
|
2003-08-30 17:55:18 +02:00
|
|
|
.endm
|
2004-01-15 17:56:34 +01:00
|
|
|
#define EQUIV .set
|
2004-08-11 04:50:14 +02:00
|
|
|
.macro ARM_CALL name
|
|
|
|
bl __\name
|
|
|
|
.endm
|
2008-03-03 15:30:48 +01:00
|
|
|
#endif
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
#endif
|
|
|
|
|
2005-02-18 15:46:47 +01:00
|
|
|
.macro FUNC_ALIAS new old
|
|
|
|
.globl SYM (__\new)
|
2005-04-30 21:40:53 +02:00
|
|
|
#if defined (__thumb__)
|
|
|
|
.thumb_set SYM (__\new), SYM (__\old)
|
|
|
|
#else
|
|
|
|
.set SYM (__\new), SYM (__\old)
|
|
|
|
#endif
|
2005-02-18 15:46:47 +01:00
|
|
|
.endm
|
|
|
|
|
2008-03-03 15:30:48 +01:00
|
|
|
#ifndef __ARM_ARCH_6M__
|
2004-01-15 17:56:34 +01:00
|
|
|
.macro ARM_FUNC_ALIAS new old
|
|
|
|
.globl SYM (__\new)
|
|
|
|
EQUIV SYM (__\new), SYM (__\old)
|
2005-04-30 21:40:53 +02:00
|
|
|
#if defined(__INTERWORKING_STUBS__)
|
2004-08-12 18:14:52 +02:00
|
|
|
.set SYM (_L__\new), SYM (_L__\old)
|
|
|
|
#endif
|
2004-01-15 17:56:34 +01:00
|
|
|
.endm
|
2008-03-03 15:30:48 +01:00
|
|
|
#endif
|
2004-01-15 17:56:34 +01:00
|
|
|
|
longlong.h (__arm__): Define count_leading_zeros.
2008-06-12 Paul Brook <paul@codesourcery.com>
gcc/
* longlong.h (__arm__): Define count_leading_zeros.
* config/arm/lib1funcs.asm (xxh, xxl, yyh, yyl): Define.
(clzsi2, clzdi2): New functions.
* config/arm/bpabi-v6m.S (xxh, xxl, yyh, yyl): Remove.
* config/arm/bpabi.S (xxh, xxl, yyh, yyl): Remove.
* config/arm/t-strongarm-elf (LIB1ASMFUNCS): Ditto.
* config/arm/t-vxworks (LIB1ASMFUNCS): Ditto.
* config/arm/t-pe (LIB1ASMFUNCS): Ditto.
* config/arm/t-arm-elf (LIB1ASMFUNCS): Ditto.
* config/arm/t-arm-coff (LIB1ASMFUNCS): Ditto.
* config/arm/t-linux (LIB1ASMFUNCS): Ditto.
* config/arm/t-symbian (LIB1ASMFUNCS): Ditto.
* config/arm/t-wince-pe (LIB1ASMFUNCS): Ditto.
From-SVN: r136718
2008-06-12 19:29:47 +02:00
|
|
|
#ifdef __ARMEB__
|
|
|
|
#define xxh r0
|
|
|
|
#define xxl r1
|
|
|
|
#define yyh r2
|
|
|
|
#define yyl r3
|
|
|
|
#else
|
|
|
|
#define xxh r1
|
|
|
|
#define xxl r0
|
|
|
|
#define yyh r3
|
|
|
|
#define yyl r2
|
|
|
|
#endif
|
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
.macro WEAK name
|
|
|
|
.weak SYM (__\name)
|
|
|
|
.endm
|
|
|
|
#endif
|
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
#ifdef __thumb__
|
2000-08-22 21:50:12 +02:00
|
|
|
/* Register aliases. */
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
work .req r4 @ XXXX is this safe ?
|
1996-01-19 11:11:00 +01:00
|
|
|
dividend .req r0
|
|
|
|
divisor .req r1
|
2000-08-22 21:50:12 +02:00
|
|
|
overdone .req r2
|
1996-01-19 11:11:00 +01:00
|
|
|
result .req r2
|
|
|
|
curbit .req r3
|
2003-09-30 12:30:32 +02:00
|
|
|
#endif
|
config.gcc: Add an extra_header for ARM targets.
* config.gcc: Add an extra_header for ARM targets.
Support configuring with --with-cpu=iwmmxt.
* doc/invoke.texi: Document new value for -mcpu= ARM switch.
* config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
names. Fix formatting.
* config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
names.
* config/arm/arm-protos.h (arm_emit_vector_const): New
prototype.
(arm_output_load_gr): New prototype.
* config/arm/arm.c (extra_reg_names1): Delete.
(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT,
* arch_is_iwmmxt): Define.
(all_cores, all_architecture): Add entry for iwmmxt.
(arm_override_options): Add support for iwmmxt.
(use_return_insn, arm_function_arg, arm_legitimate_index_p,
arm_print_value, arm_rtx_costs_1, output_move_double,
arm_compute_save_reg_mask, arm_output_epilogue,
arm_get_frame_size, arm_expand_prologue, arm_print_operand,
arm_assemble_integer, arm_hard_regno_ok, arm_regno_class):
Likewise.
(arm_init_cumulative_args): Count iwmmxt registers.
(arm_function_ok_for_sibcall): Return false of sibcall_blocked
has been set.
(struct minipool_node): Add fix_size field.
(add_minipool_forward_ref): Add support for 8-byte aligning of
the pool.
(add_minipool_backward_ref, add_minipool_offsets,
dump_minipool, push_minipool_fix): Likewise.
(struct builtin_description): New struct.
(builtin_description): New array of iwmmxt builtin functions.
(arm_init_iwmmxt_builtins): New function.
(arm_init_builtins): New function.
(safe_vector_operand): New function.
(arm_expand_binop_builtin): New function.
(arm_expand_unop_builtin): New function.
(arm_expand_builtin): New function.
(arm_emit_vector_const): New function.
(arm_output_load_gr): New function.
* config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT,
TARGET_REALLY_IWMMXT, arm_arch_iwmmxt, IWMMXT_ALIGNMENT,
TYPE_NEEDS_IWMMXT_ALIGNMENT, ADJUST_FIELD_ALIGN,
DATA_ALIGNMENT, LOCAL_ALIGNMENT, VECTOR_MODE_SUPPORTED_P): Define.
(BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled.
(CPP_CPU_ARCH_SPEC): Add entries for iwmmxt.
(FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER,
reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
REG_CLASS_FOR_LETTER): Add iwmmxt registers.
(SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt
registers unless the iwmmxt target is selected.
(FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM,
FIRST_IWMMXT_REGNUM, LAST_IWMMXT_REGNUM, IS_IWMMXT_REGNUM,
IS_IWMMXT_GR_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Bump to 63.
(struct machine_function): Add sibcall_blocked field.
(Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and
nargs fields.
(enum arm_builtins): New enum list.
* config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC,
UNSPEC_TMOVMSK, UNSPEC_WSAD, UNSPEC_WSADZ, UNSPEC_WMACS,
UNSPEC_WMACU, UNSPEC_WMACSZ, UNSPEC_WMACUZ, UNSPEC_CLRDI,
UNSPEC_WMADDS, UNSPEC_WMADDU): New unspecs.
(VUNSPEC_TMRC, VUNSPEC_TMCR, VUNSPEC_ALIGN8, VUNSPEC_WCMP_EQ,
VUNSPEC_WCMP_GTU, VUNSPEC_WCMP_GT): New vunspecs.
(movv2si, movv4hi, movv8qi): New expands for vector moves.
Include iwmmxt.md.
* config/arm/t-xscale-elf (MULTILIB_OPITONS): Add iwmmxt
multilib.
(MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise.
* config/arm/mmintrin.h: New ARM specific header file.
* config/arm/iwmmx.md: New iWMMXt specific machine patterns.
From-SVN: r68157
2003-06-18 18:36:13 +02:00
|
|
|
#if 0
|
1996-01-19 11:11:00 +01:00
|
|
|
ip .req r12
|
|
|
|
sp .req r13
|
|
|
|
lr .req r14
|
|
|
|
pc .req r15
|
config.gcc: Add an extra_header for ARM targets.
* config.gcc: Add an extra_header for ARM targets.
Support configuring with --with-cpu=iwmmxt.
* doc/invoke.texi: Document new value for -mcpu= ARM switch.
* config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
names. Fix formatting.
* config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
names.
* config/arm/arm-protos.h (arm_emit_vector_const): New
prototype.
(arm_output_load_gr): New prototype.
* config/arm/arm.c (extra_reg_names1): Delete.
(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT,
* arch_is_iwmmxt): Define.
(all_cores, all_architecture): Add entry for iwmmxt.
(arm_override_options): Add support for iwmmxt.
(use_return_insn, arm_function_arg, arm_legitimate_index_p,
arm_print_value, arm_rtx_costs_1, output_move_double,
arm_compute_save_reg_mask, arm_output_epilogue,
arm_get_frame_size, arm_expand_prologue, arm_print_operand,
arm_assemble_integer, arm_hard_regno_ok, arm_regno_class):
Likewise.
(arm_init_cumulative_args): Count iwmmxt registers.
(arm_function_ok_for_sibcall): Return false of sibcall_blocked
has been set.
(struct minipool_node): Add fix_size field.
(add_minipool_forward_ref): Add support for 8-byte aligning of
the pool.
(add_minipool_backward_ref, add_minipool_offsets,
dump_minipool, push_minipool_fix): Likewise.
(struct builtin_description): New struct.
(builtin_description): New array of iwmmxt builtin functions.
(arm_init_iwmmxt_builtins): New function.
(arm_init_builtins): New function.
(safe_vector_operand): New function.
(arm_expand_binop_builtin): New function.
(arm_expand_unop_builtin): New function.
(arm_expand_builtin): New function.
(arm_emit_vector_const): New function.
(arm_output_load_gr): New function.
* config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT,
TARGET_REALLY_IWMMXT, arm_arch_iwmmxt, IWMMXT_ALIGNMENT,
TYPE_NEEDS_IWMMXT_ALIGNMENT, ADJUST_FIELD_ALIGN,
DATA_ALIGNMENT, LOCAL_ALIGNMENT, VECTOR_MODE_SUPPORTED_P): Define.
(BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled.
(CPP_CPU_ARCH_SPEC): Add entries for iwmmxt.
(FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER,
reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
REG_CLASS_FOR_LETTER): Add iwmmxt registers.
(SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt
registers unless the iwmmxt target is selected.
(FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM,
FIRST_IWMMXT_REGNUM, LAST_IWMMXT_REGNUM, IS_IWMMXT_REGNUM,
IS_IWMMXT_GR_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Bump to 63.
(struct machine_function): Add sibcall_blocked field.
(Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and
nargs fields.
(enum arm_builtins): New enum list.
* config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC,
UNSPEC_TMOVMSK, UNSPEC_WSAD, UNSPEC_WSADZ, UNSPEC_WMACS,
UNSPEC_WMACU, UNSPEC_WMACSZ, UNSPEC_WMACUZ, UNSPEC_CLRDI,
UNSPEC_WMADDS, UNSPEC_WMADDU): New unspecs.
(VUNSPEC_TMRC, VUNSPEC_TMCR, VUNSPEC_ALIGN8, VUNSPEC_WCMP_EQ,
VUNSPEC_WCMP_GTU, VUNSPEC_WCMP_GT): New vunspecs.
(movv2si, movv4hi, movv8qi): New expands for vector moves.
Include iwmmxt.md.
* config/arm/t-xscale-elf (MULTILIB_OPITONS): Add iwmmxt
multilib.
(MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise.
* config/arm/mmintrin.h: New ARM specific header file.
* config/arm/iwmmx.md: New iWMMXt specific machine patterns.
From-SVN: r68157
2003-06-18 18:36:13 +02:00
|
|
|
#endif
|
2003-09-30 12:30:32 +02:00
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
2003-07-13 01:02:23 +02:00
|
|
|
/* Bodies of the division and modulo routines. */
|
2000-08-22 21:50:12 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
2003-09-30 12:30:32 +02:00
|
|
|
.macro ARM_DIV_BODY dividend, divisor, result, curbit
|
|
|
|
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__)
|
|
|
|
|
2009-08-06 23:05:42 +02:00
|
|
|
#if defined (__thumb2__)
|
|
|
|
clz \curbit, \dividend
|
|
|
|
clz \result, \divisor
|
|
|
|
sub \curbit, \result, \curbit
|
|
|
|
rsb \curbit, \curbit, #31
|
|
|
|
adr \result, 1f
|
|
|
|
add \curbit, \result, \curbit, lsl #4
|
|
|
|
mov \result, #0
|
|
|
|
mov pc, \curbit
|
|
|
|
.p2align 3
|
|
|
|
1:
|
|
|
|
.set shift, 32
|
|
|
|
.rept 32
|
|
|
|
.set shift, shift - 1
|
|
|
|
cmp.w \dividend, \divisor, lsl #shift
|
|
|
|
nop.n
|
|
|
|
adc.w \result, \result, \result
|
|
|
|
it cs
|
|
|
|
subcs.w \dividend, \dividend, \divisor, lsl #shift
|
|
|
|
.endr
|
|
|
|
#else
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
clz \curbit, \dividend
|
|
|
|
clz \result, \divisor
|
|
|
|
sub \curbit, \result, \curbit
|
|
|
|
rsbs \curbit, \curbit, #31
|
|
|
|
addne \curbit, \curbit, \curbit, lsl #1
|
|
|
|
mov \result, #0
|
|
|
|
addne pc, pc, \curbit, lsl #2
|
|
|
|
nop
|
|
|
|
.set shift, 32
|
|
|
|
.rept 32
|
|
|
|
.set shift, shift - 1
|
|
|
|
cmp \dividend, \divisor, lsl #shift
|
|
|
|
adc \result, \result, \result
|
|
|
|
subcs \dividend, \dividend, \divisor, lsl #shift
|
|
|
|
.endr
|
2009-08-06 23:05:42 +02:00
|
|
|
#endif
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
|
|
|
|
#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
|
2003-09-30 12:30:32 +02:00
|
|
|
#if __ARM_ARCH__ >= 5
|
|
|
|
|
|
|
|
clz \curbit, \divisor
|
|
|
|
clz \result, \dividend
|
|
|
|
sub \result, \curbit, \result
|
|
|
|
mov \curbit, #1
|
|
|
|
mov \divisor, \divisor, lsl \result
|
|
|
|
mov \curbit, \curbit, lsl \result
|
|
|
|
mov \result, #0
|
|
|
|
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
#else /* __ARM_ARCH__ < 5 */
|
2003-09-30 12:30:32 +02:00
|
|
|
|
|
|
|
@ Initially shift the divisor left 3 bits if possible,
|
|
|
|
@ set curbit accordingly. This allows for curbit to be located
|
alpha.c, [...]: Follow spelling conventions.
* config/alpha/alpha.c, config/alpha/alpha.md,
config/alpha/lib1funcs.asm, config/alpha/vms-crt0-64.c,
config/alpha/vms-psxcrt0-64.c, config/arc/arc.c,
config/arc/arc.h, config/arm/arm.c, config/arm/arm.md,
config/arm/lib1funcs.asm: Follow spelling conventions.
From-SVN: r122150
2007-02-20 03:10:57 +01:00
|
|
|
@ at the left end of each 4-bit nibbles in the division loop
|
2003-09-30 12:30:32 +02:00
|
|
|
@ to save one loop in most cases.
|
|
|
|
tst \divisor, #0xe0000000
|
|
|
|
moveq \divisor, \divisor, lsl #3
|
|
|
|
moveq \curbit, #8
|
|
|
|
movne \curbit, #1
|
|
|
|
|
1996-01-19 11:11:00 +01:00
|
|
|
@ Unless the divisor is very big, shift it up in multiples of
|
|
|
|
@ four bits, since this is the amount of unwinding in the main
|
|
|
|
@ division loop. Continue shifting until the divisor is
|
|
|
|
@ larger than the dividend.
|
2003-09-30 12:30:32 +02:00
|
|
|
1: cmp \divisor, #0x10000000
|
|
|
|
cmplo \divisor, \dividend
|
|
|
|
movlo \divisor, \divisor, lsl #4
|
|
|
|
movlo \curbit, \curbit, lsl #4
|
|
|
|
blo 1b
|
1996-01-19 11:11:00 +01:00
|
|
|
|
|
|
|
@ For very big divisors, we must shift it a bit at a time, or
|
|
|
|
@ we will be in danger of overflowing.
|
2003-09-30 12:30:32 +02:00
|
|
|
1: cmp \divisor, #0x80000000
|
|
|
|
cmplo \divisor, \dividend
|
|
|
|
movlo \divisor, \divisor, lsl #1
|
|
|
|
movlo \curbit, \curbit, lsl #1
|
|
|
|
blo 1b
|
1996-01-19 11:11:00 +01:00
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
mov \result, #0
|
|
|
|
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
#endif /* __ARM_ARCH__ < 5 */
|
2003-09-30 12:30:32 +02:00
|
|
|
|
|
|
|
@ Division loop
|
|
|
|
1: cmp \dividend, \divisor
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it hs, t
|
2003-09-30 12:30:32 +02:00
|
|
|
subhs \dividend, \dividend, \divisor
|
|
|
|
orrhs \result, \result, \curbit
|
|
|
|
cmp \dividend, \divisor, lsr #1
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it hs, t
|
2003-09-30 12:30:32 +02:00
|
|
|
subhs \dividend, \dividend, \divisor, lsr #1
|
|
|
|
orrhs \result, \result, \curbit, lsr #1
|
|
|
|
cmp \dividend, \divisor, lsr #2
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it hs, t
|
2003-09-30 12:30:32 +02:00
|
|
|
subhs \dividend, \dividend, \divisor, lsr #2
|
|
|
|
orrhs \result, \result, \curbit, lsr #2
|
|
|
|
cmp \dividend, \divisor, lsr #3
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it hs, t
|
2003-09-30 12:30:32 +02:00
|
|
|
subhs \dividend, \dividend, \divisor, lsr #3
|
|
|
|
orrhs \result, \result, \curbit, lsr #3
|
|
|
|
cmp \dividend, #0 @ Early termination?
|
2010-12-20 18:16:38 +01:00
|
|
|
do_it ne, t
|
2003-09-30 12:30:32 +02:00
|
|
|
movnes \curbit, \curbit, lsr #4 @ No, any more bits to do?
|
|
|
|
movne \divisor, \divisor, lsr #4
|
|
|
|
bne 1b
|
|
|
|
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
|
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
.endm
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
.macro ARM_DIV2_ORDER divisor, order
|
|
|
|
|
|
|
|
#if __ARM_ARCH__ >= 5
|
|
|
|
|
|
|
|
clz \order, \divisor
|
|
|
|
rsb \order, \order, #31
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
cmp \divisor, #(1 << 16)
|
|
|
|
movhs \divisor, \divisor, lsr #16
|
|
|
|
movhs \order, #16
|
|
|
|
movlo \order, #0
|
|
|
|
|
|
|
|
cmp \divisor, #(1 << 8)
|
|
|
|
movhs \divisor, \divisor, lsr #8
|
|
|
|
addhs \order, \order, #8
|
|
|
|
|
|
|
|
cmp \divisor, #(1 << 4)
|
|
|
|
movhs \divisor, \divisor, lsr #4
|
|
|
|
addhs \order, \order, #4
|
|
|
|
|
|
|
|
cmp \divisor, #(1 << 2)
|
|
|
|
addhi \order, \order, #3
|
|
|
|
addls \order, \order, \divisor, lsr #1
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
.endm
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
.macro ARM_MOD_BODY dividend, divisor, order, spare
|
|
|
|
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__)
|
|
|
|
|
|
|
|
clz \order, \divisor
|
|
|
|
clz \spare, \dividend
|
|
|
|
sub \order, \order, \spare
|
|
|
|
rsbs \order, \order, #31
|
|
|
|
addne pc, pc, \order, lsl #3
|
|
|
|
nop
|
|
|
|
.set shift, 32
|
|
|
|
.rept 32
|
|
|
|
.set shift, shift - 1
|
|
|
|
cmp \dividend, \divisor, lsl #shift
|
|
|
|
subcs \dividend, \dividend, \divisor, lsl #shift
|
|
|
|
.endr
|
|
|
|
|
|
|
|
#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
|
2003-09-30 12:30:32 +02:00
|
|
|
#if __ARM_ARCH__ >= 5
|
|
|
|
|
|
|
|
clz \order, \divisor
|
|
|
|
clz \spare, \dividend
|
|
|
|
sub \order, \order, \spare
|
|
|
|
mov \divisor, \divisor, lsl \order
|
2000-08-22 21:50:12 +02:00
|
|
|
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
#else /* __ARM_ARCH__ < 5 */
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
mov \order, #0
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
@ Unless the divisor is very big, shift it up in multiples of
|
|
|
|
@ four bits, since this is the amount of unwinding in the main
|
|
|
|
@ division loop. Continue shifting until the divisor is
|
|
|
|
@ larger than the dividend.
|
|
|
|
1: cmp \divisor, #0x10000000
|
|
|
|
cmplo \divisor, \dividend
|
|
|
|
movlo \divisor, \divisor, lsl #4
|
|
|
|
addlo \order, \order, #4
|
|
|
|
blo 1b
|
1998-10-27 12:13:39 +01:00
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
@ For very big divisors, we must shift it a bit at a time, or
|
|
|
|
@ we will be in danger of overflowing.
|
|
|
|
1: cmp \divisor, #0x80000000
|
|
|
|
cmplo \divisor, \dividend
|
|
|
|
movlo \divisor, \divisor, lsl #1
|
|
|
|
addlo \order, \order, #1
|
|
|
|
blo 1b
|
|
|
|
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
#endif /* __ARM_ARCH__ < 5 */
|
2003-09-30 12:30:32 +02:00
|
|
|
|
|
|
|
@ Perform all needed substractions to keep only the reminder.
|
|
|
|
@ Do comparisons in batch of 4 first.
|
|
|
|
subs \order, \order, #3 @ yes, 3 is intended here
|
|
|
|
blt 2f
|
|
|
|
|
|
|
|
1: cmp \dividend, \divisor
|
|
|
|
subhs \dividend, \dividend, \divisor
|
|
|
|
cmp \dividend, \divisor, lsr #1
|
|
|
|
subhs \dividend, \dividend, \divisor, lsr #1
|
|
|
|
cmp \dividend, \divisor, lsr #2
|
|
|
|
subhs \dividend, \dividend, \divisor, lsr #2
|
|
|
|
cmp \dividend, \divisor, lsr #3
|
|
|
|
subhs \dividend, \dividend, \divisor, lsr #3
|
|
|
|
cmp \dividend, #1
|
|
|
|
mov \divisor, \divisor, lsr #4
|
|
|
|
subges \order, \order, #4
|
|
|
|
bge 1b
|
|
|
|
|
|
|
|
tst \order, #3
|
|
|
|
teqne \dividend, #0
|
|
|
|
beq 5f
|
|
|
|
|
|
|
|
@ Either 1, 2 or 3 comparison/substractions are left.
|
|
|
|
2: cmn \order, #2
|
|
|
|
blt 4f
|
|
|
|
beq 3f
|
|
|
|
cmp \dividend, \divisor
|
|
|
|
subhs \dividend, \dividend, \divisor
|
|
|
|
mov \divisor, \divisor, lsr #1
|
|
|
|
3: cmp \dividend, \divisor
|
|
|
|
subhs \dividend, \dividend, \divisor
|
|
|
|
mov \divisor, \divisor, lsr #1
|
|
|
|
4: cmp \dividend, \divisor
|
|
|
|
subhs \dividend, \dividend, \divisor
|
|
|
|
5:
|
backport: re PR target/12476 (ARM/THUMB thunk calls broken)
Merge from csl-arm-branch.
2004-01-30 Paul Brook <paul@codesourcery.com>
* aof.h (REGISTER_NAMES): Add vfp reg names
(ADDITIONAL_REGISTER_NAMES): Ditto.
* aout.h (REGISTER_NAMES): Ditto.
(ADDITIONAL_REGISTER_NAMES): Ditto.
* arm-protos.h: Update/Add Prototypes.
* arm.c (init_fp_table): Rename from init_fpa_table. Update users.
Only allow 0.0 for VFP.
(fp_consts_inited): Rename from fpa_consts_inited. Update users.
(values_fp): Rename from values_fpa. Update Users.
(arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
Update users. Only check valid constants for this hardware.
(arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
Only allow consts for FPA.
(arm_float_add_operand): Rename from fpa_add_operand. Update users.
Only allow consts for FPA.
(use_return_insn): Check for saved VFP regs.
(arm_legitimate_address_p): Handle VFP DFmode addressing.
(arm_legitimize_address): Ditto.
(arm_general_register_operand): New function.
(vfp_mem_operand): New function.
(vfp_compare_operand): New function.
(vfp_secondary_reload_class): New function.
(arm_float_compare_operand): New function.
(vfp_print_multi): New function.
(vfp_output_fstmx): New function.
(vfp_emit_fstm): New function.
(arm_output_epilogue): Output VPF reg restore code.
(arm_expand_prologue): Output VFP reg save code.
(arm_print_operand): Add 'P'.
(arm_hard_regno_mode_ok): Return modes for VFP regs.
(arm_regno_class): Return classes for VFP regs.
(arm_compute_initial_elimination_offset): Include space for VFP regs.
(arm_get_frame_size): Ditto.
* arm.h (FIXED_REGISTERS): Add VFP regs.
(CALL_USED_REGISTERS): Ditto.
(CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
(FIRST_VFP_REGNUM): Define.
(LAST_VFP_REGNUM): Define.
(IS_VFP_REGNUM): Define.
(FIRST_PSEUDO_REGISTER): Include VFP regs.
(HARD_REGNO_NREGS): Handle VFP regs.
(REG_ALLOC_ORDER): Add VFP regs.
(enum reg_class): Add VFP_REGS.
(REG_CLASS_NAMES): Ditto.
(REG_CLASS_CONTENTS): Ditto.
(CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
(REG_CLASS_FROM_LETTER): Add 'w'.
(EXTRA_CONSTRAINT_ARM): Add 'U'.
(EXTRA_MEMORY_CONSTRAINT): Define.
(SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
(SECONDARY_INPUT_RELOAD_CLASS): Ditto.
(REGISTER_MOVE_COST): Ditto.
(PREDICATE_CODES): Add arm_general_register_operand,
arm_float_compare_operand and vfp_compare_operand.
* arm.md (various): Rename as above.
(divsf3): Enable when TARGET_VFP.
(divdf3): Ditto.
(movdfcc): Ditto.
(sqrtsf2): Ditto.
(sqrtdf2): Ditto.
(arm_movdi): Disable when TARGET_VFP.
(arm_movsi_insn): Ditto.
(movsi): Only split with general regs.
(cmpsf): Use arm_float_compare_operand.
(push_fp_multi): Restrict to TARGET_FPA.
(vfp.md): Include.
* vfp.md: New file.
* fpa.md (various): Rename as above.
* doc/md.texi: Document ARM w and U constraints.
2004-01-15 Paul Brook <paul@codesourcery.com>
* config.gcc: Add with_fpu. Allow with-float=softfp.
* config/arm/arm.c (arm_override_options): Rename *-s to *s.
Break out of loop when we find a float-abi. Fix typo.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
Set -mfloat-abi=.
* doc/install.texi: Document --with-fpu.
2003-01-14 Paul Brook <paul@codesourcery.com>
* config.gcc (with_arch): Add armv6.
* config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
* config/arm/arm.c (arm_overrride_options): Ditto.
2004-01-08 Richard Earnshaw <rearnsha@arm.com>
* arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
(FL_ARCH6): Renamed from FL_ARCH6J.
(arm_arch3m): Renamed from arm_fast_multiply.
(arm_arch6): Renamed from arm_arch6j.
* arm.h: Update all uses of above.
* arm-cores.def: Likewise.
* arm.md: Likewise.
* arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
not arm6j. Add entry for arch armv6.
2004-01-07 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_emit_extendsi): Delete.
* arm-protos.h (arm_emit_extendsi): Delete.
* arm.md (zero_extendhisi2): Also handle zero-extension of
non-subregs.
(zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
(thumb_zero_extendhisi2): Only match if not v6.
(arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
(thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
(thumb_extendqisi2): Likewise.
(thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
(thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
(thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
(thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
(arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
(arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
(arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
(arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
(arm_extendqisi2addsi): Likewise.
2003-12-31 Mark Mitchell <mark@codesourcery.com>
Revert this change:
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
* config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ REG addressing modes.
2003-12-30 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
CONSTANT_P_RTX.
2003-30-12 Paul Brook <paul@codesourcery.com>
* longlong.h: protect arm inlines with !defined (__thumb__)
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Fix typo in previous
change.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-cores.def: Add cost function.
* config/arm/arm.c (arm_*_rtx_costs): New functions.
(arm_rtx_costs): Remove
(struct processors): Add rtx_costs field.
(all_cores, all_architectures): Ditto.
(arm_override_options): Set targetm.rtx_costs.
(thumb_rtx_costs): New function.
(arm_rtx_costs_1): Remove cases handled elsewhere.
* config/arm/arm.h (processor_type): Add COSTS parameter.
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.md (generic_sched): arm926 has its own scheduler.
(arm926ejs.md): Include it.
* config/arm/arm926ejs.md: New pipeline description.
2003-12-24 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_arch6j): New variable.
(arm_override_options): Set it.
(arm_emit_extendsi): New function.
* config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
* config/arm/arm.h (arm_arch6j): Declare.
* config/arm/arm.md: Add sign/zero extend insns.
2003-12-23 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (all_architectures): Add armv6.
* doc/invoke.texi: Document it.
2003-12-19 Paul Brook <paul@codesourcery.com>
* config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
insn patterns to match.
* config/arm/arm-generic.md: Ditto.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/amm/iwmmxt.md: Ditto.
* config/arm/arm1026ejs.md: Ditto.
* config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
for 11_loadb.
2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
* config/arm/arm.c (arm_adjust_cost): Check shift cost for
TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
(arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
arm_no_early_mul_dep): Correctly deal with conditional execution,
parallels and single shift operations.
(arm_no_early_alu_shift_value_dep): Define.
* arm.md (attr type): Replace 'normal' with 'alu',
'alu_shift' and 'alu_shift_reg'.
(attr core_cycles): Adjust.
(*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
*shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
*not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
*cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
*arith_shiftsi_compare0_scratch, *sub_shiftsi,
*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
*if_shift_move, *if_move_shift, *if_shift_shift): Set type
attribute appropriately.
* config/arm/arm1026ejs.md (alu_op): Adjust.
(alu_shift_op, alu_shift_reg_op): New.
* config/arm/arm1136.md: Add better bypasses for early
registers. Remove load[234] and store[234] bypasses.
(11_alu_op): Adjust.
(11_alu_shift_op, 11_alu_shift_reg_op): New.
2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm-protos.h (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
* config/arm/arm.c (arm_no_early_store_addr_dep,
arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
* config/arm/arm1026ejs.md: Add load-store bypass.
* config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
Add bypasses between instructions.
2003-12-10 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_fpu_model): New variable.
(arm_fload_abi): New variable.
(target_fpe_name): Rename from target_fp_name.
(target_fpu_name): New variable.
(arm_is_cirrus): Remove.
(fpu_desc): New struct.
(all_fpus): Define.
(pf_model_for_fpu): Define.
(all_loat_abis): Define.
(arm_override_options): Set fp arch flags based on -mfpu=
and -float-abi=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(*): Use new TARGET_* flags.
* config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
(TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
(TARGET_SOFT_FLOAT): Ditto.
(TARGET_SOFT_FLOAT_ABI): New.
(TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
TARGET_HARD_FLOAT.
(TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
(TARGET_OPTIONS): Add -mfpu=.
(FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
(LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
(arm_pf_model): Define.
(arm_float_abi_type): Define.
(fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
* config/arm/arm.md: Use new TARGET_* flags.
* config/arm/cirrus.md: Ditto.
* config/arm/fpa.md: Ditto.
* config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
* config/arm/semi.h (ASM_SPEC): Ditto.
* config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
(FPUTYPE_DEFAULT): Set to VFP.
* doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
2003-11-22 Phil Edwards <phil@codesourcery.com>
PR target/12476
* config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
'bx' instead of 'b' to avoid branch range restrictions. Output
the thunk immediately before the thunked-to function.
* config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
.thumb_func if a thunk is being generated. Emit .code 16 along
with .thumb_func if a thunk is not being generated.
2003-11-15 Nicolas Pitre <nico@cam.org>
* config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
* config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
(lshrdi3_iwmmxt): Renamed from lshrdi3.
* config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
2003-11-12 Steve Woodford <scw@wasabisystems.com>
Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
2003-11-05 Phil Edwards <phil@codesourcery.com>
* config/arm/arm.md (insn): Add new V6 instruction names.
(generic_sched): New attr.
* config/arm/arm-generic.md: Use generic_sched here.
* config/arm/arm1026ejs.md: Do not model fetch/issue/decode
stages of pipeline. Adjust latency counts accordingly.
* config/arm/arm1136jfs.md: New file.
2003-10-28 Mark Mitchell <mark@codesourcery.com>
* config/arm/arm.h (processor_type): New enumeration type.
(CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
(CPP_CPU_ARCH_SPEC): Likewise.
* config/arm/arm.c (arm_tune): New variable.
(all_cores): Use cores.def.
(all_architectures): Add representative processor.
(arm_override_options): Restructure way in which tuning
information is deduced.
* arm.md: Update "insn" and "type" attributes throughout.
(insn): New attribute.
(type): Compute "mult" from "insn" attribute. Add load2,
load3, load4 alternatives.
(arm automaton): Move to arm-generic.md.
* config/arm/arm-cores.def: New file.
* config/arm/arm-generic.md: Likewise.
* config/arm/arm1026ejs.md: Likewise.
From-SVN: r77171
2004-02-03 15:45:44 +01:00
|
|
|
|
|
|
|
#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
|
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
.endm
|
2000-08-11 02:30:55 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
2000-08-22 21:50:12 +02:00
|
|
|
.macro THUMB_DIV_MOD_BODY modulo
|
|
|
|
@ Load the constant 0x10000000 into our work register.
|
2000-04-08 16:29:53 +02:00
|
|
|
mov work, #1
|
|
|
|
lsl work, #28
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Loop1):
|
2000-04-08 16:29:53 +02:00
|
|
|
@ Unless the divisor is very big, shift it up in multiples of
|
|
|
|
@ four bits, since this is the amount of unwinding in the main
|
|
|
|
@ division loop. Continue shifting until the divisor is
|
|
|
|
@ larger than the dividend.
|
|
|
|
cmp divisor, work
|
2003-05-12 15:14:32 +02:00
|
|
|
bhs LSYM(Lbignum)
|
2000-04-08 16:29:53 +02:00
|
|
|
cmp divisor, dividend
|
2003-05-12 15:14:32 +02:00
|
|
|
bhs LSYM(Lbignum)
|
2000-04-08 16:29:53 +02:00
|
|
|
lsl divisor, #4
|
2000-08-22 21:50:12 +02:00
|
|
|
lsl curbit, #4
|
2003-05-12 15:14:32 +02:00
|
|
|
b LSYM(Loop1)
|
|
|
|
LSYM(Lbignum):
|
2000-04-08 16:29:53 +02:00
|
|
|
@ Set work to 0x80000000
|
|
|
|
lsl work, #3
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Loop2):
|
2000-04-08 16:29:53 +02:00
|
|
|
@ For very big divisors, we must shift it a bit at a time, or
|
|
|
|
@ we will be in danger of overflowing.
|
|
|
|
cmp divisor, work
|
2003-05-12 15:14:32 +02:00
|
|
|
bhs LSYM(Loop3)
|
2000-04-08 16:29:53 +02:00
|
|
|
cmp divisor, dividend
|
2003-05-12 15:14:32 +02:00
|
|
|
bhs LSYM(Loop3)
|
2000-04-08 16:29:53 +02:00
|
|
|
lsl divisor, #1
|
2000-08-22 21:50:12 +02:00
|
|
|
lsl curbit, #1
|
2003-05-12 15:14:32 +02:00
|
|
|
b LSYM(Loop2)
|
|
|
|
LSYM(Loop3):
|
2000-08-22 21:50:12 +02:00
|
|
|
@ Test for possible subtractions ...
|
|
|
|
.if \modulo
|
|
|
|
@ ... On the final pass, this may subtract too much from the dividend,
|
|
|
|
@ so keep track of which subtractions are done, we can fix them up
|
|
|
|
@ afterwards.
|
2000-04-08 16:29:53 +02:00
|
|
|
mov overdone, #0
|
|
|
|
cmp dividend, divisor
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover1)
|
2000-04-08 16:29:53 +02:00
|
|
|
sub dividend, dividend, divisor
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover1):
|
2000-04-08 16:29:53 +02:00
|
|
|
lsr work, divisor, #1
|
|
|
|
cmp dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover2)
|
2000-04-08 16:29:53 +02:00
|
|
|
sub dividend, dividend, work
|
|
|
|
mov ip, curbit
|
|
|
|
mov work, #1
|
|
|
|
ror curbit, work
|
|
|
|
orr overdone, curbit
|
|
|
|
mov curbit, ip
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover2):
|
2000-04-08 16:29:53 +02:00
|
|
|
lsr work, divisor, #2
|
|
|
|
cmp dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover3)
|
2000-04-08 16:29:53 +02:00
|
|
|
sub dividend, dividend, work
|
|
|
|
mov ip, curbit
|
|
|
|
mov work, #2
|
|
|
|
ror curbit, work
|
|
|
|
orr overdone, curbit
|
|
|
|
mov curbit, ip
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover3):
|
2000-04-08 16:29:53 +02:00
|
|
|
lsr work, divisor, #3
|
|
|
|
cmp dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover4)
|
2000-04-08 16:29:53 +02:00
|
|
|
sub dividend, dividend, work
|
|
|
|
mov ip, curbit
|
|
|
|
mov work, #3
|
|
|
|
ror curbit, work
|
|
|
|
orr overdone, curbit
|
|
|
|
mov curbit, ip
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover4):
|
2000-04-08 16:29:53 +02:00
|
|
|
mov ip, curbit
|
2000-08-22 21:50:12 +02:00
|
|
|
.else
|
|
|
|
@ ... and note which bits are done in the result. On the final pass,
|
|
|
|
@ this may subtract too much from the dividend, but the result will be ok,
|
|
|
|
@ since the "bit" will have been shifted out at the bottom.
|
|
|
|
cmp dividend, divisor
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover1)
|
2000-08-22 21:50:12 +02:00
|
|
|
sub dividend, dividend, divisor
|
|
|
|
orr result, result, curbit
|
2003-05-16 18:01:51 +02:00
|
|
|
LSYM(Lover1):
|
2000-08-22 21:50:12 +02:00
|
|
|
lsr work, divisor, #1
|
|
|
|
cmp dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover2)
|
2000-08-22 21:50:12 +02:00
|
|
|
sub dividend, dividend, work
|
|
|
|
lsr work, curbit, #1
|
|
|
|
orr result, work
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover2):
|
2000-08-22 21:50:12 +02:00
|
|
|
lsr work, divisor, #2
|
|
|
|
cmp dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover3)
|
2000-08-22 21:50:12 +02:00
|
|
|
sub dividend, dividend, work
|
|
|
|
lsr work, curbit, #2
|
|
|
|
orr result, work
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover3):
|
2000-08-22 21:50:12 +02:00
|
|
|
lsr work, divisor, #3
|
|
|
|
cmp dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lover4)
|
2000-08-22 21:50:12 +02:00
|
|
|
sub dividend, dividend, work
|
|
|
|
lsr work, curbit, #3
|
|
|
|
orr result, work
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover4):
|
2000-08-22 21:50:12 +02:00
|
|
|
.endif
|
|
|
|
|
2000-04-08 16:29:53 +02:00
|
|
|
cmp dividend, #0 @ Early termination?
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Lover5)
|
2000-08-22 21:50:12 +02:00
|
|
|
lsr curbit, #4 @ No, any more bits to do?
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Lover5)
|
2000-04-08 16:29:53 +02:00
|
|
|
lsr divisor, #4
|
2003-05-12 15:14:32 +02:00
|
|
|
b LSYM(Loop3)
|
|
|
|
LSYM(Lover5):
|
2000-08-22 21:50:12 +02:00
|
|
|
.if \modulo
|
2000-04-08 16:29:53 +02:00
|
|
|
@ Any subtractions that we should not have done will be recorded in
|
|
|
|
@ the top three bits of "overdone". Exactly which were not needed
|
|
|
|
@ are governed by the position of the bit, stored in ip.
|
|
|
|
mov work, #0xe
|
2000-08-22 21:50:12 +02:00
|
|
|
lsl work, #28
|
2000-04-08 16:29:53 +02:00
|
|
|
and overdone, work
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Lgot_result)
|
2000-08-22 21:37:02 +02:00
|
|
|
|
|
|
|
@ If we terminated early, because dividend became zero, then the
|
|
|
|
@ bit in ip will not be in the bottom nibble, and we should not
|
|
|
|
@ perform the additions below. We must test for this though
|
|
|
|
@ (rather relying upon the TSTs to prevent the additions) since
|
|
|
|
@ the bit in ip could be in the top two bits which might then match
|
|
|
|
@ with one of the smaller RORs.
|
|
|
|
mov curbit, ip
|
|
|
|
mov work, #0x7
|
|
|
|
tst curbit, work
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Lgot_result)
|
2000-08-22 21:37:02 +02:00
|
|
|
|
2000-04-08 16:29:53 +02:00
|
|
|
mov curbit, ip
|
|
|
|
mov work, #3
|
|
|
|
ror curbit, work
|
|
|
|
tst overdone, curbit
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Lover6)
|
2000-04-08 16:29:53 +02:00
|
|
|
lsr work, divisor, #3
|
2000-08-22 21:50:12 +02:00
|
|
|
add dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover6):
|
2000-04-08 16:29:53 +02:00
|
|
|
mov curbit, ip
|
|
|
|
mov work, #2
|
|
|
|
ror curbit, work
|
|
|
|
tst overdone, curbit
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Lover7)
|
2000-04-08 16:29:53 +02:00
|
|
|
lsr work, divisor, #2
|
2000-08-22 21:50:12 +02:00
|
|
|
add dividend, work
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover7):
|
2000-04-08 16:29:53 +02:00
|
|
|
mov curbit, ip
|
|
|
|
mov work, #1
|
|
|
|
ror curbit, work
|
|
|
|
tst overdone, curbit
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Lgot_result)
|
2000-04-08 16:29:53 +02:00
|
|
|
lsr work, divisor, #1
|
2000-08-22 21:50:12 +02:00
|
|
|
add dividend, work
|
|
|
|
.endif
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lgot_result):
|
2000-08-22 21:50:12 +02:00
|
|
|
.endm
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
/* Start of the Real Functions */
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
#ifdef L_udivsi3
|
|
|
|
|
2010-02-18 18:29:58 +01:00
|
|
|
#if defined(__prefer_thumb__)
|
2009-08-06 23:05:42 +02:00
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
FUNC_START udivsi3
|
2005-08-10 15:06:52 +02:00
|
|
|
FUNC_ALIAS aeabi_uidiv udivsi3
|
2000-08-22 21:50:12 +02:00
|
|
|
|
|
|
|
cmp divisor, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Ldiv0)
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
LSYM(udivsi3_skip_div0_test):
|
2000-08-22 21:50:12 +02:00
|
|
|
mov curbit, #1
|
|
|
|
mov result, #0
|
|
|
|
|
|
|
|
push { work }
|
|
|
|
cmp dividend, divisor
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lgot_result)
|
2000-08-22 21:50:12 +02:00
|
|
|
|
|
|
|
THUMB_DIV_MOD_BODY 0
|
|
|
|
|
|
|
|
mov r0, result
|
2000-04-08 16:29:53 +02:00
|
|
|
pop { work }
|
2000-08-18 12:18:14 +02:00
|
|
|
RET
|
2000-08-22 21:50:12 +02:00
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
#elif defined(__ARM_ARCH_EXT_IDIV__)
|
|
|
|
|
|
|
|
ARM_FUNC_START udivsi3
|
|
|
|
ARM_FUNC_ALIAS aeabi_uidiv udivsi3
|
|
|
|
|
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
|
|
|
|
|
|
|
udiv r0, r0, r1
|
|
|
|
RET
|
|
|
|
|
2009-08-06 23:05:42 +02:00
|
|
|
#else /* ARM version/Thumb-2. */
|
|
|
|
|
|
|
|
ARM_FUNC_START udivsi3
|
|
|
|
ARM_FUNC_ALIAS aeabi_uidiv udivsi3
|
2003-09-30 12:30:32 +02:00
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
/* Note: if called via udivsi3_skip_div0_test, this will unnecessarily
|
|
|
|
check for division-by-zero a second time. */
|
|
|
|
LSYM(udivsi3_skip_div0_test):
|
2003-09-30 12:30:32 +02:00
|
|
|
subs r2, r1, #1
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it eq
|
2003-09-30 12:30:32 +02:00
|
|
|
RETc(eq)
|
|
|
|
bcc LSYM(Ldiv0)
|
|
|
|
cmp r0, r1
|
|
|
|
bls 11f
|
|
|
|
tst r1, r2
|
|
|
|
beq 12f
|
2000-04-08 16:29:53 +02:00
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
ARM_DIV_BODY r0, r1, r2, r3
|
2000-08-22 21:50:12 +02:00
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
mov r0, r2
|
2000-08-22 21:50:12 +02:00
|
|
|
RET
|
1996-01-19 11:11:00 +01:00
|
|
|
|
2009-08-06 23:05:42 +02:00
|
|
|
11: do_it eq, e
|
|
|
|
moveq r0, #1
|
2003-09-30 12:30:32 +02:00
|
|
|
movne r0, #0
|
|
|
|
RET
|
|
|
|
|
|
|
|
12: ARM_DIV2_ORDER r1, r2
|
|
|
|
|
|
|
|
mov r0, r0, lsr r2
|
|
|
|
RET
|
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
#endif /* ARM version */
|
1996-01-19 11:11:00 +01:00
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
DIV_FUNC_END udivsi3 unsigned
|
2000-08-22 21:50:12 +02:00
|
|
|
|
2010-02-18 18:29:58 +01:00
|
|
|
#if defined(__prefer_thumb__)
|
2004-08-12 18:14:52 +02:00
|
|
|
FUNC_START aeabi_uidivmod
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
2004-08-12 18:14:52 +02:00
|
|
|
push {r0, r1, lr}
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
bl LSYM(udivsi3_skip_div0_test)
|
2004-08-12 18:14:52 +02:00
|
|
|
POP {r1, r2, r3}
|
|
|
|
mul r2, r0
|
|
|
|
sub r1, r1, r2
|
|
|
|
bx r3
|
2011-11-16 19:02:12 +01:00
|
|
|
#elif defined(__ARM_ARCH_EXT_IDIV__)
|
|
|
|
ARM_FUNC_START aeabi_uidivmod
|
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
|
|
|
mov r2, r0
|
|
|
|
udiv r0, r0, r1
|
|
|
|
mls r1, r0, r1, r2
|
|
|
|
RET
|
2004-08-12 18:14:52 +02:00
|
|
|
#else
|
2009-08-06 23:05:42 +02:00
|
|
|
ARM_FUNC_START aeabi_uidivmod
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
2004-08-11 04:50:14 +02:00
|
|
|
stmfd sp!, { r0, r1, lr }
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
bl LSYM(udivsi3_skip_div0_test)
|
2004-08-11 04:50:14 +02:00
|
|
|
ldmfd sp!, { r1, r2, lr }
|
|
|
|
mul r3, r2, r0
|
|
|
|
sub r1, r1, r3
|
|
|
|
RET
|
2004-08-12 18:14:52 +02:00
|
|
|
#endif
|
2004-08-11 04:50:14 +02:00
|
|
|
FUNC_END aeabi_uidivmod
|
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
#endif /* L_udivsi3 */
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
#ifdef L_umodsi3
|
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
#ifdef __ARM_ARCH_EXT_IDIV__
|
2000-08-22 21:50:12 +02:00
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
ARM_FUNC_START umodsi3
|
|
|
|
|
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
|
|
|
udiv r2, r0, r1
|
|
|
|
mls r0, r1, r2, r0
|
|
|
|
RET
|
|
|
|
|
|
|
|
#elif defined(__thumb__)
|
|
|
|
|
|
|
|
FUNC_START umodsi3
|
2000-08-22 21:50:12 +02:00
|
|
|
|
|
|
|
cmp divisor, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Ldiv0)
|
2000-08-22 21:50:12 +02:00
|
|
|
mov curbit, #1
|
1996-01-19 11:11:00 +01:00
|
|
|
cmp dividend, divisor
|
2003-05-12 15:14:32 +02:00
|
|
|
bhs LSYM(Lover10)
|
2000-08-22 21:50:12 +02:00
|
|
|
RET
|
1996-01-19 11:11:00 +01:00
|
|
|
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover10):
|
2000-08-22 21:50:12 +02:00
|
|
|
push { work }
|
|
|
|
|
|
|
|
THUMB_DIV_MOD_BODY 1
|
|
|
|
|
|
|
|
pop { work }
|
|
|
|
RET
|
|
|
|
|
|
|
|
#else /* ARM version. */
|
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
FUNC_START umodsi3
|
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
subs r2, r1, #1 @ compare divisor with 1
|
|
|
|
bcc LSYM(Ldiv0)
|
|
|
|
cmpne r0, r1 @ compare dividend with divisor
|
|
|
|
moveq r0, #0
|
|
|
|
tsthi r1, r2 @ see if divisor is power of 2
|
|
|
|
andeq r0, r0, r2
|
|
|
|
RETc(ls)
|
|
|
|
|
|
|
|
ARM_MOD_BODY r0, r1, r2, r3
|
2000-08-22 21:50:12 +02:00
|
|
|
|
2000-04-08 16:29:53 +02:00
|
|
|
RET
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2000-08-22 21:37:02 +02:00
|
|
|
#endif /* ARM version. */
|
2000-04-08 16:29:53 +02:00
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
DIV_FUNC_END umodsi3 unsigned
|
1998-10-27 12:13:39 +01:00
|
|
|
|
1996-01-19 11:11:00 +01:00
|
|
|
#endif /* L_umodsi3 */
|
2000-08-11 02:30:55 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
1996-01-19 11:11:00 +01:00
|
|
|
#ifdef L_divsi3
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2010-02-18 18:29:58 +01:00
|
|
|
#if defined(__prefer_thumb__)
|
2009-08-06 23:05:42 +02:00
|
|
|
|
2000-08-11 02:30:55 +02:00
|
|
|
FUNC_START divsi3
|
2005-08-10 15:06:52 +02:00
|
|
|
FUNC_ALIAS aeabi_idiv divsi3
|
2000-04-08 16:29:53 +02:00
|
|
|
|
|
|
|
cmp divisor, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Ldiv0)
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
LSYM(divsi3_skip_div0_test):
|
2000-04-08 16:29:53 +02:00
|
|
|
push { work }
|
|
|
|
mov work, dividend
|
|
|
|
eor work, divisor @ Save the sign of the result.
|
|
|
|
mov ip, work
|
|
|
|
mov curbit, #1
|
|
|
|
mov result, #0
|
|
|
|
cmp divisor, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
bpl LSYM(Lover10)
|
2000-04-08 16:29:53 +02:00
|
|
|
neg divisor, divisor @ Loops below use unsigned.
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover10):
|
2000-04-08 16:29:53 +02:00
|
|
|
cmp dividend, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
bpl LSYM(Lover11)
|
2000-04-08 16:29:53 +02:00
|
|
|
neg dividend, dividend
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover11):
|
2000-04-08 16:29:53 +02:00
|
|
|
cmp dividend, divisor
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lgot_result)
|
2000-04-08 16:29:53 +02:00
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
THUMB_DIV_MOD_BODY 0
|
2000-04-08 16:29:53 +02:00
|
|
|
|
|
|
|
mov r0, result
|
|
|
|
mov work, ip
|
|
|
|
cmp work, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
bpl LSYM(Lover12)
|
2000-04-08 16:29:53 +02:00
|
|
|
neg r0, r0
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover12):
|
2000-04-08 16:29:53 +02:00
|
|
|
pop { work }
|
2000-08-22 21:50:12 +02:00
|
|
|
RET
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
#elif defined(__ARM_ARCH_EXT_IDIV__)
|
|
|
|
|
|
|
|
ARM_FUNC_START divsi3
|
|
|
|
ARM_FUNC_ALIAS aeabi_idiv divsi3
|
|
|
|
|
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
|
|
|
sdiv r0, r0, r1
|
|
|
|
RET
|
|
|
|
|
2009-08-06 23:05:42 +02:00
|
|
|
#else /* ARM/Thumb-2 version. */
|
2000-04-08 16:29:53 +02:00
|
|
|
|
2009-08-06 23:05:42 +02:00
|
|
|
ARM_FUNC_START divsi3
|
|
|
|
ARM_FUNC_ALIAS aeabi_idiv divsi3
|
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
cmp r1, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Ldiv0)
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
LSYM(divsi3_skip_div0_test):
|
|
|
|
eor ip, r0, r1 @ save the sign of the result.
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it mi
|
2003-09-30 12:30:32 +02:00
|
|
|
rsbmi r1, r1, #0 @ loops below use unsigned.
|
|
|
|
subs r2, r1, #1 @ division by 1 or -1 ?
|
|
|
|
beq 10f
|
|
|
|
movs r3, r0
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it mi
|
2003-09-30 12:30:32 +02:00
|
|
|
rsbmi r3, r0, #0 @ positive dividend value
|
|
|
|
cmp r3, r1
|
|
|
|
bls 11f
|
|
|
|
tst r1, r2 @ divisor is power of 2 ?
|
|
|
|
beq 12f
|
|
|
|
|
|
|
|
ARM_DIV_BODY r3, r1, r0, r2
|
2000-08-22 21:50:12 +02:00
|
|
|
|
1996-01-19 11:11:00 +01:00
|
|
|
cmp ip, #0
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it mi
|
2000-08-23 21:37:09 +02:00
|
|
|
rsbmi r0, r0, #0
|
2000-04-08 16:29:53 +02:00
|
|
|
RET
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
10: teq ip, r0 @ same sign ?
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it mi
|
2003-09-30 12:30:32 +02:00
|
|
|
rsbmi r0, r0, #0
|
|
|
|
RET
|
|
|
|
|
2009-08-06 23:05:42 +02:00
|
|
|
11: do_it lo
|
|
|
|
movlo r0, #0
|
|
|
|
do_it eq,t
|
2003-09-30 12:30:32 +02:00
|
|
|
moveq r0, ip, asr #31
|
|
|
|
orreq r0, r0, #1
|
|
|
|
RET
|
|
|
|
|
|
|
|
12: ARM_DIV2_ORDER r1, r2
|
|
|
|
|
|
|
|
cmp ip, #0
|
|
|
|
mov r0, r3, lsr r2
|
2009-08-06 23:05:42 +02:00
|
|
|
do_it mi
|
2003-09-30 12:30:32 +02:00
|
|
|
rsbmi r0, r0, #0
|
|
|
|
RET
|
|
|
|
|
2000-08-11 02:30:55 +02:00
|
|
|
#endif /* ARM version */
|
2000-04-08 16:29:53 +02:00
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
DIV_FUNC_END divsi3 signed
|
1998-10-27 12:13:39 +01:00
|
|
|
|
2010-02-18 18:29:58 +01:00
|
|
|
#if defined(__prefer_thumb__)
|
2004-08-12 18:14:52 +02:00
|
|
|
FUNC_START aeabi_idivmod
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
2004-08-12 18:14:52 +02:00
|
|
|
push {r0, r1, lr}
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
bl LSYM(divsi3_skip_div0_test)
|
2004-08-12 18:14:52 +02:00
|
|
|
POP {r1, r2, r3}
|
|
|
|
mul r2, r0
|
|
|
|
sub r1, r1, r2
|
|
|
|
bx r3
|
2011-11-16 19:02:12 +01:00
|
|
|
#elif defined(__ARM_ARCH_EXT_IDIV__)
|
|
|
|
ARM_FUNC_START aeabi_idivmod
|
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
|
|
|
mov r2, r0
|
|
|
|
sdiv r0, r0, r1
|
|
|
|
mls r1, r0, r1, r2
|
|
|
|
RET
|
2004-08-12 18:14:52 +02:00
|
|
|
#else
|
2009-08-06 23:05:42 +02:00
|
|
|
ARM_FUNC_START aeabi_idivmod
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
2004-08-11 04:50:14 +02:00
|
|
|
stmfd sp!, { r0, r1, lr }
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
bl LSYM(divsi3_skip_div0_test)
|
2004-08-11 04:50:14 +02:00
|
|
|
ldmfd sp!, { r1, r2, lr }
|
|
|
|
mul r3, r2, r0
|
|
|
|
sub r1, r1, r3
|
|
|
|
RET
|
2004-08-12 18:14:52 +02:00
|
|
|
#endif
|
2004-08-11 04:50:14 +02:00
|
|
|
FUNC_END aeabi_idivmod
|
|
|
|
|
1996-01-19 11:11:00 +01:00
|
|
|
#endif /* L_divsi3 */
|
2000-08-11 02:30:55 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
1995-05-12 18:30:52 +02:00
|
|
|
#ifdef L_modsi3
|
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
#if defined(__ARM_ARCH_EXT_IDIV__)
|
2000-04-08 16:29:53 +02:00
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
ARM_FUNC_START modsi3
|
|
|
|
|
|
|
|
cmp r1, #0
|
|
|
|
beq LSYM(Ldiv0)
|
|
|
|
|
|
|
|
sdiv r2, r0, r1
|
|
|
|
mls r0, r1, r2, r0
|
|
|
|
RET
|
|
|
|
|
|
|
|
#elif defined(__thumb__)
|
|
|
|
|
|
|
|
FUNC_START modsi3
|
1995-05-12 18:30:52 +02:00
|
|
|
|
2000-04-08 16:29:53 +02:00
|
|
|
mov curbit, #1
|
|
|
|
cmp divisor, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Ldiv0)
|
|
|
|
bpl LSYM(Lover10)
|
2000-04-08 16:29:53 +02:00
|
|
|
neg divisor, divisor @ Loops below use unsigned.
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover10):
|
2000-04-08 16:29:53 +02:00
|
|
|
push { work }
|
|
|
|
@ Need to save the sign of the dividend, unfortunately, we need
|
2000-08-22 21:50:12 +02:00
|
|
|
@ work later on. Must do this after saving the original value of
|
2000-04-08 16:29:53 +02:00
|
|
|
@ the work register, because we will pop this value off first.
|
|
|
|
push { dividend }
|
|
|
|
cmp dividend, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
bpl LSYM(Lover11)
|
2000-04-08 16:29:53 +02:00
|
|
|
neg dividend, dividend
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover11):
|
2000-04-08 16:29:53 +02:00
|
|
|
cmp dividend, divisor
|
2003-05-12 15:14:32 +02:00
|
|
|
blo LSYM(Lgot_result)
|
2000-04-08 16:29:53 +02:00
|
|
|
|
2000-08-22 21:50:12 +02:00
|
|
|
THUMB_DIV_MOD_BODY 1
|
|
|
|
|
2000-04-08 16:29:53 +02:00
|
|
|
pop { work }
|
|
|
|
cmp work, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
bpl LSYM(Lover12)
|
2000-04-08 16:29:53 +02:00
|
|
|
neg dividend, dividend
|
2003-05-12 15:14:32 +02:00
|
|
|
LSYM(Lover12):
|
2000-04-08 16:29:53 +02:00
|
|
|
pop { work }
|
|
|
|
RET
|
2000-08-22 21:37:02 +02:00
|
|
|
|
2000-08-11 02:30:55 +02:00
|
|
|
#else /* ARM version. */
|
2000-04-08 16:29:53 +02:00
|
|
|
|
2011-11-16 19:02:12 +01:00
|
|
|
FUNC_START modsi3
|
|
|
|
|
2003-09-30 12:30:32 +02:00
|
|
|
cmp r1, #0
|
2003-05-12 15:14:32 +02:00
|
|
|
beq LSYM(Ldiv0)
|
2003-09-30 12:30:32 +02:00
|
|
|
rsbmi r1, r1, #0 @ loops below use unsigned.
|
|
|
|
movs ip, r0 @ preserve sign of dividend
|
|
|
|
rsbmi r0, r0, #0 @ if negative make positive
|
|
|
|
subs r2, r1, #1 @ compare divisor with 1
|
|
|
|
cmpne r0, r1 @ compare dividend with divisor
|
|
|
|
moveq r0, #0
|
|
|
|
tsthi r1, r2 @ see if divisor is power of 2
|
|
|
|
andeq r0, r0, r2
|
|
|
|
bls 10f
|
|
|
|
|
|
|
|
ARM_MOD_BODY r0, r1, r2, r3
|
|
|
|
|
|
|
|
10: cmp ip, #0
|
|
|
|
rsbmi r0, r0, #0
|
2000-04-08 16:29:53 +02:00
|
|
|
RET
|
2000-08-22 21:37:02 +02:00
|
|
|
|
2000-08-11 02:30:55 +02:00
|
|
|
#endif /* ARM version */
|
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
DIV_FUNC_END modsi3 signed
|
1998-10-27 12:13:39 +01:00
|
|
|
|
1995-05-12 18:30:52 +02:00
|
|
|
#endif /* L_modsi3 */
|
2000-08-11 02:30:55 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
1995-06-27 01:23:01 +02:00
|
|
|
#ifdef L_dvmd_tls
|
1995-05-12 18:30:52 +02:00
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
WEAK aeabi_idiv0
|
|
|
|
WEAK aeabi_ldiv0
|
|
|
|
FUNC_START aeabi_idiv0
|
|
|
|
FUNC_START aeabi_ldiv0
|
2000-08-22 21:37:02 +02:00
|
|
|
RET
|
2004-08-11 04:50:14 +02:00
|
|
|
FUNC_END aeabi_ldiv0
|
|
|
|
FUNC_END aeabi_idiv0
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#else
|
|
|
|
FUNC_START div0
|
|
|
|
RET
|
2003-08-30 17:55:18 +02:00
|
|
|
FUNC_END div0
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#endif
|
1998-10-27 12:13:39 +01:00
|
|
|
|
1995-05-12 18:30:52 +02:00
|
|
|
#endif /* L_divmodsi_tools */
|
2000-08-11 02:30:55 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
1998-04-01 19:19:01 +02:00
|
|
|
#ifdef L_dvmd_lnx
|
|
|
|
@ GNU/Linux division-by zero handler. Used in place of L_dvmd_tls
|
|
|
|
|
2005-11-15 15:32:13 +01:00
|
|
|
/* Constant taken from <asm/signal.h>. */
|
2001-09-18 12:02:37 +02:00
|
|
|
#define SIGFPE 8
|
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
WEAK aeabi_idiv0
|
|
|
|
WEAK aeabi_ldiv0
|
|
|
|
ARM_FUNC_START aeabi_idiv0
|
|
|
|
ARM_FUNC_START aeabi_ldiv0
|
|
|
|
#else
|
2007-03-25 03:07:45 +02:00
|
|
|
ARM_FUNC_START div0
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#endif
|
2000-04-08 16:29:53 +02:00
|
|
|
|
2007-03-25 03:07:45 +02:00
|
|
|
do_push {r1, lr}
|
2005-11-15 15:32:13 +01:00
|
|
|
mov r0, #SIGFPE
|
|
|
|
bl SYM(raise) __PLT__
|
2003-08-30 17:55:18 +02:00
|
|
|
RETLDM r1
|
2000-08-22 21:37:02 +02:00
|
|
|
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
FUNC_END aeabi_ldiv0
|
|
|
|
FUNC_END aeabi_idiv0
|
|
|
|
#else
|
2003-08-30 17:55:18 +02:00
|
|
|
FUNC_END div0
|
bpabi-v6m.S (test_div_by_zero): New macro.
gcc/
* config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/bpabi.S (test_div_by_zero): New macro.
(aeabi_ldivmod, aeabi_uldivmod): Use above macro.
* config/arm/lib1funcs.asm (ARM_LDIV0): Tail-call int div-by-zero
handler for EABI. Add signed/unsigned argument, pass correct value
to that handler.
(THUMB_LDIV0): Same, for Thumb.
(DIV_FUNC_END): Add signed argument.
(WEAK): New macro (for EABI).
(__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END. For
__udivsi3, add entry point which skips division-by-zero test.
(__divsi3, __modsi3): Add signed argument to DIV_FUNC_END.
(__aeabi_uidivmod, __aeabi_idivmod): Check for division by zero.
Call __udivsi3 or __divsi3 via entry points which skip
division-by-zero tests.
(__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and
declare those names weak.
From-SVN: r155319
2009-12-17 16:37:23 +01:00
|
|
|
#endif
|
1998-10-27 12:13:39 +01:00
|
|
|
|
1998-04-01 19:19:01 +02:00
|
|
|
#endif /* L_dvmd_lnx */
|
2009-05-28 18:26:23 +02:00
|
|
|
#ifdef L_clear_cache
|
|
|
|
#if defined __ARM_EABI__ && defined __linux__
|
|
|
|
@ EABI GNU/Linux call to cacheflush syscall.
|
2009-07-29 13:38:05 +02:00
|
|
|
ARM_FUNC_START clear_cache
|
|
|
|
do_push {r7}
|
2009-05-28 18:26:23 +02:00
|
|
|
#if __ARM_ARCH__ >= 7 || defined(__ARM_ARCH_6T2__)
|
|
|
|
movw r7, #2
|
|
|
|
movt r7, #0xf
|
|
|
|
#else
|
|
|
|
mov r7, #0xf0000
|
|
|
|
add r7, r7, #2
|
|
|
|
#endif
|
|
|
|
mov r2, #0
|
|
|
|
swi 0
|
2009-07-29 13:38:05 +02:00
|
|
|
do_pop {r7}
|
2009-05-28 18:26:23 +02:00
|
|
|
RET
|
|
|
|
FUNC_END clear_cache
|
|
|
|
#else
|
|
|
|
#error "This is only for ARM EABI GNU/Linux"
|
|
|
|
#endif
|
|
|
|
#endif /* L_clear_cache */
|
2000-08-11 02:30:55 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
2004-05-15 19:31:51 +02:00
|
|
|
/* Dword shift operations. */
|
|
|
|
/* All the following Dword shift variants rely on the fact that
|
|
|
|
shft xxx, Reg
|
|
|
|
is in fact done as
|
|
|
|
shft xxx, (Reg & 255)
|
|
|
|
so for Reg value in (32...63) and (-1...-31) we will get zero (in the
|
|
|
|
case of logical shifts) or the sign (for asr). */
|
|
|
|
|
|
|
|
#ifdef __ARMEB__
|
|
|
|
#define al r1
|
|
|
|
#define ah r0
|
|
|
|
#else
|
|
|
|
#define al r0
|
|
|
|
#define ah r1
|
|
|
|
#endif
|
|
|
|
|
2006-01-18 21:39:17 +01:00
|
|
|
/* Prevent __aeabi double-word shifts from being produced on SymbianOS. */
|
|
|
|
#ifndef __symbian__
|
|
|
|
|
2004-05-15 19:31:51 +02:00
|
|
|
#ifdef L_lshrdi3
|
|
|
|
|
|
|
|
FUNC_START lshrdi3
|
2005-02-18 15:46:47 +01:00
|
|
|
FUNC_ALIAS aeabi_llsr lshrdi3
|
2004-08-11 04:50:14 +02:00
|
|
|
|
2004-05-15 19:31:51 +02:00
|
|
|
#ifdef __thumb__
|
|
|
|
lsr al, r2
|
|
|
|
mov r3, ah
|
|
|
|
lsr ah, r2
|
|
|
|
mov ip, r3
|
|
|
|
sub r2, #32
|
|
|
|
lsr r3, r2
|
|
|
|
orr al, r3
|
|
|
|
neg r2, r2
|
|
|
|
mov r3, ip
|
|
|
|
lsl r3, r2
|
|
|
|
orr al, r3
|
|
|
|
RET
|
|
|
|
#else
|
|
|
|
subs r3, r2, #32
|
|
|
|
rsb ip, r2, #32
|
|
|
|
movmi al, al, lsr r2
|
|
|
|
movpl al, ah, lsr r3
|
|
|
|
orrmi al, al, ah, lsl ip
|
|
|
|
mov ah, ah, lsr r2
|
|
|
|
RET
|
|
|
|
#endif
|
2004-08-11 04:50:14 +02:00
|
|
|
FUNC_END aeabi_llsr
|
2004-05-15 19:31:51 +02:00
|
|
|
FUNC_END lshrdi3
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef L_ashrdi3
|
|
|
|
|
|
|
|
FUNC_START ashrdi3
|
2005-02-18 15:46:47 +01:00
|
|
|
FUNC_ALIAS aeabi_lasr ashrdi3
|
2004-08-11 04:50:14 +02:00
|
|
|
|
2004-05-15 19:31:51 +02:00
|
|
|
#ifdef __thumb__
|
|
|
|
lsr al, r2
|
|
|
|
mov r3, ah
|
|
|
|
asr ah, r2
|
|
|
|
sub r2, #32
|
|
|
|
@ If r2 is negative at this point the following step would OR
|
|
|
|
@ the sign bit into all of AL. That's not what we want...
|
|
|
|
bmi 1f
|
|
|
|
mov ip, r3
|
|
|
|
asr r3, r2
|
|
|
|
orr al, r3
|
|
|
|
mov r3, ip
|
|
|
|
1:
|
|
|
|
neg r2, r2
|
|
|
|
lsl r3, r2
|
|
|
|
orr al, r3
|
|
|
|
RET
|
|
|
|
#else
|
|
|
|
subs r3, r2, #32
|
|
|
|
rsb ip, r2, #32
|
|
|
|
movmi al, al, lsr r2
|
|
|
|
movpl al, ah, asr r3
|
|
|
|
orrmi al, al, ah, lsl ip
|
|
|
|
mov ah, ah, asr r2
|
|
|
|
RET
|
|
|
|
#endif
|
|
|
|
|
2004-08-11 04:50:14 +02:00
|
|
|
FUNC_END aeabi_lasr
|
2004-05-15 19:31:51 +02:00
|
|
|
FUNC_END ashrdi3
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef L_ashldi3
|
|
|
|
|
|
|
|
FUNC_START ashldi3
|
2005-02-18 15:46:47 +01:00
|
|
|
FUNC_ALIAS aeabi_llsl ashldi3
|
2004-08-11 04:50:14 +02:00
|
|
|
|
2004-05-15 19:31:51 +02:00
|
|
|
#ifdef __thumb__
|
|
|
|
lsl ah, r2
|
|
|
|
mov r3, al
|
|
|
|
lsl al, r2
|
|
|
|
mov ip, r3
|
|
|
|
sub r2, #32
|
|
|
|
lsl r3, r2
|
|
|
|
orr ah, r3
|
|
|
|
neg r2, r2
|
|
|
|
mov r3, ip
|
|
|
|
lsr r3, r2
|
|
|
|
orr ah, r3
|
|
|
|
RET
|
|
|
|
#else
|
|
|
|
subs r3, r2, #32
|
|
|
|
rsb ip, r2, #32
|
|
|
|
movmi ah, ah, lsl r2
|
|
|
|
movpl ah, al, lsl r3
|
|
|
|
orrmi ah, ah, al, lsr ip
|
|
|
|
mov al, al, lsl r2
|
|
|
|
RET
|
|
|
|
#endif
|
2004-08-11 04:50:14 +02:00
|
|
|
FUNC_END aeabi_llsl
|
2004-05-15 19:31:51 +02:00
|
|
|
FUNC_END ashldi3
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2006-01-18 21:39:17 +01:00
|
|
|
#endif /* __symbian__ */
|
|
|
|
|
longlong.h (__arm__): Define count_leading_zeros.
2008-06-12 Paul Brook <paul@codesourcery.com>
gcc/
* longlong.h (__arm__): Define count_leading_zeros.
* config/arm/lib1funcs.asm (xxh, xxl, yyh, yyl): Define.
(clzsi2, clzdi2): New functions.
* config/arm/bpabi-v6m.S (xxh, xxl, yyh, yyl): Remove.
* config/arm/bpabi.S (xxh, xxl, yyh, yyl): Remove.
* config/arm/t-strongarm-elf (LIB1ASMFUNCS): Ditto.
* config/arm/t-vxworks (LIB1ASMFUNCS): Ditto.
* config/arm/t-pe (LIB1ASMFUNCS): Ditto.
* config/arm/t-arm-elf (LIB1ASMFUNCS): Ditto.
* config/arm/t-arm-coff (LIB1ASMFUNCS): Ditto.
* config/arm/t-linux (LIB1ASMFUNCS): Ditto.
* config/arm/t-symbian (LIB1ASMFUNCS): Ditto.
* config/arm/t-wince-pe (LIB1ASMFUNCS): Ditto.
From-SVN: r136718
2008-06-12 19:29:47 +02:00
|
|
|
#if ((__ARM_ARCH__ > 5) && !defined(__ARM_ARCH_6M__)) \
|
|
|
|
|| defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
|
|
|
|
|| defined(__ARM_ARCH_5TEJ__)
|
|
|
|
#define HAVE_ARM_CLZ 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef L_clzsi2
|
|
|
|
#if defined(__ARM_ARCH_6M__)
|
|
|
|
FUNC_START clzsi2
|
|
|
|
mov r1, #28
|
|
|
|
mov r3, #1
|
|
|
|
lsl r3, r3, #16
|
|
|
|
cmp r0, r3 /* 0x10000 */
|
|
|
|
bcc 2f
|
|
|
|
lsr r0, r0, #16
|
|
|
|
sub r1, r1, #16
|
|
|
|
2: lsr r3, r3, #8
|
|
|
|
cmp r0, r3 /* #0x100 */
|
|
|
|
bcc 2f
|
|
|
|
lsr r0, r0, #8
|
|
|
|
sub r1, r1, #8
|
|
|
|
2: lsr r3, r3, #4
|
|
|
|
cmp r0, r3 /* #0x10 */
|
|
|
|
bcc 2f
|
|
|
|
lsr r0, r0, #4
|
|
|
|
sub r1, r1, #4
|
|
|
|
2: adr r2, 1f
|
|
|
|
ldrb r0, [r2, r0]
|
|
|
|
add r0, r0, r1
|
|
|
|
bx lr
|
|
|
|
.align 2
|
|
|
|
1:
|
|
|
|
.byte 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
|
|
|
|
FUNC_END clzsi2
|
|
|
|
#else
|
|
|
|
ARM_FUNC_START clzsi2
|
|
|
|
# if defined(HAVE_ARM_CLZ)
|
|
|
|
clz r0, r0
|
|
|
|
RET
|
|
|
|
# else
|
|
|
|
mov r1, #28
|
|
|
|
cmp r0, #0x10000
|
|
|
|
do_it cs, t
|
|
|
|
movcs r0, r0, lsr #16
|
|
|
|
subcs r1, r1, #16
|
|
|
|
cmp r0, #0x100
|
|
|
|
do_it cs, t
|
|
|
|
movcs r0, r0, lsr #8
|
|
|
|
subcs r1, r1, #8
|
|
|
|
cmp r0, #0x10
|
|
|
|
do_it cs, t
|
|
|
|
movcs r0, r0, lsr #4
|
|
|
|
subcs r1, r1, #4
|
|
|
|
adr r2, 1f
|
|
|
|
ldrb r0, [r2, r0]
|
|
|
|
add r0, r0, r1
|
2008-12-19 18:31:12 +01:00
|
|
|
RET
|
longlong.h (__arm__): Define count_leading_zeros.
2008-06-12 Paul Brook <paul@codesourcery.com>
gcc/
* longlong.h (__arm__): Define count_leading_zeros.
* config/arm/lib1funcs.asm (xxh, xxl, yyh, yyl): Define.
(clzsi2, clzdi2): New functions.
* config/arm/bpabi-v6m.S (xxh, xxl, yyh, yyl): Remove.
* config/arm/bpabi.S (xxh, xxl, yyh, yyl): Remove.
* config/arm/t-strongarm-elf (LIB1ASMFUNCS): Ditto.
* config/arm/t-vxworks (LIB1ASMFUNCS): Ditto.
* config/arm/t-pe (LIB1ASMFUNCS): Ditto.
* config/arm/t-arm-elf (LIB1ASMFUNCS): Ditto.
* config/arm/t-arm-coff (LIB1ASMFUNCS): Ditto.
* config/arm/t-linux (LIB1ASMFUNCS): Ditto.
* config/arm/t-symbian (LIB1ASMFUNCS): Ditto.
* config/arm/t-wince-pe (LIB1ASMFUNCS): Ditto.
From-SVN: r136718
2008-06-12 19:29:47 +02:00
|
|
|
.align 2
|
|
|
|
1:
|
|
|
|
.byte 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
|
|
|
|
# endif /* !HAVE_ARM_CLZ */
|
|
|
|
FUNC_END clzsi2
|
|
|
|
#endif
|
|
|
|
#endif /* L_clzsi2 */
|
|
|
|
|
|
|
|
#ifdef L_clzdi2
|
|
|
|
#if !defined(HAVE_ARM_CLZ)
|
|
|
|
|
|
|
|
# if defined(__ARM_ARCH_6M__)
|
|
|
|
FUNC_START clzdi2
|
|
|
|
push {r4, lr}
|
|
|
|
# else
|
|
|
|
ARM_FUNC_START clzdi2
|
|
|
|
do_push {r4, lr}
|
|
|
|
# endif
|
|
|
|
cmp xxh, #0
|
|
|
|
bne 1f
|
|
|
|
# ifdef __ARMEB__
|
|
|
|
mov r0, xxl
|
|
|
|
bl __clzsi2
|
|
|
|
add r0, r0, #32
|
|
|
|
b 2f
|
|
|
|
1:
|
|
|
|
bl __clzsi2
|
|
|
|
# else
|
|
|
|
bl __clzsi2
|
|
|
|
add r0, r0, #32
|
|
|
|
b 2f
|
|
|
|
1:
|
|
|
|
mov r0, xxh
|
|
|
|
bl __clzsi2
|
|
|
|
# endif
|
|
|
|
2:
|
|
|
|
# if defined(__ARM_ARCH_6M__)
|
|
|
|
pop {r4, pc}
|
|
|
|
# else
|
|
|
|
RETLDM r4
|
|
|
|
# endif
|
|
|
|
FUNC_END clzdi2
|
|
|
|
|
|
|
|
#else /* HAVE_ARM_CLZ */
|
|
|
|
|
|
|
|
ARM_FUNC_START clzdi2
|
|
|
|
cmp xxh, #0
|
|
|
|
do_it eq, et
|
|
|
|
clzeq r0, xxl
|
|
|
|
clzne r0, xxh
|
|
|
|
addeq r0, r0, #32
|
|
|
|
RET
|
|
|
|
FUNC_END clzdi2
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif /* L_clzdi2 */
|
|
|
|
|
2012-03-22 16:14:46 +01:00
|
|
|
#ifdef L_ctzsi2
|
|
|
|
#if defined(__ARM_ARCH_6M__)
|
|
|
|
FUNC_START ctzsi2
|
|
|
|
neg r1, r0
|
|
|
|
and r0, r0, r1
|
|
|
|
mov r1, #28
|
|
|
|
mov r3, #1
|
|
|
|
lsl r3, r3, #16
|
|
|
|
cmp r0, r3 /* 0x10000 */
|
|
|
|
bcc 2f
|
|
|
|
lsr r0, r0, #16
|
|
|
|
sub r1, r1, #16
|
|
|
|
2: lsr r3, r3, #8
|
|
|
|
cmp r0, r3 /* #0x100 */
|
|
|
|
bcc 2f
|
|
|
|
lsr r0, r0, #8
|
|
|
|
sub r1, r1, #8
|
|
|
|
2: lsr r3, r3, #4
|
|
|
|
cmp r0, r3 /* #0x10 */
|
|
|
|
bcc 2f
|
|
|
|
lsr r0, r0, #4
|
|
|
|
sub r1, r1, #4
|
|
|
|
2: adr r2, 1f
|
|
|
|
ldrb r0, [r2, r0]
|
|
|
|
sub r0, r0, r1
|
|
|
|
bx lr
|
|
|
|
.align 2
|
|
|
|
1:
|
|
|
|
.byte 27, 28, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31
|
|
|
|
FUNC_END ctzsi2
|
|
|
|
#else
|
|
|
|
ARM_FUNC_START ctzsi2
|
|
|
|
rsb r1, r0, #0
|
|
|
|
and r0, r0, r1
|
|
|
|
# if defined(HAVE_ARM_CLZ)
|
|
|
|
clz r0, r0
|
|
|
|
rsb r0, r0, #31
|
|
|
|
RET
|
|
|
|
# else
|
|
|
|
mov r1, #28
|
|
|
|
cmp r0, #0x10000
|
|
|
|
do_it cs, t
|
|
|
|
movcs r0, r0, lsr #16
|
|
|
|
subcs r1, r1, #16
|
|
|
|
cmp r0, #0x100
|
|
|
|
do_it cs, t
|
|
|
|
movcs r0, r0, lsr #8
|
|
|
|
subcs r1, r1, #8
|
|
|
|
cmp r0, #0x10
|
|
|
|
do_it cs, t
|
|
|
|
movcs r0, r0, lsr #4
|
|
|
|
subcs r1, r1, #4
|
|
|
|
adr r2, 1f
|
|
|
|
ldrb r0, [r2, r0]
|
|
|
|
sub r0, r0, r1
|
|
|
|
RET
|
|
|
|
.align 2
|
|
|
|
1:
|
|
|
|
.byte 27, 28, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31
|
|
|
|
# endif /* !HAVE_ARM_CLZ */
|
|
|
|
FUNC_END ctzsi2
|
|
|
|
#endif
|
|
|
|
#endif /* L_clzsi2 */
|
|
|
|
|
2004-05-15 19:31:51 +02:00
|
|
|
/* ------------------------------------------------------------------------ */
|
1998-04-01 19:19:01 +02:00
|
|
|
/* These next two sections are here despite the fact that they contain Thumb
|
|
|
|
assembler because their presence allows interworked code to be linked even
|
|
|
|
when the GCC library is this one. */
|
|
|
|
|
2000-12-05 00:05:17 +01:00
|
|
|
/* Do not build the interworking functions when the target architecture does
|
|
|
|
not support Thumb instructions. (This can be a multilib option). */
|
2004-04-28 15:24:30 +02:00
|
|
|
#if defined __ARM_ARCH_4T__ || defined __ARM_ARCH_5T__\
|
|
|
|
|| defined __ARM_ARCH_5TE__ || defined __ARM_ARCH_5TEJ__ \
|
|
|
|
|| __ARM_ARCH__ >= 6
|
|
|
|
|
|
|
|
#if defined L_call_via_rX
|
1998-04-01 19:19:01 +02:00
|
|
|
|
|
|
|
/* These labels & instructions are used by the Arm/Thumb interworking code.
|
|
|
|
The address of function to be called is loaded into a register and then
|
|
|
|
one of these labels is called via a BL instruction. This puts the
|
|
|
|
return address into the link register with the bottom bit set, and the
|
|
|
|
code here switches to the correct mode before executing the function. */
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 0
|
1999-10-21 14:05:58 +02:00
|
|
|
.force_thumb
|
2000-08-22 21:37:02 +02:00
|
|
|
|
1998-04-01 19:19:01 +02:00
|
|
|
.macro call_via register
|
2000-08-11 02:30:55 +02:00
|
|
|
THUMB_FUNC_START _call_via_\register
|
|
|
|
|
1998-04-01 19:19:01 +02:00
|
|
|
bx \register
|
|
|
|
nop
|
1998-10-27 16:15:11 +01:00
|
|
|
|
|
|
|
SIZE (_call_via_\register)
|
1998-04-01 19:19:01 +02:00
|
|
|
.endm
|
|
|
|
|
|
|
|
call_via r0
|
|
|
|
call_via r1
|
|
|
|
call_via r2
|
|
|
|
call_via r3
|
|
|
|
call_via r4
|
|
|
|
call_via r5
|
|
|
|
call_via r6
|
|
|
|
call_via r7
|
|
|
|
call_via r8
|
|
|
|
call_via r9
|
|
|
|
call_via sl
|
|
|
|
call_via fp
|
|
|
|
call_via ip
|
|
|
|
call_via sp
|
|
|
|
call_via lr
|
|
|
|
|
|
|
|
#endif /* L_call_via_rX */
|
2004-04-28 15:24:30 +02:00
|
|
|
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
/* Don't bother with the old interworking routines for Thumb-2. */
|
2008-03-03 15:30:48 +01:00
|
|
|
/* ??? Maybe only omit these on "m" variants. */
|
|
|
|
#if !defined(__thumb2__) && !defined(__ARM_ARCH_6M__)
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
|
2004-04-28 15:24:30 +02:00
|
|
|
#if defined L_interwork_call_via_rX
|
2000-08-22 21:37:02 +02:00
|
|
|
|
1998-04-01 19:19:01 +02:00
|
|
|
/* These labels & instructions are used by the Arm/Thumb interworking code,
|
|
|
|
when the target address is in an unknown instruction set. The address
|
|
|
|
of function to be called is loaded into a register and then one of these
|
|
|
|
labels is called via a BL instruction. This puts the return address
|
|
|
|
into the link register with the bottom bit set, and the code here
|
|
|
|
switches to the correct mode before executing the function. Unfortunately
|
|
|
|
the target code cannot be relied upon to return via a BX instruction, so
|
|
|
|
instead we have to store the resturn address on the stack and allow the
|
|
|
|
called function to return here instead. Upon return we recover the real
|
2004-10-14 09:37:11 +02:00
|
|
|
return address and use a BX to get back to Thumb mode.
|
|
|
|
|
|
|
|
There are three variations of this code. The first,
|
|
|
|
_interwork_call_via_rN(), will push the return address onto the
|
|
|
|
stack and pop it in _arm_return(). It should only be used if all
|
|
|
|
arguments are passed in registers.
|
|
|
|
|
|
|
|
The second, _interwork_r7_call_via_rN(), instead stores the return
|
|
|
|
address at [r7, #-4]. It is the caller's responsibility to ensure
|
|
|
|
that this address is valid and contains no useful data.
|
|
|
|
|
|
|
|
The third, _interwork_r11_call_via_rN(), works in the same way but
|
|
|
|
uses r11 instead of r7. It is useful if the caller does not really
|
|
|
|
need a frame pointer. */
|
1998-04-01 19:19:01 +02:00
|
|
|
|
|
|
|
.text
|
|
|
|
.align 0
|
|
|
|
|
|
|
|
.code 32
|
1998-10-27 16:15:11 +01:00
|
|
|
.globl _arm_return
|
2005-05-17 17:12:27 +02:00
|
|
|
LSYM(Lstart_arm_return):
|
|
|
|
cfi_start LSYM(Lstart_arm_return) LSYM(Lend_arm_return)
|
|
|
|
cfi_push 0, 0xe, -0x8, 0x8
|
|
|
|
nop @ This nop is for the benefit of debuggers, so that
|
|
|
|
@ backtraces will use the correct unwind information.
|
2003-08-30 17:55:18 +02:00
|
|
|
_arm_return:
|
2005-05-17 17:12:27 +02:00
|
|
|
RETLDM unwind=LSYM(Lstart_arm_return)
|
|
|
|
cfi_end LSYM(Lend_arm_return)
|
2004-10-14 09:37:11 +02:00
|
|
|
|
|
|
|
.globl _arm_return_r7
|
|
|
|
_arm_return_r7:
|
|
|
|
ldr lr, [r7, #-4]
|
|
|
|
bx lr
|
|
|
|
|
|
|
|
.globl _arm_return_r11
|
|
|
|
_arm_return_r11:
|
|
|
|
ldr lr, [r11, #-4]
|
|
|
|
bx lr
|
|
|
|
|
|
|
|
.macro interwork_with_frame frame, register, name, return
|
|
|
|
.code 16
|
|
|
|
|
|
|
|
THUMB_FUNC_START \name
|
|
|
|
|
|
|
|
bx pc
|
|
|
|
nop
|
|
|
|
|
|
|
|
.code 32
|
|
|
|
tst \register, #1
|
|
|
|
streq lr, [\frame, #-4]
|
|
|
|
adreq lr, _arm_return_\frame
|
|
|
|
bx \register
|
|
|
|
|
|
|
|
SIZE (\name)
|
|
|
|
.endm
|
1998-04-01 19:19:01 +02:00
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
.macro interwork register
|
|
|
|
.code 16
|
2000-08-11 02:30:55 +02:00
|
|
|
|
|
|
|
THUMB_FUNC_START _interwork_call_via_\register
|
|
|
|
|
2003-08-30 17:55:18 +02:00
|
|
|
bx pc
|
1998-04-01 19:19:01 +02:00
|
|
|
nop
|
2003-08-30 17:55:18 +02:00
|
|
|
|
|
|
|
.code 32
|
|
|
|
.globl LSYM(Lchange_\register)
|
|
|
|
LSYM(Lchange_\register):
|
1998-04-01 19:19:01 +02:00
|
|
|
tst \register, #1
|
2005-05-17 17:12:27 +02:00
|
|
|
streq lr, [sp, #-8]!
|
1998-04-01 19:19:01 +02:00
|
|
|
adreq lr, _arm_return
|
|
|
|
bx \register
|
1998-10-27 16:15:11 +01:00
|
|
|
|
|
|
|
SIZE (_interwork_call_via_\register)
|
2004-10-14 09:37:11 +02:00
|
|
|
|
|
|
|
interwork_with_frame r7,\register,_interwork_r7_call_via_\register
|
|
|
|
interwork_with_frame r11,\register,_interwork_r11_call_via_\register
|
1998-04-01 19:19:01 +02:00
|
|
|
.endm
|
|
|
|
|
|
|
|
interwork r0
|
|
|
|
interwork r1
|
|
|
|
interwork r2
|
|
|
|
interwork r3
|
|
|
|
interwork r4
|
|
|
|
interwork r5
|
|
|
|
interwork r6
|
|
|
|
interwork r7
|
|
|
|
interwork r8
|
|
|
|
interwork r9
|
|
|
|
interwork sl
|
|
|
|
interwork fp
|
|
|
|
interwork ip
|
|
|
|
interwork sp
|
1998-10-27 16:15:11 +01:00
|
|
|
|
2000-08-11 02:30:55 +02:00
|
|
|
/* The LR case has to be handled a little differently... */
|
1998-10-27 16:15:11 +01:00
|
|
|
.code 16
|
2000-08-11 02:30:55 +02:00
|
|
|
|
|
|
|
THUMB_FUNC_START _interwork_call_via_lr
|
|
|
|
|
1998-10-27 16:15:11 +01:00
|
|
|
bx pc
|
|
|
|
nop
|
|
|
|
|
|
|
|
.code 32
|
|
|
|
.globl .Lchange_lr
|
|
|
|
.Lchange_lr:
|
|
|
|
tst lr, #1
|
2005-05-17 17:12:27 +02:00
|
|
|
stmeqdb r13!, {lr, pc}
|
1998-10-27 16:15:11 +01:00
|
|
|
mov ip, lr
|
|
|
|
adreq lr, _arm_return
|
|
|
|
bx ip
|
|
|
|
|
|
|
|
SIZE (_interwork_call_via_lr)
|
|
|
|
|
1998-04-01 19:19:01 +02:00
|
|
|
#endif /* L_interwork_call_via_rX */
|
backport: thumb2.md: New file.
2007-01-03 Paul Brook <paul@codesourcery.com>
Merge from sourcerygxx-4_1.
gcc/
* config/arm/thumb2.md: New file.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Return True for
Thumb-2.
* config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Ditto.
* config/arm/aout.h (ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
(ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump tables.
* config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output Thumb-2 jump
tables.
(ASM_OUTPUT_ADDR_VEC_ELT): Add !Thumb-2 assertion.
* config/arm/ieee754-df.S: Use macros for Thumb-2/Unified asm
comptibility.
* config/arm/ieee754-sf.S: Ditto.
* config/arm/arm.c (thumb_base_register_rtx_p): Rename...
(thumb1_base_register_rtx_p): ... to this.
(thumb_index_register_rtx_p): Rename...
(thumb1_index_register_rtx_p): ... to this.
(thumb_output_function_prologue): Rename...
(thumb1_output_function_prologue): ... to this.
(thumb_legitimate_address_p): Rename...
(thumb1_legitimate_address_p): ... to this.
(thumb_rtx_costs): Rename...
(thumb1_rtx_costs): ... to this.
(thumb_compute_save_reg_mask): Rename...
(thumb1_compute_save_reg_mask): ... to this.
(thumb_final_prescan_insn): Rename...
(thumb1_final_prescan_insn): ... to this.
(thumb_expand_epilogue): Rename...
(thumb1_expand_epilogue): ... to this.
(arm_unwind_emit_stm): Rename...
(arm_unwind_emit_sequence): ... to this.
(thumb2_legitimate_index_p, thumb2_legitimate_address_p,
thumb1_compute_save_reg_mask, arm_dwarf_handle_frame_unspec,
thumb2_index_mul_operand, output_move_vfp, arm_shift_nmem,
arm_save_coproc_regs, thumb_set_frame_pointer, arm_print_condition,
thumb2_final_prescan_insn, thumb2_asm_output_opcode, arm_output_shift,
thumb2_output_casesi): New functions.
(TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define.
(FL_THUMB2, FL_NOTM, FL_DIV, FL_FOR_ARCH6T2, FL_FOR_ARCH7,
FL_FOR_ARCH7A, FL_FOR_ARCH7R, FL_FOR_ARCH7M, ARM_LSL_NAME,
THUMB2_WORK_REGS): Define.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv, arm_condexec_count,
arm_condexec_mask, arm_condexec_masklen)): New variables.
(all_architectures): Add armv6t2, armv7, armv7a, armv7r and armv7m.
(arm_override_options): Check new CPU capabilities.
Set new architecture flag variables.
(arm_isr_value): Handle v7m interrupt functions.
(user_return_insn): Return 0 for v7m interrupt functions. Handle
Thumb-2.
(const_ok_for_arm): Handle Thumb-2 constants.
(arm_gen_constant): Ditto. Use movw when available.
(arm_function_ok_for_sibcall): Return false for v7m interrupt
functions.
(legitimize_pic_address, arm_call_tls_get_addr): Handle Thumb-2.
(thumb_find_work_register, arm_load_pic_register,
legitimize_tls_address, arm_address_cost, load_multiple_sequence,
emit_ldm_seq, emit_stm_seq, arm_select_cc_mode, get_jump_table_size,
print_multi_reg, output_mov_long_double_fpa_from_arm,
output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm,
output_mov_double_fpa_from_arm, output_move_double,
arm_compute_save_reg_mask, arm_compute_save_reg0_reg12_mask,
output_return_instruction, arm_output_function_prologue,
arm_output_epilogue, arm_get_frame_offsets, arm_regno_class,
arm_output_mi_thunk, thumb_set_return_address): Ditto.
(arm_expand_prologue): Handle Thumb-2. Use arm_save_coproc_regs.
(arm_coproc_mem_operand): Allow POST_INC/PRE_DEC.
(arithmetic_instr, shift_op): Use arm_shift_nmem.
(arm_print_operand): Use arm_print_condition. Handle '(', ')', '.',
'!' and 'L'.
(arm_final_prescan_insn): Use extract_constrain_insn_cached.
(thumb_expand_prologue): Use thumb_set_frame_pointer.
(arm_file_start): Output directive for unified syntax.
(arm_unwind_emit_set): Handle stack alignment instruction.
* config/arm/lib1funcs.asm: Remove default for __ARM_ARCH__.
Add v6t2, v7, v7a, v7r and v7m.
(RETLDM): Add Thumb-2 code.
(do_it, shift1, do_push, do_pop, COND, THUMB_SYNTAX): New macros.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __thumb2__.
(TARGET_THUMB1, TARGET_32BIT, TARGET_THUMB2, TARGET_DSP_MULTIPLY,
TARGET_INT_SIMD, TARGET_UNIFIED_ASM, ARM_FT_STACKALIGN, IS_STACKALIGN,
THUMB2_TRAMPOLINE_TEMPLATE, TRAMPOLINE_ADJUST_ADDRESS,
ASM_OUTPUT_OPCODE, THUMB2_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_LEGITIMIZE_ADDRESS, CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_SHORTEN_MODE, ADDR_VEC_ALIGN, ASM_OUTPUT_CASE_END,
ADJUST_INSN_LENGTH): Define.
(TARGET_REALLY_IWMMXT, TARGET_IWMMXT_ABI, CONDITIONAL_REGISTER_USAGE,
STATIC_CHAIN_REGNUM, HARD_REGNO_NREGS, INDEX_REG_CLASS,
BASE_REG_CLASS, MODE_BASE_REG_CLASS, SMALL_REGISTER_CLASSES,
PREFERRED_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS,
SECONDARY_INPUT_RELOAD_CLASS, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE, HAVE_PRE_INCREMENT,
HAVE_POST_DECREMENT, HAVE_PRE_DECREMENT, HAVE_PRE_MODIFY_DISP,
HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_REG, HAVE_POST_MODIFY_REG,
REGNO_MODE_OK_FOR_BASE_P, LEGITIMATE_CONSTANT_P,
REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS,
GO_IF_MODE_DEPENDENT_ADDRESS, MEMORY_MOVE_COST, BRANCH_COST,
ASM_APP_OFF, ASM_OUTPUT_CASE_LABEL, ARM_DECLARE_FUNCTION_NAME,
FINAL_PRESCAN_INSN, PRINT_OPERAND_PUNCT_VALID_P,
PRINT_OPERAND_ADDRESS): Adjust for Thumb-2.
(arm_arch_notm, arm_arch_thumb2, arm_arch_hwdiv): New declarations.
* config/arm/arm-cores.def: Add arm1156t2-s, cortex-a8, cortex-r4 and
cortex-m3.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm-protos.h: Update prototypes.
* config/arm/vfp.md: Enable patterns for Thumb-2.
(arm_movsi_vfp): Add movw alternative. Use output_move_vfp.
(arm_movdi_vfp, movsf_vfp, movdf_vfp): Use output_move_vfp.
(thumb2_movsi_vfp, thumb2_movdi_vfp, thumb2_movsf_vfp,
thumb2_movdf_vfp, thumb2_movsfcc_vfp, thumb2_movdfcc_vfp): New.
* config/arm/libunwind.S: Add Thumb-2 code.
* config/arm/constraints.md: Update include Thumb-2.
* config/arm/ieee754-sf.S: Add Thumb-2/Unified asm support.
* config/arm/ieee754-df.S: Ditto.
* config/arm/bpabi.S: Ditto.
* config/arm/t-arm (MD_INCLUDES): Add thumb2.md.
* config/arm/predicates.md (low_register_operand,
low_reg_or_int_operand, thumb_16bit_operator): New.
(thumb_cmp_operand, thumb_cmpneg_operand): Rename...
(thumb1_cmp_operand, thumb1_cmpneg_operand): ... to this.
* config/arm/t-arm-elf: Add armv7 multilib.
* config/arm/arm.md: Update patterns for Thumb-2 and Unified asm.
Include thumb2.md.
(UNSPEC_STACK_ALIGN, ce_count): New.
(arm_incscc, arm_decscc, arm_umaxsi3, arm_uminsi3,
arm_zero_extendsidi2, arm_zero_extendqidi2): New
insns/expanders.
* config/arm/fpa.md: Update patterns for Thumb-2 and Unified asm.
(thumb2_movsf_fpa, thumb2_movdf_fpa, thumb2_movxf_fpa,
thumb2_movsfcc_fpa, thumb2_movdfcc_fpa): New insns.
* config/arm/cirrus.md: Update patterns for Thumb-2 and Unified asm.
(cirrus_thumb2_movdi, cirrus_thumb2_movsi_insn,
thumb2_cirrus_movsf_hard_insn, thumb2_cirrus_movdf_hard_insn): New
insns.
* doc/extend.texi: Document ARMv7-M interrupt functions.
* doc/invoke.texi: Document Thumb-2 new cores+architectures.
From-SVN: r120408
2007-01-04 00:48:10 +01:00
|
|
|
#endif /* !__thumb2__ */
|
2009-06-21 22:48:15 +02:00
|
|
|
|
|
|
|
/* Functions to support compact pic switch tables in thumb1 state.
|
|
|
|
All these routines take an index into the table in r0. The
|
|
|
|
table is at LR & ~1 (but this must be rounded up in the case
|
|
|
|
of 32-bit entires). They are only permitted to clobber r12
|
|
|
|
and r14 and r0 must be preserved on exit. */
|
|
|
|
#ifdef L_thumb1_case_sqi
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 0
|
|
|
|
.force_thumb
|
|
|
|
.syntax unified
|
|
|
|
THUMB_FUNC_START __gnu_thumb1_case_sqi
|
|
|
|
push {r1}
|
|
|
|
mov r1, lr
|
|
|
|
lsrs r1, r1, #1
|
|
|
|
lsls r1, r1, #1
|
|
|
|
ldrsb r1, [r1, r0]
|
|
|
|
lsls r1, r1, #1
|
|
|
|
add lr, lr, r1
|
|
|
|
pop {r1}
|
|
|
|
bx lr
|
|
|
|
SIZE (__gnu_thumb1_case_sqi)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef L_thumb1_case_uqi
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 0
|
|
|
|
.force_thumb
|
|
|
|
.syntax unified
|
|
|
|
THUMB_FUNC_START __gnu_thumb1_case_uqi
|
|
|
|
push {r1}
|
|
|
|
mov r1, lr
|
|
|
|
lsrs r1, r1, #1
|
|
|
|
lsls r1, r1, #1
|
|
|
|
ldrb r1, [r1, r0]
|
|
|
|
lsls r1, r1, #1
|
|
|
|
add lr, lr, r1
|
|
|
|
pop {r1}
|
|
|
|
bx lr
|
|
|
|
SIZE (__gnu_thumb1_case_uqi)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef L_thumb1_case_shi
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 0
|
|
|
|
.force_thumb
|
|
|
|
.syntax unified
|
|
|
|
THUMB_FUNC_START __gnu_thumb1_case_shi
|
|
|
|
push {r0, r1}
|
|
|
|
mov r1, lr
|
|
|
|
lsrs r1, r1, #1
|
|
|
|
lsls r0, r0, #1
|
|
|
|
lsls r1, r1, #1
|
|
|
|
ldrsh r1, [r1, r0]
|
|
|
|
lsls r1, r1, #1
|
|
|
|
add lr, lr, r1
|
|
|
|
pop {r0, r1}
|
|
|
|
bx lr
|
|
|
|
SIZE (__gnu_thumb1_case_shi)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef L_thumb1_case_uhi
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 0
|
|
|
|
.force_thumb
|
|
|
|
.syntax unified
|
|
|
|
THUMB_FUNC_START __gnu_thumb1_case_uhi
|
|
|
|
push {r0, r1}
|
|
|
|
mov r1, lr
|
|
|
|
lsrs r1, r1, #1
|
|
|
|
lsls r0, r0, #1
|
|
|
|
lsls r1, r1, #1
|
|
|
|
ldrh r1, [r1, r0]
|
|
|
|
lsls r1, r1, #1
|
|
|
|
add lr, lr, r1
|
|
|
|
pop {r0, r1}
|
|
|
|
bx lr
|
|
|
|
SIZE (__gnu_thumb1_case_uhi)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef L_thumb1_case_si
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 0
|
|
|
|
.force_thumb
|
|
|
|
.syntax unified
|
|
|
|
THUMB_FUNC_START __gnu_thumb1_case_si
|
|
|
|
push {r0, r1}
|
|
|
|
mov r1, lr
|
|
|
|
adds.n r1, r1, #2 /* Align to word. */
|
|
|
|
lsrs r1, r1, #2
|
|
|
|
lsls r0, r0, #2
|
|
|
|
lsls r1, r1, #2
|
|
|
|
ldr r0, [r1, r0]
|
|
|
|
adds r0, r0, r1
|
|
|
|
mov lr, r0
|
|
|
|
pop {r0, r1}
|
|
|
|
mov pc, lr /* We know we were called from thumb code. */
|
|
|
|
SIZE (__gnu_thumb1_case_si)
|
|
|
|
#endif
|
|
|
|
|
2004-04-28 15:24:30 +02:00
|
|
|
#endif /* Arch supports thumb. */
|
2003-08-27 14:52:58 +02:00
|
|
|
|
2015-05-15 18:57:10 +02:00
|
|
|
.macro CFI_START_FUNCTION
|
|
|
|
.cfi_startproc
|
|
|
|
.cfi_remember_state
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro CFI_END_FUNCTION
|
|
|
|
.cfi_restore_state
|
|
|
|
.cfi_endproc
|
|
|
|
.endm
|
|
|
|
|
2004-09-01 08:08:34 +02:00
|
|
|
#ifndef __symbian__
|
2008-03-03 15:30:48 +01:00
|
|
|
#ifndef __ARM_ARCH_6M__
|
2003-08-27 14:52:58 +02:00
|
|
|
#include "ieee754-df.S"
|
|
|
|
#include "ieee754-sf.S"
|
2004-08-11 04:50:14 +02:00
|
|
|
#include "bpabi.S"
|
2008-03-03 15:30:48 +01:00
|
|
|
#else /* __ARM_ARCH_6M__ */
|
|
|
|
#include "bpabi-v6m.S"
|
|
|
|
#endif /* __ARM_ARCH_6M__ */
|
|
|
|
#endif /* !__symbian__ */
|