2004-08-11 04:50:14 +02:00
|
|
|
/* Miscellaneous BPABI functions.
|
|
|
|
|
2016-01-04 15:30:50 +01:00
|
|
|
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
2004-08-11 04:50:14 +02:00
|
|
|
Contributed by CodeSourcery, LLC.
|
|
|
|
|
|
|
|
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
|
2004-08-11 04:50:14 +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/>. */
|
2004-08-11 04:50:14 +02:00
|
|
|
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_sections .debug_frame
|
|
|
|
|
2010-04-17 17:34:25 +02:00
|
|
|
#ifdef __ARM_EABI__
|
|
|
|
/* Some attributes that are common to all routines in this file. */
|
|
|
|
/* Tag_ABI_align_needed: This code does not require 8-byte
|
|
|
|
alignment from the caller. */
|
|
|
|
/* .eabi_attribute 24, 0 -- default setting. */
|
|
|
|
/* Tag_ABI_align_preserved: This code preserves 8-byte
|
|
|
|
alignment in any callee. */
|
|
|
|
.eabi_attribute 25, 1
|
|
|
|
#endif /* __ARM_EABI__ */
|
|
|
|
|
2004-08-11 04:50:14 +02:00
|
|
|
#ifdef L_aeabi_lcmp
|
|
|
|
|
|
|
|
ARM_FUNC_START aeabi_lcmp
|
2007-05-03 00:16:21 +02:00
|
|
|
cmp xxh, yyh
|
|
|
|
do_it lt
|
|
|
|
movlt r0, #-1
|
|
|
|
do_it gt
|
|
|
|
movgt r0, #1
|
|
|
|
do_it ne
|
|
|
|
RETc(ne)
|
|
|
|
subs r0, xxl, yyl
|
|
|
|
do_it lo
|
|
|
|
movlo r0, #-1
|
|
|
|
do_it hi
|
|
|
|
movhi r0, #1
|
2004-08-11 04:50:14 +02:00
|
|
|
RET
|
|
|
|
FUNC_END aeabi_lcmp
|
|
|
|
|
|
|
|
#endif /* L_aeabi_lcmp */
|
|
|
|
|
|
|
|
#ifdef L_aeabi_ulcmp
|
|
|
|
|
|
|
|
ARM_FUNC_START aeabi_ulcmp
|
|
|
|
cmp xxh, yyh
|
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
|
|
|
do_it lo
|
2004-08-11 04:50:14 +02:00
|
|
|
movlo r0, #-1
|
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
|
|
|
do_it hi
|
2004-08-11 04:50:14 +02:00
|
|
|
movhi r0, #1
|
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
|
|
|
do_it ne
|
2004-08-11 04:50:14 +02:00
|
|
|
RETc(ne)
|
|
|
|
cmp xxl, yyl
|
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
|
|
|
do_it lo
|
2004-08-11 04:50:14 +02:00
|
|
|
movlo r0, #-1
|
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
|
|
|
do_it hi
|
2004-08-11 04:50:14 +02:00
|
|
|
movhi r0, #1
|
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
|
|
|
do_it eq
|
2004-08-11 04:50:14 +02:00
|
|
|
moveq r0, #0
|
|
|
|
RET
|
|
|
|
FUNC_END aeabi_ulcmp
|
|
|
|
|
|
|
|
#endif /* L_aeabi_ulcmp */
|
|
|
|
|
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 test_div_by_zero signed
|
|
|
|
/* Tail-call to divide-by-zero handlers which may be overridden by the user,
|
|
|
|
so unwinding works properly. */
|
|
|
|
#if defined(__thumb2__)
|
2015-02-17 18:39:22 +01:00
|
|
|
cbnz yyh, 2f
|
|
|
|
cbnz yyl, 2f
|
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 xxh, #0
|
2015-02-17 18:39:22 +01:00
|
|
|
.ifc \signed, unsigned
|
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
|
|
|
do_it eq
|
|
|
|
cmpeq xxl, #0
|
2015-02-17 18:39:22 +01:00
|
|
|
do_it ne, t
|
|
|
|
movne xxh, #0xffffffff
|
|
|
|
movne xxl, #0xffffffff
|
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
|
2015-02-17 18:39:22 +01:00
|
|
|
do_it lt, tt
|
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
|
|
|
movlt xxl, #0
|
|
|
|
movlt xxh, #0x80000000
|
2015-02-17 18:39:22 +01:00
|
|
|
blt 1f
|
|
|
|
do_it eq
|
|
|
|
cmpeq xxl, #0
|
|
|
|
do_it ne, t
|
|
|
|
movne xxh, #0x7fffffff
|
|
|
|
movne xxl, #0xffffffff
|
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
|
2015-02-17 18:39:22 +01:00
|
|
|
1:
|
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
|
|
|
b SYM (__aeabi_ldiv0) __PLT__
|
2015-02-17 18:39:22 +01:00
|
|
|
2:
|
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
|
|
|
|
/* Note: Thumb-1 code calls via an ARM shim on processors which
|
|
|
|
support ARM mode. */
|
|
|
|
cmp yyh, #0
|
|
|
|
cmpeq yyl, #0
|
|
|
|
bne 2f
|
|
|
|
cmp xxh, #0
|
|
|
|
.ifc \signed, unsigned
|
2015-02-17 18:39:22 +01:00
|
|
|
cmpeq xxl, #0
|
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
|
|
|
movne xxh, #0xffffffff
|
|
|
|
movne xxl, #0xffffffff
|
|
|
|
.else
|
|
|
|
movlt xxh, #0x80000000
|
|
|
|
movlt xxl, #0
|
2015-02-17 18:39:22 +01:00
|
|
|
blt 1f
|
|
|
|
cmpeq xxl, #0
|
|
|
|
movne xxh, #0x7fffffff
|
|
|
|
movne xxl, #0xffffffff
|
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
|
2015-02-17 18:39:22 +01:00
|
|
|
1:
|
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
|
|
|
b SYM (__aeabi_ldiv0) __PLT__
|
|
|
|
2:
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
|
2014-06-18 17:40:31 +02:00
|
|
|
/* we can use STRD/LDRD on v5TE and later, and any Thumb-2 architecture. */
|
|
|
|
#if (defined(__ARM_EABI__) \
|
|
|
|
&& (defined(__thumb2__) \
|
|
|
|
|| (__ARM_ARCH >= 5 && defined(__TARGET_FEATURE_DSP))))
|
|
|
|
#define CAN_USE_LDRD 1
|
|
|
|
#else
|
|
|
|
#define CAN_USE_LDRD 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* set up stack from for call to __udivmoddi4. At the end of the macro the
|
|
|
|
stack is arranged as follows:
|
|
|
|
sp+12 / space for remainder
|
|
|
|
sp+8 \ (written by __udivmoddi4)
|
|
|
|
sp+4 lr
|
|
|
|
sp+0 sp+8 [rp (remainder pointer) argument for __udivmoddi4]
|
|
|
|
|
|
|
|
*/
|
|
|
|
.macro push_for_divide fname
|
|
|
|
#if defined(__thumb2__) && CAN_USE_LDRD
|
|
|
|
sub ip, sp, #8
|
|
|
|
strd ip, lr, [sp, #-16]!
|
|
|
|
#else
|
|
|
|
sub sp, sp, #8
|
|
|
|
do_push {sp, lr}
|
|
|
|
#endif
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_adjust_cfa_offset 16
|
|
|
|
.cfi_offset 14, -12
|
2014-06-18 17:40:31 +02:00
|
|
|
.endm
|
|
|
|
|
|
|
|
/* restore stack */
|
|
|
|
.macro pop_for_divide
|
|
|
|
ldr lr, [sp, #4]
|
|
|
|
#if CAN_USE_LDRD
|
|
|
|
ldrd r2, r3, [sp, #8]
|
|
|
|
add sp, sp, #16
|
|
|
|
#else
|
|
|
|
add sp, sp, #8
|
|
|
|
do_pop {r2, r3}
|
|
|
|
#endif
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_restore 14
|
|
|
|
.cfi_adjust_cfa_offset 0
|
2014-06-18 17:40:31 +02:00
|
|
|
.endm
|
|
|
|
|
2004-08-11 04:50:14 +02:00
|
|
|
#ifdef L_aeabi_ldivmod
|
|
|
|
|
2014-06-18 17:39:56 +02:00
|
|
|
/* Perform 64 bit signed division.
|
|
|
|
Inputs:
|
|
|
|
r0:r1 numerator
|
|
|
|
r2:r3 denominator
|
|
|
|
Outputs:
|
|
|
|
r0:r1 quotient
|
|
|
|
r2:r3 remainder
|
|
|
|
*/
|
2004-08-11 04:50:14 +02:00
|
|
|
ARM_FUNC_START aeabi_ldivmod
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_startproc
|
2014-06-18 17:38:48 +02:00
|
|
|
test_div_by_zero signed
|
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
|
|
|
|
2014-06-18 17:42:21 +02:00
|
|
|
push_for_divide __aeabi_ldivmod
|
2014-06-18 17:42:53 +02:00
|
|
|
cmp xxh, #0
|
|
|
|
blt 1f
|
|
|
|
cmp yyh, #0
|
|
|
|
blt 2f
|
|
|
|
/* arguments in (r0:r1), (r2:r3) and *sp */
|
|
|
|
bl SYM(__udivmoddi4) __PLT__
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_remember_state
|
2014-06-18 17:42:53 +02:00
|
|
|
pop_for_divide
|
|
|
|
RET
|
|
|
|
|
|
|
|
1: /* xxh:xxl is negative */
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_restore_state
|
2014-06-18 17:42:53 +02:00
|
|
|
negs xxl, xxl
|
|
|
|
sbc xxh, xxh, xxh, lsl #1 /* Thumb-2 has no RSC, so use X - 2X */
|
|
|
|
cmp yyh, #0
|
|
|
|
blt 3f
|
|
|
|
/* arguments in (r0:r1), (r2:r3) and *sp */
|
|
|
|
bl SYM(__udivmoddi4) __PLT__
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_remember_state
|
2014-06-18 17:42:53 +02:00
|
|
|
pop_for_divide
|
|
|
|
negs xxl, xxl
|
|
|
|
sbc xxh, xxh, xxh, lsl #1 /* Thumb-2 has no RSC, so use X - 2X */
|
|
|
|
negs yyl, yyl
|
|
|
|
sbc yyh, yyh, yyh, lsl #1 /* Thumb-2 has no RSC, so use X - 2X */
|
|
|
|
RET
|
|
|
|
|
|
|
|
2: /* only yyh:yyl is negative */
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_restore_state
|
2014-06-18 17:42:53 +02:00
|
|
|
negs yyl, yyl
|
|
|
|
sbc yyh, yyh, yyh, lsl #1 /* Thumb-2 has no RSC, so use X - 2X */
|
|
|
|
/* arguments in (r0:r1), (r2:r3) and *sp */
|
|
|
|
bl SYM(__udivmoddi4) __PLT__
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_remember_state
|
2014-06-18 17:42:53 +02:00
|
|
|
pop_for_divide
|
|
|
|
negs xxl, xxl
|
|
|
|
sbc xxh, xxh, xxh, lsl #1 /* Thumb-2 has no RSC, so use X - 2X */
|
|
|
|
RET
|
|
|
|
|
|
|
|
3: /* both xxh:xxl and yyh:yyl are negative */
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_restore_state
|
2014-06-18 17:42:53 +02:00
|
|
|
negs yyl, yyl
|
|
|
|
sbc yyh, yyh, yyh, lsl #1 /* Thumb-2 has no RSC, so use X - 2X */
|
2014-06-18 17:42:21 +02:00
|
|
|
/* arguments in (r0:r1), (r2:r3) and *sp */
|
2014-06-18 17:42:53 +02:00
|
|
|
bl SYM(__udivmoddi4) __PLT__
|
2014-06-18 17:42:21 +02:00
|
|
|
pop_for_divide
|
2014-06-18 17:42:53 +02:00
|
|
|
negs yyl, yyl
|
|
|
|
sbc yyh, yyh, yyh, lsl #1 /* Thumb-2 has no RSC, so use X - 2X */
|
2004-08-11 04:50:14 +02:00
|
|
|
RET
|
2014-06-18 17:42:53 +02:00
|
|
|
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_endproc
|
2004-08-11 04:50:14 +02:00
|
|
|
|
|
|
|
#endif /* L_aeabi_ldivmod */
|
|
|
|
|
|
|
|
#ifdef L_aeabi_uldivmod
|
|
|
|
|
2014-06-18 17:39:56 +02:00
|
|
|
/* Perform 64 bit signed division.
|
|
|
|
Inputs:
|
|
|
|
r0:r1 numerator
|
|
|
|
r2:r3 denominator
|
|
|
|
Outputs:
|
|
|
|
r0:r1 quotient
|
|
|
|
r2:r3 remainder
|
|
|
|
*/
|
2004-08-11 04:50:14 +02:00
|
|
|
ARM_FUNC_START aeabi_uldivmod
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_startproc
|
2014-06-18 17:38:48 +02:00
|
|
|
test_div_by_zero unsigned
|
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
|
|
|
|
2014-06-18 17:40:31 +02:00
|
|
|
push_for_divide __aeabi_uldivmod
|
|
|
|
/* arguments in (r0:r1), (r2:r3) and *sp */
|
2014-06-18 17:41:27 +02:00
|
|
|
bl SYM(__udivmoddi4) __PLT__
|
2014-06-18 17:40:31 +02:00
|
|
|
pop_for_divide
|
2004-08-11 04:50:14 +02:00
|
|
|
RET
|
2014-06-18 17:43:35 +02:00
|
|
|
.cfi_endproc
|
2013-04-04 20:42:19 +02:00
|
|
|
|
2004-08-11 04:50:14 +02:00
|
|
|
#endif /* L_aeabi_divmod */
|
|
|
|
|