t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): New.

* config/rs6000/t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): New.
	* config/t-darwin (crt3.o): Use it.
	* config/rs6000/rs6000.c (rs6000_initialize_trampoline): Remove
	'pmode', use Pmode instead of SImode for SYMBOL_REF.
	* config/rs6000/rs6000.md (call_indirect_nonlocal_sysv,
	call_nonlocal_sysv, call_value_indirect_nonlocal_sysv,
	call_value_nonlocal_sysv): Suffix with the "P" macro for 32/64
	support.

From-SVN: r113319
This commit is contained in:
Stuart Hastings 2006-04-27 18:57:11 +00:00 committed by Stuart Hastings
parent 135c2bd408
commit 9613eaffa4
5 changed files with 35 additions and 23 deletions

View File

@ -1,3 +1,14 @@
2006-04-27 Stuart Hastings <stuart@apple.com>
* config/rs6000/t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): New.
* config/t-darwin (crt3.o): Use it.
* config/rs6000/rs6000.c (rs6000_initialize_trampoline): Remove
'pmode', use Pmode instead of SImode for SYMBOL_REF.
* config/rs6000/rs6000.md (call_indirect_nonlocal_sysv,
call_nonlocal_sysv, call_value_indirect_nonlocal_sysv,
call_value_nonlocal_sysv): Suffix with the "P" macro for 32/64
support.
2006-04-27 Roger Sayle <roger@eyesopen.com>
* expmed.c (store_fixed_bit_field): If we're not optimizing for

View File

@ -17305,9 +17305,8 @@ rs6000_trampoline_size (void)
void
rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
{
enum machine_mode pmode = Pmode;
int regsize = (TARGET_32BIT) ? 4 : 8;
rtx ctx_reg = force_reg (pmode, cxt);
rtx ctx_reg = force_reg (Pmode, cxt);
switch (DEFAULT_ABI)
{
@ -17315,15 +17314,15 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
gcc_unreachable ();
/* Macros to shorten the code expansions below. */
#define MEM_DEREF(addr) gen_rtx_MEM (pmode, memory_address (pmode, addr))
#define MEM_DEREF(addr) gen_rtx_MEM (Pmode, memory_address (Pmode, addr))
#define MEM_PLUS(addr,offset) \
gen_rtx_MEM (pmode, memory_address (pmode, plus_constant (addr, offset)))
gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (addr, offset)))
/* Under AIX, just build the 3 word function descriptor */
case ABI_AIX:
{
rtx fn_reg = gen_reg_rtx (pmode);
rtx toc_reg = gen_reg_rtx (pmode);
rtx fn_reg = gen_reg_rtx (Pmode);
rtx toc_reg = gen_reg_rtx (Pmode);
emit_move_insn (fn_reg, MEM_DEREF (fnaddr));
emit_move_insn (toc_reg, MEM_PLUS (fnaddr, regsize));
emit_move_insn (MEM_DEREF (addr), fn_reg);
@ -17335,12 +17334,12 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
/* Under V.4/eabi/darwin, __trampoline_setup does the real work. */
case ABI_DARWIN:
case ABI_V4:
emit_library_call (gen_rtx_SYMBOL_REF (SImode, "__trampoline_setup"),
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"),
FALSE, VOIDmode, 4,
addr, pmode,
addr, Pmode,
GEN_INT (rs6000_trampoline_size ()), SImode,
fnaddr, pmode,
ctx_reg, pmode);
fnaddr, Pmode,
ctx_reg, Pmode);
break;
}

View File

@ -10690,8 +10690,8 @@
;; operands[2] is the value FUNCTION_ARG returns for the VOID argument
;; which indicates how to set cr1
(define_insn "*call_indirect_nonlocal_sysv"
[(call (mem:SI (match_operand:SI 0 "register_operand" "c,*l,c,*l"))
(define_insn "*call_indirect_nonlocal_sysv<mode>"
[(call (mem:SI (match_operand:P 0 "register_operand" "c,*l,c,*l"))
(match_operand 1 "" "g,g,g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,O,n,n"))
(clobber (match_scratch:SI 3 "=l,l,l,l"))]
@ -10709,8 +10709,8 @@
[(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg")
(set_attr "length" "4,4,8,8")])
(define_insn "*call_nonlocal_sysv"
[(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s"))
(define_insn "*call_nonlocal_sysv<mode>"
[(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s,s"))
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 3 "=l,l"))]
@ -10744,9 +10744,9 @@
[(set_attr "type" "branch,branch")
(set_attr "length" "4,8")])
(define_insn "*call_value_indirect_nonlocal_sysv"
(define_insn "*call_value_indirect_nonlocal_sysv<mode>"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "register_operand" "c,*l,c,*l"))
(call (mem:SI (match_operand:P 1 "register_operand" "c,*l,c,*l"))
(match_operand 2 "" "g,g,g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,O,n,n"))
(clobber (match_scratch:SI 4 "=l,l,l,l"))]
@ -10764,9 +10764,9 @@
[(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg")
(set_attr "length" "4,4,8,8")])
(define_insn "*call_value_nonlocal_sysv"
(define_insn "*call_value_nonlocal_sysv<mode>"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s,s"))
(call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s,s"))
(match_operand 2 "" "g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 4 "=l,l"))]
@ -10989,8 +10989,8 @@
[(set_attr "type" "branch")
(set_attr "length" "4")])
(define_insn "*sibcall_nonlocal_sysv"
[(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s"))
(define_insn "*sibcall_nonlocal_sysv<mode>"
[(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s,s"))
(match_operand 1 "" ""))
(use (match_operand 2 "immediate_operand" "O,n"))
(use (match_operand:SI 3 "register_operand" "l,l"))
@ -11042,9 +11042,9 @@
}")
(define_insn "*sibcall_value_nonlocal_sysv"
(define_insn "*sibcall_value_nonlocal_sysv<mode>"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s,s"))
(call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s,s"))
(match_operand 2 "" "")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
(use (match_operand:SI 4 "register_operand" "l,l"))

View File

@ -6,6 +6,8 @@ LIB2FUNCS_STATIC_EXTRA = \
$(srcdir)/config/rs6000/darwin-vecsave.asm \
$(srcdir)/config/rs6000/darwin-world.asm
DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall
# The .asm files above are designed to run on all processors,
# even though they use AltiVec instructions. -Wa is used because
# -force_cpusubtype_ALL doesn't work with -dynamiclib.

View File

@ -18,7 +18,7 @@ EXTRA_MULTILIB_PARTS=crt3.o
$(T)crt3$(objext): $(srcdir)/config/darwin-crt3.c $(GCC_PASSES) \
$(TCONFIG_H) stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \
-fno-tree-dominator-opts \
-fno-tree-dominator-opts $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) \
-c $(srcdir)/config/darwin-crt3.c -o $(T)crt3$(objext)
# Use unwind-dw2-fde-darwin