diff options
Diffstat (limited to 'recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch')
| -rw-r--r-- | recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch b/recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch deleted file mode 100644 index efd127de..00000000 --- a/recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch +++ /dev/null | |||
| @@ -1,108 +0,0 @@ | |||
| 1 | From 0462b5fb1e91183c16e204e1a6cf436ef0d8d0f8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: eager <eager@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
| 3 | Date: Sun, 23 Feb 2014 18:44:27 +0000 | ||
| 4 | Subject: [PATCH] 2014-02-23 David Holsgrove <david.holsgrove@xilinx.com> | ||
| 5 | |||
| 6 | * /config/microblaze/microblaze.c: Add microblaze_asm_output_mi_thunk | ||
| 7 | and define TARGET_ASM_OUTPUT_MI_THUNK and | ||
| 8 | TARGET_ASM_CAN_OUTPUT_MI_THUNK. | ||
| 9 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | --- | ||
| 12 | gcc/config/microblaze/microblaze.c | 73 ++++++++++++++++++++++++++++++++++++++ | ||
| 13 | 2 files changed, 79 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c | ||
| 16 | index 985d26a..ba8109b 100644 | ||
| 17 | --- a/gcc/config/microblaze/microblaze.c | ||
| 18 | +++ b/gcc/config/microblaze/microblaze.c | ||
| 19 | @@ -3087,6 +3087,73 @@ expand_pic_symbol_ref (enum machine_mode mode ATTRIBUTE_UNUSED, rtx op) | ||
| 20 | return result; | ||
| 21 | } | ||
| 22 | |||
| 23 | +static void | ||
| 24 | +microblaze_asm_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, | ||
| 25 | + HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, | ||
| 26 | + tree function) | ||
| 27 | +{ | ||
| 28 | + rtx this_rtx, insn, funexp; | ||
| 29 | + | ||
| 30 | + reload_completed = 1; | ||
| 31 | + epilogue_completed = 1; | ||
| 32 | + | ||
| 33 | + /* Mark the end of the (empty) prologue. */ | ||
| 34 | + emit_note (NOTE_INSN_PROLOGUE_END); | ||
| 35 | + | ||
| 36 | + /* Find the "this" pointer. If the function returns a structure, | ||
| 37 | + the structure return pointer is in MB_ABI_FIRST_ARG_REGNUM. */ | ||
| 38 | + if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function)) | ||
| 39 | + this_rtx = gen_rtx_REG (Pmode, (MB_ABI_FIRST_ARG_REGNUM + 1)); | ||
| 40 | + else | ||
| 41 | + this_rtx = gen_rtx_REG (Pmode, MB_ABI_FIRST_ARG_REGNUM); | ||
| 42 | + | ||
| 43 | + /* Apply the constant offset, if required. */ | ||
| 44 | + if (delta) | ||
| 45 | + emit_insn (gen_addsi3 (this_rtx, this_rtx, GEN_INT (delta))); | ||
| 46 | + | ||
| 47 | + /* Apply the offset from the vtable, if required. */ | ||
| 48 | + if (vcall_offset) | ||
| 49 | + { | ||
| 50 | + rtx vcall_offset_rtx = GEN_INT (vcall_offset); | ||
| 51 | + rtx temp1 = gen_rtx_REG (Pmode, MB_ABI_TEMP1_REGNUM); | ||
| 52 | + | ||
| 53 | + emit_move_insn (temp1, gen_rtx_MEM (Pmode, this_rtx)); | ||
| 54 | + | ||
| 55 | + rtx loc = gen_rtx_PLUS (Pmode, temp1, vcall_offset_rtx); | ||
| 56 | + emit_move_insn (temp1, gen_rtx_MEM (Pmode, loc)); | ||
| 57 | + | ||
| 58 | + emit_insn (gen_addsi3 (this_rtx, this_rtx, temp1)); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + /* Generate a tail call to the target function. */ | ||
| 62 | + if (!TREE_USED (function)) | ||
| 63 | + { | ||
| 64 | + assemble_external (function); | ||
| 65 | + TREE_USED (function) = 1; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + funexp = XEXP (DECL_RTL (function), 0); | ||
| 69 | + rtx temp2 = gen_rtx_REG (Pmode, MB_ABI_TEMP2_REGNUM); | ||
| 70 | + | ||
| 71 | + if (flag_pic) | ||
| 72 | + emit_move_insn (temp2, expand_pic_symbol_ref (Pmode, funexp)); | ||
| 73 | + else | ||
| 74 | + emit_move_insn (temp2, funexp); | ||
| 75 | + | ||
| 76 | + emit_insn (gen_indirect_jump (temp2)); | ||
| 77 | + | ||
| 78 | + /* Run just enough of rest_of_compilation. This sequence was | ||
| 79 | + "borrowed" from rs6000.c. */ | ||
| 80 | + insn = get_insns (); | ||
| 81 | + shorten_branches (insn); | ||
| 82 | + final_start_function (insn, file, 1); | ||
| 83 | + final (insn, file, 1); | ||
| 84 | + final_end_function (); | ||
| 85 | + | ||
| 86 | + reload_completed = 0; | ||
| 87 | + epilogue_completed = 0; | ||
| 88 | +} | ||
| 89 | + | ||
| 90 | bool | ||
| 91 | microblaze_expand_move (enum machine_mode mode, rtx operands[]) | ||
| 92 | { | ||
| 93 | @@ -3504,6 +3571,12 @@ microblaze_legitimate_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x | ||
| 94 | #undef TARGET_SECONDARY_RELOAD | ||
| 95 | #define TARGET_SECONDARY_RELOAD microblaze_secondary_reload | ||
| 96 | |||
| 97 | +#undef TARGET_ASM_OUTPUT_MI_THUNK | ||
| 98 | +#define TARGET_ASM_OUTPUT_MI_THUNK microblaze_asm_output_mi_thunk | ||
| 99 | + | ||
| 100 | +#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK | ||
| 101 | +#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_const_tree_hwi_hwi_const_tree_true | ||
| 102 | + | ||
| 103 | #undef TARGET_SCHED_ADJUST_COST | ||
| 104 | #define TARGET_SCHED_ADJUST_COST microblaze_adjust_cost | ||
| 105 | |||
| 106 | -- | ||
| 107 | 1.9.0 | ||
| 108 | |||
