arm.c (256281) | arm.c (260455) |
---|---|
1/* Output routines for GCC for ARM. 2 Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 3 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4 Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) 5 and Martin Simmons (@harleqn.co.uk). 6 More major hacks by Richard Earnshaw (rearnsha@arm.com). 7 8 This file is part of GCC. --- 140 unchanged lines hidden (view full) --- 149#ifdef OBJECT_FORMAT_ELF 150static void arm_elf_asm_constructor (rtx, int); 151#endif 152#ifndef ARM_PE 153static void arm_encode_section_info (tree, rtx, int); 154#endif 155 156static void arm_file_end (void); | 1/* Output routines for GCC for ARM. 2 Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 3 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4 Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) 5 and Martin Simmons (@harleqn.co.uk). 6 More major hacks by Richard Earnshaw (rearnsha@arm.com). 7 8 This file is part of GCC. --- 140 unchanged lines hidden (view full) --- 149#ifdef OBJECT_FORMAT_ELF 150static void arm_elf_asm_constructor (rtx, int); 151#endif 152#ifndef ARM_PE 153static void arm_encode_section_info (tree, rtx, int); 154#endif 155 156static void arm_file_end (void); |
157static void arm_file_start (void); |
|
157 158#ifdef AOF_ASSEMBLER 159static void aof_globalize_label (FILE *, const char *); 160static void aof_dump_imports (FILE *); 161static void aof_dump_pic_table (FILE *); 162static void aof_file_start (void); 163static void aof_file_end (void); 164static void aof_asm_init_sections (void); --- 32 unchanged lines hidden (view full) --- 197#if TARGET_DLLIMPORT_DECL_ATTRIBUTES 198#undef TARGET_MERGE_DECL_ATTRIBUTES 199#define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes 200#endif 201 202#undef TARGET_ATTRIBUTE_TABLE 203#define TARGET_ATTRIBUTE_TABLE arm_attribute_table 204 | 158 159#ifdef AOF_ASSEMBLER 160static void aof_globalize_label (FILE *, const char *); 161static void aof_dump_imports (FILE *); 162static void aof_dump_pic_table (FILE *); 163static void aof_file_start (void); 164static void aof_file_end (void); 165static void aof_asm_init_sections (void); --- 32 unchanged lines hidden (view full) --- 198#if TARGET_DLLIMPORT_DECL_ATTRIBUTES 199#undef TARGET_MERGE_DECL_ATTRIBUTES 200#define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes 201#endif 202 203#undef TARGET_ATTRIBUTE_TABLE 204#define TARGET_ATTRIBUTE_TABLE arm_attribute_table 205 |
206#undef TARGET_ASM_FILE_START 207#define TARGET_ASM_FILE_START arm_file_start 208 |
|
205#undef TARGET_ASM_FILE_END 206#define TARGET_ASM_FILE_END arm_file_end 207 208#ifdef AOF_ASSEMBLER 209#undef TARGET_ASM_BYTE_OP 210#define TARGET_ASM_BYTE_OP "\tDCB\t" 211#undef TARGET_ASM_ALIGNED_HI_OP 212#define TARGET_ASM_ALIGNED_HI_OP "\tDCW\t" --- 172 unchanged lines hidden (view full) --- 385 386/* Define the information needed to generate branch insns. This is 387 stored from the compare operation. */ 388rtx arm_compare_op0, arm_compare_op1; 389 390/* The processor for which instructions should be scheduled. */ 391enum processor_type arm_tune = arm_none; 392 | 209#undef TARGET_ASM_FILE_END 210#define TARGET_ASM_FILE_END arm_file_end 211 212#ifdef AOF_ASSEMBLER 213#undef TARGET_ASM_BYTE_OP 214#define TARGET_ASM_BYTE_OP "\tDCB\t" 215#undef TARGET_ASM_ALIGNED_HI_OP 216#define TARGET_ASM_ALIGNED_HI_OP "\tDCW\t" --- 172 unchanged lines hidden (view full) --- 389 390/* Define the information needed to generate branch insns. This is 391 stored from the compare operation. */ 392rtx arm_compare_op0, arm_compare_op1; 393 394/* The processor for which instructions should be scheduled. */ 395enum processor_type arm_tune = arm_none; 396 |
397/* The default processor used if not overriden by commandline. */ 398static enum processor_type arm_default_cpu = arm_none; 399 |
|
393/* Which floating point model to use. */ 394enum arm_fp_model arm_fp_model; 395 396/* Which floating point hardware is available. */ 397enum fputype arm_fpu_arch; 398 399/* Which floating point hardware to schedule for. */ 400enum fputype arm_fpu_tune; --- 614 unchanged lines hidden (view full) --- 1015 1016 gcc_assert (best_fit); 1017 sel = best_fit; 1018 } 1019 1020 insn_flags = sel->flags; 1021 } 1022 sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch); | 400/* Which floating point model to use. */ 401enum arm_fp_model arm_fp_model; 402 403/* Which floating point hardware is available. */ 404enum fputype arm_fpu_arch; 405 406/* Which floating point hardware to schedule for. */ 407enum fputype arm_fpu_tune; --- 614 unchanged lines hidden (view full) --- 1022 1023 gcc_assert (best_fit); 1024 sel = best_fit; 1025 } 1026 1027 insn_flags = sel->flags; 1028 } 1029 sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch); |
1030 arm_default_cpu = (enum processor_type) (sel - all_cores); |
|
1023 if (arm_tune == arm_none) | 1031 if (arm_tune == arm_none) |
1024 arm_tune = (enum processor_type) (sel - all_cores); | 1032 arm_tune = arm_default_cpu; |
1025 } 1026 1027 /* The processor for which we should tune should now have been 1028 chosen. */ 1029 gcc_assert (arm_tune != arm_none); 1030 1031 tune_flags = all_cores[(int)arm_tune].flags; 1032 if (optimize_size) --- 13420 unchanged lines hidden (view full) --- 14453 14454 if (verbatim) 14455 fputs (name, stream); 14456 else 14457 asm_fprintf (stream, "%U%s", name); 14458} 14459 14460static void | 1033 } 1034 1035 /* The processor for which we should tune should now have been 1036 chosen. */ 1037 gcc_assert (arm_tune != arm_none); 1038 1039 tune_flags = all_cores[(int)arm_tune].flags; 1040 if (optimize_size) --- 13420 unchanged lines hidden (view full) --- 14461 14462 if (verbatim) 14463 fputs (name, stream); 14464 else 14465 asm_fprintf (stream, "%U%s", name); 14466} 14467 14468static void |
14469arm_file_start (void) 14470{ 14471 int val; 14472 14473 if (TARGET_BPABI) 14474 { 14475 const char *fpu_name; 14476 if (arm_select[0].string) 14477 asm_fprintf (asm_out_file, "\t.cpu %s\n", arm_select[0].string); 14478 else if (arm_select[1].string) 14479 asm_fprintf (asm_out_file, "\t.arch %s\n", arm_select[1].string); 14480 else 14481 asm_fprintf (asm_out_file, "\t.cpu %s\n", 14482 all_cores[arm_default_cpu].name); 14483 14484 if (TARGET_SOFT_FLOAT) 14485 { 14486 if (TARGET_VFP) 14487 fpu_name = "softvfp"; 14488 else 14489 fpu_name = "softfpa"; 14490 } 14491 else 14492 { 14493 switch (arm_fpu_arch) 14494 { 14495 case FPUTYPE_FPA: 14496 fpu_name = "fpa"; 14497 break; 14498 case FPUTYPE_FPA_EMU2: 14499 fpu_name = "fpe2"; 14500 break; 14501 case FPUTYPE_FPA_EMU3: 14502 fpu_name = "fpe3"; 14503 break; 14504 case FPUTYPE_MAVERICK: 14505 fpu_name = "maverick"; 14506 break; 14507 case FPUTYPE_VFP: 14508 if (TARGET_HARD_FLOAT) 14509 asm_fprintf (asm_out_file, "\t.eabi_attribute 27, 3\n"); 14510 if (TARGET_HARD_FLOAT_ABI) 14511 asm_fprintf (asm_out_file, "\t.eabi_attribute 28, 1\n"); 14512 fpu_name = "vfp"; 14513 break; 14514 default: 14515 abort(); 14516 } 14517 } 14518 asm_fprintf (asm_out_file, "\t.fpu %s\n", fpu_name); 14519 14520 /* Some of these attributes only apply when the corresponding features 14521 are used. However we don't have any easy way of figuring this out. 14522 Conservatively record the setting that would have been used. */ 14523 14524 /* Tag_ABI_PCS_wchar_t. */ 14525 asm_fprintf (asm_out_file, "\t.eabi_attribute 18, %d\n", 14526 (int)WCHAR_TYPE_SIZE / BITS_PER_UNIT); 14527 14528 /* Tag_ABI_FP_rounding. */ 14529 if (flag_rounding_math) 14530 asm_fprintf (asm_out_file, "\t.eabi_attribute 19, 1\n"); 14531 if (!flag_unsafe_math_optimizations) 14532 { 14533 /* Tag_ABI_FP_denomal. */ 14534 asm_fprintf (asm_out_file, "\t.eabi_attribute 20, 1\n"); 14535 /* Tag_ABI_FP_exceptions. */ 14536 asm_fprintf (asm_out_file, "\t.eabi_attribute 21, 1\n"); 14537 } 14538 /* Tag_ABI_FP_user_exceptions. */ 14539 if (flag_signaling_nans) 14540 asm_fprintf (asm_out_file, "\t.eabi_attribute 22, 1\n"); 14541 /* Tag_ABI_FP_number_model. */ 14542 asm_fprintf (asm_out_file, "\t.eabi_attribute 23, %d\n", 14543 flag_finite_math_only ? 1 : 3); 14544 14545 /* Tag_ABI_align8_needed. */ 14546 asm_fprintf (asm_out_file, "\t.eabi_attribute 24, 1\n"); 14547 /* Tag_ABI_align8_preserved. */ 14548 asm_fprintf (asm_out_file, "\t.eabi_attribute 25, 1\n"); 14549 /* Tag_ABI_enum_size. */ 14550 asm_fprintf (asm_out_file, "\t.eabi_attribute 26, %d\n", 14551 flag_short_enums ? 1 : 2); 14552 14553 /* Tag_ABI_optimization_goals. */ 14554 if (optimize_size) 14555 val = 4; 14556 else if (optimize >= 2) 14557 val = 2; 14558 else if (optimize) 14559 val = 1; 14560 else 14561 val = 6; 14562 asm_fprintf (asm_out_file, "\t.eabi_attribute 30, %d\n", val); 14563 } 14564 default_file_start(); 14565} 14566 14567static void |
|
14461arm_file_end (void) 14462{ 14463 int regno; 14464 14465 if (! thumb_call_reg_needed) 14466 return; 14467 14468 switch_to_section (text_section); --- 1173 unchanged lines hidden --- | 14568arm_file_end (void) 14569{ 14570 int regno; 14571 14572 if (! thumb_call_reg_needed) 14573 return; 14574 14575 switch_to_section (text_section); --- 1173 unchanged lines hidden --- |