1 commit f68b80717efec2ccf4c181c9a3fc4184fde27be1
2 Author: Jason S. McMullan <jason.mcmullan@netronome.com>
3 Date: Sun Oct 10 00:38:26 2010 -0400
5 [m68k-amiga] Amiga ABI support
7 Moves the FP to A5, doubling up with the PIC
8 Breaks all -fpic modes.
10 NOT FOR UPSTREAM: This breaks *all* other m68k APIs!!!
12 Signed-off-by: Jason S. McMullan <jason.mcmullan@netronome.com>
14 diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
15 index c22f3b8..9718ccb 100644
16 --- a/gcc/config/m68k/m68k.c
17 +++ b/gcc/config/m68k/m68k.c
18 @@ -920,7 +920,7 @@ m68k_initial_elimination_offset (int from, int to)
20 m68k_save_reg (unsigned int regno, bool interrupt_handler)
22 - if (flag_pic && regno == PIC_REG)
23 + if (flag_pic && regno == A5_REG)
25 if (crtl->saves_all_registers)
27 @@ -2186,7 +2186,7 @@ static rtx
30 if (pic_offset_table_rtx == NULL_RTX)
31 - pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_REG);
32 + pic_offset_table_rtx = gen_rtx_REG (Pmode, A5_REG);
34 crtl->uses_pic_offset_table = 1;
36 @@ -4640,7 +4640,7 @@ m68k_delegitimize_address (rtx orig_x)
37 if (GET_CODE (x) == PLUS
38 && GET_CODE (XEXP (x, 1)) == CONST
39 && REG_P (XEXP (x, 0))
40 - && REGNO (XEXP (x, 0)) == PIC_REG)
41 + && REGNO (XEXP (x, 0)) == A5_REG)
43 y = x = XEXP (XEXP (x, 1), 0);
45 @@ -5145,7 +5145,7 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
47 /* Restore the original PIC register. */
49 - SET_REGNO (pic_offset_table_rtx, PIC_REG);
50 + SET_REGNO (pic_offset_table_rtx, A5_REG);
53 /* Worker function for TARGET_STRUCT_VALUE_RTX. */
54 diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
55 index 5787e8a..1d36a63 100644
56 --- a/gcc/config/m68k/m68k.h
57 +++ b/gcc/config/m68k/m68k.h
58 @@ -348,7 +348,7 @@ along with GCC; see the file COPYING3. If not see
59 #define PIC_OFFSET_TABLE_REGNUM \
60 (!flag_pic ? INVALID_REGNUM \
61 : reload_completed ? REGNO (pic_offset_table_rtx) \
65 /* 1 for registers that have pervasive standard uses
66 and are not available for the register allocator.
67 @@ -416,7 +416,7 @@ along with GCC; see the file COPYING3. If not see
68 fixed_regs[i] = call_used_regs[i] = 1; \
71 - fixed_regs[PIC_REG] = call_used_regs[PIC_REG] = 1; \
72 + fixed_regs[A5_REG] = call_used_regs[A5_REG] = 1; \
75 /* On the m68k, ordinary registers hold 32 bits worth;
76 @@ -453,7 +453,7 @@ along with GCC; see the file COPYING3. If not see
77 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS
78 ABI uses %a6 for shared library calls, therefore the frame
79 pointer is shifted to %a5 on this target. */
80 -#define FRAME_POINTER_REGNUM A6_REG
81 +#define FRAME_POINTER_REGNUM A5_REG
83 /* Base register for access to arguments of the function.
84 * This isn't a hardware register. It will be eliminated to the
85 diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
86 index f89037f..9f3da5a 100644
87 --- a/gcc/config/m68k/m68k.md
88 +++ b/gcc/config/m68k/m68k.md
100 if (TARGET_ID_SHARED_LIBRARY)
102 - operands[1] = gen_rtx_REG (Pmode, PIC_REG);
103 + operands[1] = gen_rtx_REG (Pmode, A5_REG);
104 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";