⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rs6000.c

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
static conststruct processor_costs rios1_cost = {  COSTS_N_INSNS (5),    /* mulsi */  COSTS_N_INSNS (4),    /* mulsi_const */  COSTS_N_INSNS (3),    /* mulsi_const9 */  COSTS_N_INSNS (5),    /* muldi */  COSTS_N_INSNS (19),   /* divsi */  COSTS_N_INSNS (19),   /* divdi */  COSTS_N_INSNS (2),    /* fp */  COSTS_N_INSNS (2),    /* dmul */  COSTS_N_INSNS (19),   /* sdiv */  COSTS_N_INSNS (19),   /* ddiv */};/* Instruction costs on RIOS2 processors.  */static conststruct processor_costs rios2_cost = {  COSTS_N_INSNS (2),    /* mulsi */  COSTS_N_INSNS (2),    /* mulsi_const */  COSTS_N_INSNS (2),    /* mulsi_const9 */  COSTS_N_INSNS (2),    /* muldi */  COSTS_N_INSNS (13),   /* divsi */  COSTS_N_INSNS (13),   /* divdi */  COSTS_N_INSNS (2),    /* fp */  COSTS_N_INSNS (2),    /* dmul */  COSTS_N_INSNS (17),   /* sdiv */  COSTS_N_INSNS (17),   /* ddiv */};/* Instruction costs on RS64A processors.  */static conststruct processor_costs rs64a_cost = {  COSTS_N_INSNS (20),   /* mulsi */  COSTS_N_INSNS (12),   /* mulsi_const */  COSTS_N_INSNS (8),    /* mulsi_const9 */  COSTS_N_INSNS (34),   /* muldi */  COSTS_N_INSNS (65),   /* divsi */  COSTS_N_INSNS (67),   /* divdi */  COSTS_N_INSNS (4),    /* fp */  COSTS_N_INSNS (4),    /* dmul */  COSTS_N_INSNS (31),   /* sdiv */  COSTS_N_INSNS (31),   /* ddiv */};/* Instruction costs on MPCCORE processors.  */static conststruct processor_costs mpccore_cost = {  COSTS_N_INSNS (2),    /* mulsi */  COSTS_N_INSNS (2),    /* mulsi_const */  COSTS_N_INSNS (2),    /* mulsi_const9 */  COSTS_N_INSNS (2),    /* muldi */  COSTS_N_INSNS (6),    /* divsi */  COSTS_N_INSNS (6),    /* divdi */  COSTS_N_INSNS (4),    /* fp */  COSTS_N_INSNS (5),    /* dmul */  COSTS_N_INSNS (10),   /* sdiv */  COSTS_N_INSNS (17),   /* ddiv */};/* Instruction costs on PPC403 processors.  */static conststruct processor_costs ppc403_cost = {  COSTS_N_INSNS (4),    /* mulsi */  COSTS_N_INSNS (4),    /* mulsi_const */  COSTS_N_INSNS (4),    /* mulsi_const9 */  COSTS_N_INSNS (4),    /* muldi */  COSTS_N_INSNS (33),   /* divsi */  COSTS_N_INSNS (33),   /* divdi */  COSTS_N_INSNS (11),   /* fp */  COSTS_N_INSNS (11),   /* dmul */  COSTS_N_INSNS (11),   /* sdiv */  COSTS_N_INSNS (11),   /* ddiv */};/* Instruction costs on PPC405 processors.  */static conststruct processor_costs ppc405_cost = {  COSTS_N_INSNS (5),    /* mulsi */  COSTS_N_INSNS (4),    /* mulsi_const */  COSTS_N_INSNS (3),    /* mulsi_const9 */  COSTS_N_INSNS (5),    /* muldi */  COSTS_N_INSNS (35),   /* divsi */  COSTS_N_INSNS (35),   /* divdi */  COSTS_N_INSNS (11),   /* fp */  COSTS_N_INSNS (11),   /* dmul */  COSTS_N_INSNS (11),   /* sdiv */  COSTS_N_INSNS (11),   /* ddiv */};/* Instruction costs on PPC440 processors.  */static conststruct processor_costs ppc440_cost = {  COSTS_N_INSNS (3),    /* mulsi */  COSTS_N_INSNS (2),    /* mulsi_const */  COSTS_N_INSNS (2),    /* mulsi_const9 */  COSTS_N_INSNS (3),    /* muldi */  COSTS_N_INSNS (34),   /* divsi */  COSTS_N_INSNS (34),   /* divdi */  COSTS_N_INSNS (5),    /* fp */  COSTS_N_INSNS (5),    /* dmul */  COSTS_N_INSNS (19),   /* sdiv */  COSTS_N_INSNS (33),   /* ddiv */};/* Instruction costs on PPC601 processors.  */static conststruct processor_costs ppc601_cost = {  COSTS_N_INSNS (5),    /* mulsi */  COSTS_N_INSNS (5),    /* mulsi_const */  COSTS_N_INSNS (5),    /* mulsi_const9 */  COSTS_N_INSNS (5),    /* muldi */  COSTS_N_INSNS (36),   /* divsi */  COSTS_N_INSNS (36),   /* divdi */  COSTS_N_INSNS (4),    /* fp */  COSTS_N_INSNS (5),    /* dmul */  COSTS_N_INSNS (17),   /* sdiv */  COSTS_N_INSNS (31),   /* ddiv */};/* Instruction costs on PPC603 processors.  */static conststruct processor_costs ppc603_cost = {  COSTS_N_INSNS (5),    /* mulsi */  COSTS_N_INSNS (3),    /* mulsi_const */  COSTS_N_INSNS (2),    /* mulsi_const9 */  COSTS_N_INSNS (5),    /* muldi */  COSTS_N_INSNS (37),   /* divsi */  COSTS_N_INSNS (37),   /* divdi */  COSTS_N_INSNS (3),    /* fp */  COSTS_N_INSNS (4),    /* dmul */  COSTS_N_INSNS (18),   /* sdiv */  COSTS_N_INSNS (33),   /* ddiv */};/* Instruction costs on PPC604 processors.  */static conststruct processor_costs ppc604_cost = {  COSTS_N_INSNS (4),    /* mulsi */  COSTS_N_INSNS (4),    /* mulsi_const */  COSTS_N_INSNS (4),    /* mulsi_const9 */  COSTS_N_INSNS (4),    /* muldi */  COSTS_N_INSNS (20),   /* divsi */  COSTS_N_INSNS (20),   /* divdi */  COSTS_N_INSNS (3),    /* fp */  COSTS_N_INSNS (3),    /* dmul */  COSTS_N_INSNS (18),   /* sdiv */  COSTS_N_INSNS (32),   /* ddiv */};/* Instruction costs on PPC604e processors.  */static conststruct processor_costs ppc604e_cost = {  COSTS_N_INSNS (2),    /* mulsi */  COSTS_N_INSNS (2),    /* mulsi_const */  COSTS_N_INSNS (2),    /* mulsi_const9 */  COSTS_N_INSNS (2),    /* muldi */  COSTS_N_INSNS (20),   /* divsi */  COSTS_N_INSNS (20),   /* divdi */  COSTS_N_INSNS (3),    /* fp */  COSTS_N_INSNS (3),    /* dmul */  COSTS_N_INSNS (18),   /* sdiv */  COSTS_N_INSNS (32),   /* ddiv */};/* Instruction costs on PPC620 processors.  */static conststruct processor_costs ppc620_cost = {  COSTS_N_INSNS (5),    /* mulsi */  COSTS_N_INSNS (4),    /* mulsi_const */  COSTS_N_INSNS (3),    /* mulsi_const9 */  COSTS_N_INSNS (7),    /* muldi */  COSTS_N_INSNS (21),   /* divsi */  COSTS_N_INSNS (37),   /* divdi */  COSTS_N_INSNS (3),    /* fp */  COSTS_N_INSNS (3),    /* dmul */  COSTS_N_INSNS (18),   /* sdiv */  COSTS_N_INSNS (32),   /* ddiv */};/* Instruction costs on PPC630 processors.  */static conststruct processor_costs ppc630_cost = {  COSTS_N_INSNS (5),    /* mulsi */  COSTS_N_INSNS (4),    /* mulsi_const */  COSTS_N_INSNS (3),    /* mulsi_const9 */  COSTS_N_INSNS (7),    /* muldi */  COSTS_N_INSNS (21),   /* divsi */  COSTS_N_INSNS (37),   /* divdi */  COSTS_N_INSNS (3),    /* fp */  COSTS_N_INSNS (3),    /* dmul */  COSTS_N_INSNS (17),   /* sdiv */  COSTS_N_INSNS (21),   /* ddiv */};/* Instruction costs on PPC750 and PPC7400 processors.  */static conststruct processor_costs ppc750_cost = {  COSTS_N_INSNS (5),    /* mulsi */  COSTS_N_INSNS (3),    /* mulsi_const */  COSTS_N_INSNS (2),    /* mulsi_const9 */  COSTS_N_INSNS (5),    /* muldi */  COSTS_N_INSNS (17),   /* divsi */  COSTS_N_INSNS (17),   /* divdi */  COSTS_N_INSNS (3),    /* fp */  COSTS_N_INSNS (3),    /* dmul */  COSTS_N_INSNS (17),   /* sdiv */  COSTS_N_INSNS (31),   /* ddiv */};/* Instruction costs on PPC7450 processors.  */static conststruct processor_costs ppc7450_cost = {  COSTS_N_INSNS (4),    /* mulsi */  COSTS_N_INSNS (3),    /* mulsi_const */  COSTS_N_INSNS (3),    /* mulsi_const9 */  COSTS_N_INSNS (4),    /* muldi */  COSTS_N_INSNS (23),   /* divsi */  COSTS_N_INSNS (23),   /* divdi */  COSTS_N_INSNS (5),    /* fp */  COSTS_N_INSNS (5),    /* dmul */  COSTS_N_INSNS (21),   /* sdiv */  COSTS_N_INSNS (35),   /* ddiv */};/* Instruction costs on PPC8540 processors.  */static conststruct processor_costs ppc8540_cost = {  COSTS_N_INSNS (4),    /* mulsi */  COSTS_N_INSNS (4),    /* mulsi_const */  COSTS_N_INSNS (4),    /* mulsi_const9 */  COSTS_N_INSNS (4),    /* muldi */  COSTS_N_INSNS (19),   /* divsi */  COSTS_N_INSNS (19),   /* divdi */  COSTS_N_INSNS (4),    /* fp */  COSTS_N_INSNS (4),    /* dmul */  COSTS_N_INSNS (29),   /* sdiv */  COSTS_N_INSNS (29),   /* ddiv */};/* APPLE LOCAL begin AltiVec *//* NB: We do not store the PIM operations/predicates in the   VECTOR_BUILTIN_FNS array.  */static GTY(()) tree vector_builtin_fns[ALTIVEC_PIM__FIRST];/* APPLE LOCAL end AltiVec *//* Instruction costs on POWER4 and POWER5 processors.  */static conststruct processor_costs power4_cost = {  COSTS_N_INSNS (3),    /* mulsi */  COSTS_N_INSNS (2),    /* mulsi_const */  COSTS_N_INSNS (2),    /* mulsi_const9 */  COSTS_N_INSNS (4),    /* muldi */  COSTS_N_INSNS (18),   /* divsi */  COSTS_N_INSNS (34),   /* divdi */  COSTS_N_INSNS (3),    /* fp */  COSTS_N_INSNS (3),    /* dmul */  COSTS_N_INSNS (17),   /* sdiv */  COSTS_N_INSNS (17),   /* ddiv */};static bool rs6000_function_ok_for_sibcall (tree, tree);static int num_insns_constant_wide (HOST_WIDE_INT);static void validate_condition_mode (enum rtx_code, enum machine_mode);static rtx rs6000_generate_compare (enum rtx_code);static void rs6000_maybe_dead (rtx);static void rs6000_emit_stack_tie (void);static void rs6000_frame_related (rtx, rtx, HOST_WIDE_INT, rtx, rtx);static rtx spe_synthesize_frame_save (rtx);static bool spe_func_has_64bit_regs_p (void);static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int,			     int, HOST_WIDE_INT);static rtx gen_frame_mem_offset (enum machine_mode, rtx, int);static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int);static unsigned rs6000_hash_constant (rtx);static unsigned toc_hash_function (const void *);static int toc_hash_eq (const void *, const void *);static int constant_pool_expr_1 (rtx, int *, int *);static bool constant_pool_expr_p (rtx);static bool toc_relative_expr_p (rtx);static bool legitimate_small_data_p (enum machine_mode, rtx);static bool legitimate_indexed_address_p (rtx, int);static bool legitimate_indirect_address_p (rtx, int);static bool macho_lo_sum_memory_operand (rtx x, enum machine_mode mode);static bool legitimate_lo_sum_address_p (enum machine_mode, rtx, int);static struct machine_function * rs6000_init_machine_status (void);static bool rs6000_assemble_integer (rtx, unsigned int, int);/* APPLE LOCAL mainline */static bool no_global_regs_above (int);#ifdef HAVE_GAS_HIDDENstatic void rs6000_assemble_visibility (tree, int);#endifstatic int rs6000_ra_ever_killed (void);static tree rs6000_handle_longcall_attribute (tree *, tree, tree, int, bool *);static tree rs6000_handle_altivec_attribute (tree *, tree, tree, int, bool *);/* APPLE LOCAL begin mainline */static bool rs6000_ms_bitfield_layout_p (tree);static tree rs6000_handle_struct_attribute (tree *, tree, tree, int, bool *);/* APPLE LOCAL end mainline */static void rs6000_eliminate_indexed_memrefs (rtx operands[2]);static const char *rs6000_mangle_fundamental_type (tree);extern const struct attribute_spec rs6000_attribute_table[];static void rs6000_set_default_type_attributes (tree);static void rs6000_output_function_prologue (FILE *, HOST_WIDE_INT);static void rs6000_output_function_epilogue (FILE *, HOST_WIDE_INT);static void rs6000_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,				    tree);static rtx rs6000_emit_set_long_const (rtx, HOST_WIDE_INT, HOST_WIDE_INT);static bool rs6000_return_in_memory (tree, tree);static void rs6000_file_start (void);#if TARGET_ELFstatic unsigned int rs6000_elf_section_type_flags (tree, const char *, int);static void rs6000_elf_asm_out_constructor (rtx, int);static void rs6000_elf_asm_out_destructor (rtx, int);static void rs6000_elf_end_indicate_exec_stack (void) ATTRIBUTE_UNUSED;static void rs6000_elf_select_section (tree, int, unsigned HOST_WIDE_INT);static void rs6000_elf_unique_section (tree, int);static void rs6000_elf_select_rtx_section (enum machine_mode, rtx,					   unsigned HOST_WIDE_INT);static void rs6000_elf_encode_section_info (tree, rtx, int)     ATTRIBUTE_UNUSED;static bool rs6000_elf_in_small_data_p (tree);#endif#if TARGET_XCOFFstatic void rs6000_xcoff_asm_globalize_label (FILE *, const char *);static void rs6000_xcoff_asm_named_section (const char *, unsigned int, tree);static void rs6000_xcoff_select_section (tree, int, unsigned HOST_WIDE_INT);static void rs6000_xcoff_unique_section (tree, int);static void rs6000_xcoff_select_rtx_section (enum machine_mode, rtx,					     unsigned HOST_WIDE_INT);static const char * rs6000_xcoff_strip_name_encoding (const char *);static unsigned int rs6000_xcoff_section_type_flags (tree, const char *, int);static void rs6000_xcoff_file_start (void);static void rs6000_xcoff_file_end (void);#endif#if TARGET_MACHOstatic bool rs6000_binds_local_p (tree);/* APPLE LOCAL pragma reverse_bitfield */static bool rs6000_reverse_bitfields_p (tree);#endifstatic int rs6000_variable_issue (FILE *, int, rtx, int);static bool rs6000_rtx_costs (rtx, int, int, int *);static int rs6000_adjust_cost (rtx, rtx, rtx, int);static bool is_microcoded_insn (rtx);static int is_dispatch_slot_restricted (rtx);static bool is_cracked_insn (rtx);static bool is_branch_slot_insn (rtx);static int rs6000_adjust_priority (rtx, int);static int rs6000_issue_rate (void);static bool rs6000_is_costly_dependence (rtx, rtx, rtx, int, int);static rtx get_next_active_insn (rtx, rtx);static bool insn_terminates_group_p (rtx , enum group_termination);static bool is_costly_group (rtx *, rtx);static int force_new_group (int, FILE *, rtx *, rtx, bool *, int, int *);static int redefine_groups (FILE *, int, rtx, rtx);static int pad_groups (FILE *, int, rtx, rtx);static void rs6000_sched_finish (FILE *, int);static int rs6000_use_sched_lookahead (void);static tree rs6000_builtin_mask_for_load (void);/* APPLE LOCAL 4375453 */static bool rs6000_vector_alignment_reachable (tree, bool);static void rs6000_init_builtins (void);static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx);static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx);static rtx rs6000_expand_ternop_builtin (enum insn_code, tree, rtx);static rtx rs6000_expand_builtin (tree, rtx, rtx, enum machine_mode, int);static void altivec_init_builtins (void);static void rs6000_common_init_builtins (void);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -