comparison gcc/config/bfin/bfin.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* The Blackfin code generation auxiliary output file. 1 /* The Blackfin code generation auxiliary output file.
2 Copyright (C) 2005-2017 Free Software Foundation, Inc. 2 Copyright (C) 2005-2018 Free Software Foundation, Inc.
3 Contributed by Analog Devices. 3 Contributed by Analog Devices.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it 7 GCC is free software; you can redistribute it and/or modify it
15 License for more details. 15 License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see 18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */ 19 <http://www.gnu.org/licenses/>. */
20
21 #define IN_TARGET_CODE 1
20 22
21 #include "config.h" 23 #include "config.h"
22 #include "system.h" 24 #include "system.h"
23 #include "coretypes.h" 25 #include "coretypes.h"
24 #include "backend.h" 26 #include "backend.h"
3769 3771
3770 /* If the loop isn't entered at the top, also create a jump to the entry 3772 /* If the loop isn't entered at the top, also create a jump to the entry
3771 point. */ 3773 point. */
3772 if (!loop->incoming_src && loop->head != loop->incoming_dest) 3774 if (!loop->incoming_src && loop->head != loop->incoming_dest)
3773 { 3775 {
3774 rtx label = BB_HEAD (loop->incoming_dest); 3776 rtx_insn *label = BB_HEAD (loop->incoming_dest);
3775 /* If we're jumping to the final basic block in the loop, and there's 3777 /* If we're jumping to the final basic block in the loop, and there's
3776 only one cheap instruction before the end (typically an increment of 3778 only one cheap instruction before the end (typically an increment of
3777 an induction variable), we can just emit a copy here instead of a 3779 an induction variable), we can just emit a copy here instead of a
3778 jump. */ 3780 jump. */
3779 if (loop->incoming_dest == loop->tail 3781 if (loop->incoming_dest == loop->tail
4603 { 4605 {
4604 if (JUMP_P (insn) 4606 if (JUMP_P (insn)
4605 && any_condjump_p (insn) 4607 && any_condjump_p (insn)
4606 && (cbranch_predicted_taken_p (insn))) 4608 && (cbranch_predicted_taken_p (insn)))
4607 { 4609 {
4608 rtx target = JUMP_LABEL (insn); 4610 rtx_insn *target = JUMP_LABEL_AS_INSN (insn);
4609 rtx_insn *next = next_real_insn (target); 4611 rtx_insn *next = next_real_insn (target);
4610 4612
4611 if (GET_CODE (PATTERN (next)) == UNSPEC_VOLATILE 4613 if (GET_CODE (PATTERN (next)) == UNSPEC_VOLATILE
4612 && get_attr_type (next) == TYPE_STALL) 4614 && get_attr_type (next) == TYPE_STALL)
4613 continue; 4615 continue;
4903 } 4905 }
4904 4906
4905 /* Table of valid machine attributes. */ 4907 /* Table of valid machine attributes. */
4906 static const struct attribute_spec bfin_attribute_table[] = 4908 static const struct attribute_spec bfin_attribute_table[] =
4907 { 4909 {
4908 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler, 4910 /* { name, min_len, max_len, decl_req, type_req, fn_type_req,
4909 affects_type_identity } */ 4911 affects_type_identity, handler, exclude } */
4910 { "interrupt_handler", 0, 0, false, true, true, handle_int_attribute, 4912 { "interrupt_handler", 0, 0, false, true, true, false,
4911 false }, 4913 handle_int_attribute, NULL },
4912 { "exception_handler", 0, 0, false, true, true, handle_int_attribute, 4914 { "exception_handler", 0, 0, false, true, true, false,
4913 false }, 4915 handle_int_attribute, NULL },
4914 { "nmi_handler", 0, 0, false, true, true, handle_int_attribute, false }, 4916 { "nmi_handler", 0, 0, false, true, true, false, handle_int_attribute,
4915 { "nesting", 0, 0, false, true, true, NULL, false }, 4917 NULL },
4916 { "kspisusp", 0, 0, false, true, true, NULL, false }, 4918 { "nesting", 0, 0, false, true, true, false, NULL, NULL },
4917 { "saveall", 0, 0, false, true, true, NULL, false }, 4919 { "kspisusp", 0, 0, false, true, true, false, NULL, NULL },
4918 { "longcall", 0, 0, false, true, true, bfin_handle_longcall_attribute, 4920 { "saveall", 0, 0, false, true, true, false, NULL, NULL },
4919 false }, 4921 { "longcall", 0, 0, false, true, true, false,
4920 { "shortcall", 0, 0, false, true, true, bfin_handle_longcall_attribute, 4922 bfin_handle_longcall_attribute, NULL },
4921 false }, 4923 { "shortcall", 0, 0, false, true, true, false,
4922 { "l1_text", 0, 0, true, false, false, bfin_handle_l1_text_attribute, 4924 bfin_handle_longcall_attribute, NULL },
4923 false }, 4925 { "l1_text", 0, 0, true, false, false, false,
4924 { "l1_data", 0, 0, true, false, false, bfin_handle_l1_data_attribute, 4926 bfin_handle_l1_text_attribute, NULL },
4925 false }, 4927 { "l1_data", 0, 0, true, false, false, false,
4926 { "l1_data_A", 0, 0, true, false, false, bfin_handle_l1_data_attribute, 4928 bfin_handle_l1_data_attribute, NULL },
4927 false }, 4929 { "l1_data_A", 0, 0, true, false, false, false,
4928 { "l1_data_B", 0, 0, true, false, false, bfin_handle_l1_data_attribute, 4930 bfin_handle_l1_data_attribute, NULL },
4929 false }, 4931 { "l1_data_B", 0, 0, true, false, false, false,
4930 { "l2", 0, 0, true, false, false, bfin_handle_l2_attribute, false }, 4932 bfin_handle_l1_data_attribute, NULL },
4931 { NULL, 0, 0, false, false, false, NULL, false } 4933 { "l2", 0, 0, true, false, false, false, bfin_handle_l2_attribute, NULL },
4934 { NULL, 0, 0, false, false, false, false, NULL, NULL }
4932 }; 4935 };
4933 4936
4934 /* Implementation of TARGET_ASM_INTEGER. When using FD-PIC, we need to 4937 /* Implementation of TARGET_ASM_INTEGER. When using FD-PIC, we need to
4935 tell the assembler to generate pointers to function descriptors in 4938 tell the assembler to generate pointers to function descriptors in
4936 some cases. */ 4939 some cases. */