📄 rs6000.c
字号:
if (OS_MISSING_ALTIVEC) set_masks &= ~MASK_ALTIVEC;#endif /* Don't override by the processor default if given explicitly. */ set_masks &= ~target_flags_explicit; /* Identify the processor type. */ rs6000_select[0].string = default_cpu; rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT; for (i = 0; i < ARRAY_SIZE (rs6000_select); i++) { ptr = &rs6000_select[i]; if (ptr->string != (char *)0 && ptr->string[0] != '\0') { for (j = 0; j < ptt_size; j++) if (! strcmp (ptr->string, processor_target_table[j].name)) { if (ptr->set_tune_p) rs6000_cpu = processor_target_table[j].processor; if (ptr->set_arch_p) { target_flags &= ~set_masks; target_flags |= (processor_target_table[j].target_enable & set_masks); } break; } if (j == ptt_size) error ("bad value (%s) for %s switch", ptr->string, ptr->name); } } if (TARGET_E500) rs6000_isel = 1; /* If we are optimizing big endian systems for space, use the load/store multiple and string instructions. */ if (BYTES_BIG_ENDIAN && optimize_size) target_flags |= ~target_flags_explicit & (MASK_MULTIPLE | MASK_STRING); /* Don't allow -mmultiple or -mstring on little endian systems unless the cpu is a 750, because the hardware doesn't support the instructions used in little endian mode, and causes an alignment trap. The 750 does not cause an alignment trap (except when the target is unaligned). */ if (!BYTES_BIG_ENDIAN && rs6000_cpu != PROCESSOR_PPC750) { if (TARGET_MULTIPLE) { target_flags &= ~MASK_MULTIPLE; if ((target_flags_explicit & MASK_MULTIPLE) != 0) warning (0, "-mmultiple is not supported on little endian systems"); } if (TARGET_STRING) { target_flags &= ~MASK_STRING; if ((target_flags_explicit & MASK_STRING) != 0) warning (0, "-mstring is not supported on little endian systems"); } } /* Set debug flags */ if (rs6000_debug_name) { if (! strcmp (rs6000_debug_name, "all")) rs6000_debug_stack = rs6000_debug_arg = 1; else if (! strcmp (rs6000_debug_name, "stack")) rs6000_debug_stack = 1; else if (! strcmp (rs6000_debug_name, "arg")) rs6000_debug_arg = 1; else error ("unknown -mdebug-%s switch", rs6000_debug_name); } if (rs6000_traceback_name) { if (! strncmp (rs6000_traceback_name, "full", 4)) rs6000_traceback = traceback_full; else if (! strncmp (rs6000_traceback_name, "part", 4)) rs6000_traceback = traceback_part; else if (! strncmp (rs6000_traceback_name, "no", 2)) rs6000_traceback = traceback_none; else error ("unknown -mtraceback arg %qs; expecting %<full%>, %<partial%> or %<none%>", rs6000_traceback_name); } if (!rs6000_explicit_options.long_double) rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE;#ifndef POWERPC_LINUX if (!rs6000_explicit_options.abi) rs6000_ieeequad = 1;#endif /* Set Altivec ABI as default for powerpc64 linux. */ if (TARGET_ELF && TARGET_64BIT) { rs6000_altivec_abi = 1; TARGET_ALTIVEC_VRSAVE = 1; } /* Set the Darwin64 ABI as default for 64-bit Darwin. */ if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT) { rs6000_darwin64_abi = 1;#if TARGET_MACHO darwin_one_byte_bool = 1;#endif /* Default to natural alignment, for better performance. */ rs6000_alignment_flags = MASK_ALIGN_NATURAL; } /* Handle -mtls-size option. */ rs6000_parse_tls_size_option ();#ifdef SUBTARGET_OVERRIDE_OPTIONS SUBTARGET_OVERRIDE_OPTIONS;#endif#ifdef SUBSUBTARGET_OVERRIDE_OPTIONS SUBSUBTARGET_OVERRIDE_OPTIONS;#endif#ifdef SUB3TARGET_OVERRIDE_OPTIONS SUB3TARGET_OVERRIDE_OPTIONS;#endif if (TARGET_E500) { if (TARGET_ALTIVEC) error ("AltiVec and E500 instructions cannot coexist"); /* The e500 does not have string instructions, and we set MASK_STRING above when optimizing for size. */ if ((target_flags & MASK_STRING) != 0) target_flags = target_flags & ~MASK_STRING; } else if (rs6000_select[1].string != NULL) { /* For the powerpc-eabispe configuration, we set all these by default, so let's unset them if we manually set another CPU that is not the E500. */ if (!rs6000_explicit_options.abi) rs6000_spe_abi = 0; if (!rs6000_explicit_options.spe) rs6000_spe = 0; if (!rs6000_explicit_options.float_gprs) rs6000_float_gprs = 0; if (!rs6000_explicit_options.isel) rs6000_isel = 0; if (!rs6000_explicit_options.long_double) rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; } rs6000_always_hint = (rs6000_cpu != PROCESSOR_POWER4 && rs6000_cpu != PROCESSOR_POWER5); rs6000_sched_groups = (rs6000_cpu == PROCESSOR_POWER4 || rs6000_cpu == PROCESSOR_POWER5); rs6000_sched_restricted_insns_priority = (rs6000_sched_groups ? 1 : 0); /* Handle -msched-costly-dep option. */ rs6000_sched_costly_dep = (rs6000_sched_groups ? store_to_load_dep_costly : no_dep_costly); if (rs6000_sched_costly_dep_str) { if (! strcmp (rs6000_sched_costly_dep_str, "no")) rs6000_sched_costly_dep = no_dep_costly; else if (! strcmp (rs6000_sched_costly_dep_str, "all")) rs6000_sched_costly_dep = all_deps_costly; else if (! strcmp (rs6000_sched_costly_dep_str, "true_store_to_load")) rs6000_sched_costly_dep = true_store_to_load_dep_costly; else if (! strcmp (rs6000_sched_costly_dep_str, "store_to_load")) rs6000_sched_costly_dep = store_to_load_dep_costly; else rs6000_sched_costly_dep = atoi (rs6000_sched_costly_dep_str); } /* Handle -minsert-sched-nops option. */ rs6000_sched_insert_nops = (rs6000_sched_groups ? sched_finish_regroup_exact : sched_finish_none); if (rs6000_sched_insert_nops_str) { if (! strcmp (rs6000_sched_insert_nops_str, "no")) rs6000_sched_insert_nops = sched_finish_none; else if (! strcmp (rs6000_sched_insert_nops_str, "pad")) rs6000_sched_insert_nops = sched_finish_pad_groups; else if (! strcmp (rs6000_sched_insert_nops_str, "regroup_exact")) rs6000_sched_insert_nops = sched_finish_regroup_exact; else rs6000_sched_insert_nops = atoi (rs6000_sched_insert_nops_str); }#ifdef TARGET_REGNAMES /* If the user desires alternate register names, copy in the alternate names now. */ if (TARGET_REGNAMES) memcpy (rs6000_reg_names, alt_reg_names, sizeof (rs6000_reg_names));#endif /* Set aix_struct_return last, after the ABI is determined. If -maix-struct-return or -msvr4-struct-return was explicitly used, don't override with the ABI default. */ if (!rs6000_explicit_options.aix_struct_ret) aix_struct_return = (DEFAULT_ABI != ABI_V4 || DRAFT_V4_STRUCT_RET); if (TARGET_LONG_DOUBLE_128 && !TARGET_IEEEQUAD) REAL_MODE_FORMAT (TFmode) = &ibm_extended_format; /* Allocate an alias set for register saves & restores from stack. */ rs6000_sr_alias_set = new_alias_set (); if (TARGET_TOC) ASM_GENERATE_INTERNAL_LABEL (toc_label_name, "LCTOC", 1); /* We can only guarantee the availability of DI pseudo-ops when assembling for 64-bit targets. */ if (!TARGET_64BIT) { targetm.asm_out.aligned_op.di = NULL; targetm.asm_out.unaligned_op.di = NULL; } /* Set branch target alignment, if not optimizing for size. */ if (!optimize_size) { if (rs6000_sched_groups) { if (align_functions <= 0) align_functions = 16; if (align_jumps <= 0) align_jumps = 16; if (align_loops <= 0) align_loops = 16; } if (align_jumps_max_skip <= 0) align_jumps_max_skip = 15; if (align_loops_max_skip <= 0) align_loops_max_skip = 15; } /* Arrange to save and restore machine status around nested functions. */ init_machine_status = rs6000_init_machine_status; /* We should always be splitting complex arguments, but we can't break Linux and Darwin ABIs at the moment. For now, only AIX is fixed. */ if (DEFAULT_ABI != ABI_AIX) targetm.calls.split_complex_arg = NULL; /* Initialize rs6000_cost with the appropriate target costs. */ if (optimize_size) rs6000_cost = TARGET_POWERPC64 ? &size64_cost : &size32_cost; else switch (rs6000_cpu) { case PROCESSOR_RIOS1: rs6000_cost = &rios1_cost; break; case PROCESSOR_RIOS2: rs6000_cost = &rios2_cost; break; case PROCESSOR_RS64A: rs6000_cost = &rs64a_cost; break; case PROCESSOR_MPCCORE: rs6000_cost = &mpccore_cost; break; case PROCESSOR_PPC403: rs6000_cost = &ppc403_cost; break; case PROCESSOR_PPC405: rs6000_cost = &ppc405_cost; break; case PROCESSOR_PPC440: rs6000_cost = &ppc440_cost; break; case PROCESSOR_PPC601: rs6000_cost = &ppc601_cost; break; case PROCESSOR_PPC603: rs6000_cost = &ppc603_cost; break; case PROCESSOR_PPC604: rs6000_cost = &ppc604_cost; break; case PROCESSOR_PPC604e: rs6000_cost = &ppc604e_cost; break; case PROCESSOR_PPC620: rs6000_cost = &ppc620_cost; break; case PROCESSOR_PPC630: rs6000_cost = &ppc630_cost; break; case PROCESSOR_PPC750: case PROCESSOR_PPC7400: rs6000_cost = &ppc750_cost; break; case PROCESSOR_PPC7450: rs6000_cost = &ppc7450_cost; break; case PROCESSOR_PPC8540: rs6000_cost = &ppc8540_cost; break; case PROCESSOR_POWER4: case PROCESSOR_POWER5: rs6000_cost = &power4_cost; break; default: gcc_unreachable (); }}/* Implement targetm.vectorize.builtin_mask_for_load. */static treers6000_builtin_mask_for_load (void){ if (TARGET_ALTIVEC) return altivec_builtin_mask_for_load; else return 0;}/* Handle generic options of the form -mfoo=yes/no. NAME is the option name. VALUE is the option value. FLAG is the pointer to the flag where to store a 1 or 0, depending on whether the option value is 'yes' or 'no' respectively. */static voidrs6000_parse_yes_no_option (const char *name, const char *value, int *flag){ if (value == 0) return; else if (!strcmp (value, "yes")) *flag = 1; else if (!strcmp (value, "no")) *flag = 0; else error ("unknown -m%s= option specified: '%s'", name, value);}/* Validate and record the size specified with the -mtls-size option. */static voidrs6000_parse_tls_size_option (void){ if (rs6000_tls_size_string == 0) return; else if (strcmp (rs6000_tls_size_string, "16") == 0) rs6000_tls_size = 16; else if (strcmp (rs6000_tls_size_string, "32") == 0) rs6000_tls_size = 32; else if (strcmp (rs6000_tls_size_string, "64") == 0) rs6000_tls_size = 64; else error ("bad value %qs for -mtls-size switch", rs6000_tls_size_string);}voidoptimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED){ if (DEFAULT_ABI == ABI_DARWIN) /* The Darwin libraries never set errno, so we might as well avoid calling them when that's the only reason we would. */ flag_errno_math = 0; /* Double growth factor to counter reduced min jump length. */ set_param_value ("max-grow-copy-bb-insns", 16);}/* Implement TARGET_HANDLE_OPTION. */static boolrs6000_handle_option (size_t code, const char *arg, int value)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -