ia64.c (117395) | ia64.c (119256) |
---|---|
1/* Definitions of target machine for GNU compiler. 2 Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 3 Contributed by James E. Wilson <wilson@cygnus.com> and 4 David Mosberger <davidm@hpl.hp.com>. 5 6This file is part of GNU CC. 7 8GNU CC is free software; you can redistribute it and/or modify --- 1453 unchanged lines hidden (view full) --- 1462 else 1463 insn = gen_call_value_gp (retval, addr, b0); 1464 insn = emit_call_insn (insn); 1465 1466 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); 1467 } 1468 1469 if (sibcall_p) | 1/* Definitions of target machine for GNU compiler. 2 Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 3 Contributed by James E. Wilson <wilson@cygnus.com> and 4 David Mosberger <davidm@hpl.hp.com>. 5 6This file is part of GNU CC. 7 8GNU CC is free software; you can redistribute it and/or modify --- 1453 unchanged lines hidden (view full) --- 1462 else 1463 insn = gen_call_value_gp (retval, addr, b0); 1464 insn = emit_call_insn (insn); 1465 1466 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); 1467 } 1468 1469 if (sibcall_p) |
1470 { 1471 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0); 1472 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), 1473 gen_rtx_REG (DImode, AR_PFS_REGNUM)); 1474 } | 1470 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0); |
1475} 1476void 1477ia64_reload_gp () 1478{ 1479 rtx tmp; 1480 1481 if (current_frame_info.reg_save_gp) 1482 tmp = gen_rtx_REG (DImode, current_frame_info.reg_save_gp); --- 36 unchanged lines hidden (view full) --- 1519 rtx retval, addr, retaddr, scratch_r, scratch_b; 1520 int noreturn_p, sibcall_p; 1521{ 1522 rtx insn; 1523 bool is_desc = false; 1524 1525 /* If we find we're calling through a register, then we're actually 1526 calling through a descriptor, so load up the values. */ | 1471} 1472void 1473ia64_reload_gp () 1474{ 1475 rtx tmp; 1476 1477 if (current_frame_info.reg_save_gp) 1478 tmp = gen_rtx_REG (DImode, current_frame_info.reg_save_gp); --- 36 unchanged lines hidden (view full) --- 1515 rtx retval, addr, retaddr, scratch_r, scratch_b; 1516 int noreturn_p, sibcall_p; 1517{ 1518 rtx insn; 1519 bool is_desc = false; 1520 1521 /* If we find we're calling through a register, then we're actually 1522 calling through a descriptor, so load up the values. */ |
1527 if (REG_P (addr)) | 1523 if (REG_P (addr) && GR_REGNO_P (REGNO (addr))) |
1528 { 1529 rtx tmp; 1530 bool addr_dead_p; 1531 1532 /* ??? We are currently constrained to *not* use peep2, because 1533 we can legitimiately change the global lifetime of the GP 1534 (in the form of killing where previously live). This is 1535 because a call through a descriptor doesn't use the previous --- 1205 unchanged lines hidden (view full) --- 2741 ar_unat_save_reg = NULL_RTX; 2742 2743 if (current_frame_info.reg_save_ar_pfs != 0) 2744 { 2745 alt_reg = gen_rtx_REG (DImode, current_frame_info.reg_save_ar_pfs); 2746 reg = gen_rtx_REG (DImode, AR_PFS_REGNUM); 2747 emit_move_insn (reg, alt_reg); 2748 } | 1524 { 1525 rtx tmp; 1526 bool addr_dead_p; 1527 1528 /* ??? We are currently constrained to *not* use peep2, because 1529 we can legitimiately change the global lifetime of the GP 1530 (in the form of killing where previously live). This is 1531 because a call through a descriptor doesn't use the previous --- 1205 unchanged lines hidden (view full) --- 2737 ar_unat_save_reg = NULL_RTX; 2738 2739 if (current_frame_info.reg_save_ar_pfs != 0) 2740 { 2741 alt_reg = gen_rtx_REG (DImode, current_frame_info.reg_save_ar_pfs); 2742 reg = gen_rtx_REG (DImode, AR_PFS_REGNUM); 2743 emit_move_insn (reg, alt_reg); 2744 } |
2749 else if (! current_function_is_leaf) | 2745 else if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM)) |
2750 { 2751 alt_regno = next_scratch_gr_reg (); 2752 alt_reg = gen_rtx_REG (DImode, alt_regno); 2753 do_restore (gen_movdi_x, alt_reg, cfa_off); 2754 cfa_off -= 8; 2755 reg = gen_rtx_REG (DImode, AR_PFS_REGNUM); 2756 emit_move_insn (reg, alt_reg); 2757 } --- 4399 unchanged lines hidden (view full) --- 7157 7158int 7159ia64_epilogue_uses (regno) 7160 int regno; 7161{ 7162 switch (regno) 7163 { 7164 case R_GR (1): | 2746 { 2747 alt_regno = next_scratch_gr_reg (); 2748 alt_reg = gen_rtx_REG (DImode, alt_regno); 2749 do_restore (gen_movdi_x, alt_reg, cfa_off); 2750 cfa_off -= 8; 2751 reg = gen_rtx_REG (DImode, AR_PFS_REGNUM); 2752 emit_move_insn (reg, alt_reg); 2753 } --- 4399 unchanged lines hidden (view full) --- 7153 7154int 7155ia64_epilogue_uses (regno) 7156 int regno; 7157{ 7158 switch (regno) 7159 { 7160 case R_GR (1): |
7165 /* When a function makes a call through a function descriptor, we 7166 will write a (potentially) new value to "gp". After returning 7167 from such a call, we need to make sure the function restores the 7168 original gp-value, even if the function itself does not use the 7169 gp anymore. */ 7170 return (TARGET_CONST_GP && !(TARGET_AUTO_PIC || TARGET_NO_PIC)); | 7161 /* With a call to a function in another module, we will write a new 7162 value to "gp". After returning from such a call, we need to make 7163 sure the function restores the original gp-value, even if the 7164 function itself does not use the gp anymore. */ 7165 return !(TARGET_AUTO_PIC || TARGET_NO_PIC); |
7171 7172 case IN_REG (0): case IN_REG (1): case IN_REG (2): case IN_REG (3): 7173 case IN_REG (4): case IN_REG (5): case IN_REG (6): case IN_REG (7): 7174 /* For functions defined with the syscall_linkage attribute, all 7175 input registers are marked as live at all function exits. This 7176 prevents the register allocator from using the input registers, 7177 which in turn makes it possible to restart a system call after 7178 an interrupt without having to save/restore the input registers. --- 165 unchanged lines hidden (view full) --- 7344 7345/* True if it is OK to do sibling call optimization for the specified 7346 call expression EXP. DECL will be the called function, or NULL if 7347 this is an indirect call. */ 7348bool 7349ia64_function_ok_for_sibcall (decl) 7350 tree decl; 7351{ | 7166 7167 case IN_REG (0): case IN_REG (1): case IN_REG (2): case IN_REG (3): 7168 case IN_REG (4): case IN_REG (5): case IN_REG (6): case IN_REG (7): 7169 /* For functions defined with the syscall_linkage attribute, all 7170 input registers are marked as live at all function exits. This 7171 prevents the register allocator from using the input registers, 7172 which in turn makes it possible to restart a system call after 7173 an interrupt without having to save/restore the input registers. --- 165 unchanged lines hidden (view full) --- 7339 7340/* True if it is OK to do sibling call optimization for the specified 7341 call expression EXP. DECL will be the called function, or NULL if 7342 this is an indirect call. */ 7343bool 7344ia64_function_ok_for_sibcall (decl) 7345 tree decl; 7346{ |
7352 /* Direct calls are always ok. */ 7353 if (decl) 7354 return true; 7355 7356 /* If TARGET_CONST_GP is in effect, then our caller expects us to 7357 return with our current GP. This means that we'll always have 7358 a GP reload after an indirect call. */ 7359 return !ia64_epilogue_uses (R_GR (1)); | 7347 /* We must always return with our current GP. This means we can 7348 only sibcall to functions defined in the current module. */ 7349 return decl && (*targetm.binds_local_p) (decl); |
7360} 7361 7362/* Output assembly directives for prologue regions. */ 7363 7364/* The current basic block number. */ 7365 7366static bool last_block; 7367 --- 1084 unchanged lines hidden --- | 7350} 7351 7352/* Output assembly directives for prologue regions. */ 7353 7354/* The current basic block number. */ 7355 7356static bool last_block; 7357 --- 1084 unchanged lines hidden --- |