J"orn Rennecke
aec373f1a1
Fix for execute/980205.c failure on SH[123].
...
* sh.c (sh_expand_prologue, in !SH3E code): Don't push an extra
register for stdarg functions.
* sh.h (current_function_varargs): Declare.
(FUNCTION_ARG): Ignore NAMED for stdarg functions.
From-SVN: r19391
1998-04-23 21:57:06 +01:00
J"orn Rennecke
d0c4285986
sh.c (gen_ashift_hi): Implement right shifts via gen_ashift.
...
* sh.c (gen_ashift_hi): Implement right shifts via gen_ashift.
* sh.md (ashrhi3_k, lshrhi3_k, lshrhi3_m, lshrhi3, lshrhi3+1): Delete.
From-SVN: r19385
1998-04-23 14:37:16 +01:00
J"orn Rennecke
a07987797e
Fix some problems that resulted in assmebler messages 'Error: pcrel too far'
...
Fix some problems that resulted in assmebler messages 'Error: pcrel too far'
* sh.c (find_barrier): Fix bug in ADDR_DIFF_VEC handling.
(split_branches): Call init_insn_lengths.
From-SVN: r19339
1998-04-20 11:59:18 +01:00
J"orn Rennecke
1f3fa20e05
* sh.c (find_barrier): Fix calculations for alignemnt increase.
...
From-SVN: r18853
1998-03-27 10:12:02 +00:00
J"orn Rennecke
77008a4451
sh.h (LOOP_ALIGN): Only align when optimizing.
...
* sh.h (LOOP_ALIGN): Only align when optimizing.
* sh.c (find_barrier): Clear inc for CODE_LABELs.
When not optimizing, calculate alignment for BARRIERs directly.
From-SVN: r18473
1998-03-11 10:33:51 +00:00
Joern Rennecke
25938114e3
Typo fix.
...
From-SVN: r18449
1998-03-09 12:02:59 +00:00
Joern Rennecke
33f7f35385
rtl.h (addr_diff_vec_flags): New typedef.
...
* rtl.h (addr_diff_vec_flags): New typedef.
(union rtunion_def): New member rt_addr_diff_vec_flags.
(ADDR_DIFF_VEC_FLAGS): New macro.
* sh.c (output_branch): Fix offset overflow problems.
* final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE.
(final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT.
* rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags).
* stmt.c (expand_end_case): Supply new arguments to
gen_rtx_ADDR_DIFF_VEC.
* 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY.
* alpha.h, arc.h, clipper.h, convex.h : Likewise.
* dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise.
* i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise.
* mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise.
* rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise.
* vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise.
* i386/386bsd.h, i386/freebsd-elf.h : Likewise.
* i386/freebsd.h, i386/linux.h : Likewise.
* i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise.
* i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise.
* m68k/mot3300.h, m68k/sgs.h : Likewise.
* m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise.
* sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define.
(CASE_VECTOR_SHORTEN_MODE): Define.
(short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare.
(med_branch_p, braf_branch_p): Don't declare.
(mdep_reorg_phase, barrier_align): Declare.
(ADJUST_INSN_LENGTH): Remove alignment handling.
* sh.c (uid_align, uid_align_max): Deleted.
(max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted.
(short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted.
(cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted.
(output_far_jump): Don't use braf_branch_p.
(output_branchy_insn): Don't use branch_offset.
(find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs.
Remove paired barrier stuff.
Don't use cache_align_p.
Take alignment insns into account.
(fixup_addr_diff_vecs): Reduce to only fixing up the base label of
the addr_diff_vec.
(barrier_align, branch_dest): New function.
(machine_dependent_reorg, split_branches): Remove infrastructure
for branch shortening that is now provided in the backend.
* sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes.
(braf_branch_p, braf_cbranch_p): Likewise.
(attribute length): Use new attributes.
(casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC.
(addr_diff_vec_adjust): Delete.
(align_2): Now a define_expand.
(align_log): Now length 0.
From-SVN: r18433
1998-03-06 14:54:07 +00:00
Jeff Law
956d69504d
Merge from gcc-2.8
...
From-SVN: r16987
1997-12-06 17:31:01 -07:00
J"orn Rennecke
4d7b7169c5
sh.c (final_prescan_insn): Use local label prefix when emitting .uses pseudo-ops.
...
* sh.c (final_prescan_insn): Use local label prefix
when emitting .uses pseudo-ops.
From-SVN: r16949
1997-12-04 17:45:10 +00:00
J"orn Rennecke
1245df60c1
Sync SH port with FSF; enable regmove for SH.
...
From-SVN: r16371
1997-11-08 19:54:57 +00:00
Jeff Law
07f5b9aa23
sh.c (sh_expand_epilogue): Emit a blockage insn before cutting back the stack.
...
* sh.c (sh_expand_epilogue): Emit a blockage insn before
cutting back the stack.
From-SVN: r14362
1997-06-30 14:56:46 -06:00
Jeff Law
4408efce8b
sh.c (trap_exit, sp_switch): New variables.
...
* sh.c (trap_exit, sp_switch): New variables.
(print_operand, case '@'): If trap_exit is nonzero, then use
a trapa instead of an rte/rts to exit the current function.
(sh_expand_prologue): Switch stacks at function entry as needed.
(sh_expand_epilogue): Similarly at function exit.
(function_epilogue): Clear trap_exit and sp_switch too.
(sh_valid_machine_decl_attribute): New function.
* sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Define.
(sp_switch): Declare.
* sh.md (sp_switch_1, sp_switch_2): New named patterns.
From-SVN: r14148
1997-06-05 09:52:34 -06:00
Jim Wilson
f3cd53755b
(output_stack_adjust): Reorganize code for readability.
...
If size is negative, negate and subtract it instead of adding it.
From-SVN: r13847
1997-04-09 15:44:46 -07:00
Joern Rennecke
20ec31d305
(output_stack_adjust): When splitting an adjustment into two parts,
...
make sure the stack is aligned at all times.
From-SVN: r13846
1997-04-09 18:50:38 +01:00
Joern Rennecke
cf641ce6cc
(calc_live_regs): need not save MACL/MACH when not live, and in leaf function.
...
From-SVN: r13627
1997-02-11 20:53:36 +00:00
Joern Rennecke
f3e9068e0a
(calc_live_regs): exclude RETURN_ADDRESS_POINTER_REGNUM.
...
From-SVN: r13626
1997-02-11 19:59:59 +00:00
Joern Rennecke
6ab911bb39
(shl_and_kind): typo fix.
...
From-SVN: r13556
1997-01-27 18:32:05 +00:00
Joern Rennecke
885c9a395a
(output_stack_adjust): New argument TEMP. Changed all callers.
...
If the adjust cannot be done with one, but can be done with two
CONST_OK_FOR_I constants, do it that way.
From-SVN: r13213
1996-11-21 20:53:26 +00:00
Joern Rennecke
24c50999b5
(gen_shl_and): Try to generate shorter constant for and.
...
From-SVN: r13101
1996-11-06 03:48:54 +00:00
Joern Rennecke
ae9d19c0e1
(EXT_SHIFT_SIGNED): New macro.
...
(shl_sext_kind, gen_shl_sext): try left shift - sign extend -
left shift - arithmetic right shift in case 2.
From-SVN: r13059
1996-10-29 01:08:53 +00:00
Joern Rennecke
e577c183dd
sh.c (dump_table): handle SFmode and DFmode.
...
* sh.c (dump_table): handle SFmode and DFmode.
(broken_move): handle simple PARALLEL.
(machine_dependent_reorg, pc-relative move generation): Likewise.
From-SVN: r13021
1996-10-24 01:40:58 +01:00
Jim Wilson
d00d338cdc
(gen_shl_sext): Add missing parameter to shl_sext_kind call.
...
From-SVN: r12990
1996-10-21 15:28:24 -07:00
Jim Wilson
4787bce0e9
(sfunc_uses_reg): New function.
...
(noncall_uses_reg, machine_dependent_reorg, final_prescan_insn):
Handle special functions like function calls for purposes of relaxing.
(noncall_uses_reg): Added some missing cases of registers
being used in non-call instructions.
From-SVN: r12901
1996-10-04 12:56:02 -07:00
Jim Wilson
afad3d2c26
(gen_shl_and, gen_shl_sext): use gen_lowpart to generate rtx in the appropriate mode for zero/sign-extension.
...
(gen_shl_and, gen_shl_sext): use gen_lowpart to
generate rtx in the appropriate mode for zero/sign-extension.
Don't generate a zero bit shift.
(gen_shl_sext) directly use gen_ashift instead of gen_ashrsi3 .
From-SVN: r12884
1996-09-30 14:45:47 -07:00
Jim Wilson
8d4812411e
(ext_shift_insns, ext_shift_amounts): new arrays.
...
(gen_ashift_hi, gen_shifty_hi_op, shl_and_kind): new functions.
rtx_equal_function_value_matters: declare.
(shl_and_length, shl_and_src_length, gen_shl_and): new functions.
(shl_sext_kind, shl_sext_length, gen_shl_sext): new functions.
From-SVN: r12726
1996-09-16 10:40:36 -07:00
Jim Wilson
2afeea0fa3
(regno_reg_class): Change entry 23 from NO_REGS to GENERAL_REGS.
...
(initial_elimination_offset): New variable live_regs_mask. Add
code to handle RETURN_ADDRESS_POINTER_REGNUM.
From-SVN: r12627
1996-08-12 14:43:22 -07:00
Jim Wilson
519164a9ed
(arith_reg_operand): Reject SUBREG of an invalid hard reg.
...
From-SVN: r12594
1996-08-05 14:27:22 -07:00
Jim Wilson
38f357812d
(reg_unused_after): Handle JUMP_INSN inside a sequence.
...
From-SVN: r12554
1996-07-23 17:04:53 -07:00
Ian Lance Taylor
1075dedade
Skip inappropriate LOG_LINK entries when looking for reg-setting call
...
insn
From-SVN: r12442
1996-07-13 04:55:16 +00:00
Jim Wilson
20fef67b3a
(calc_live_regs): For pragma_interrupt case...
...
(calc_live_regs): For pragma_interrupt case, exclude call
clobbered regs that are fixed, explicitly add MACH_REG and MACL_REG.
From-SVN: r12415
1996-07-08 15:33:09 -07:00
Ian Lance Taylor
9c0e838fa0
Don't call ADJUST_INSN_LENGTH on an insn inside a sequence
...
From-SVN: r12336
1996-06-27 15:05:07 +00:00
Ian Lance Taylor
e4fa6b06f0
Align code at the start of loops and after branches.
...
Align code at the start of loops and after branches. Don't accept
negative zero in fp_zero_operand.
From-SVN: r12155
1996-06-04 18:13:21 +00:00
Jim Wilson
adade86813
(output_file_start): Delete misplaced semicolon.
...
From-SVN: r12061
1996-05-20 11:00:02 -07:00
Jim Wilson
e22856e8fb
(prepare_move_operands): If source is r0, and dest is reg+reg
...
MEM, then copy source to a pseudo-reg.
From-SVN: r12036
1996-05-18 17:34:10 -07:00
Doug Evans
d787aec5bd
sh.c (output_option, [...]): Delete.
...
* sh/sh.c (output_option, m_options, output_options): Delete.
(output_file_start): Delete option output support.
From-SVN: r12002
1996-05-17 16:31:43 +00:00
Jim Wilson
cff3d762dc
(gen_shifty_op): Truncate VALUE to avoid out of bounds array access.
...
From-SVN: r11947
1996-05-06 16:39:46 -07:00
Jim Wilson
119d0c36a6
(process_pragma): Take the IDENTIFIER_POINTER tree
...
node instead of a character.
From-SVN: r11840
1996-04-17 12:11:28 -07:00
Jim Wilson
8b760293d7
(reg_unused_after): Return 0 if see a JUMP_INSN.
...
From-SVN: r11501
1996-03-08 11:10:35 -08:00
Jim Wilson
3adbde603a
(find_barrier): Set si_limit to 1018 instead of 1020, and
...
hi_limit to 510 instead of 512.
From-SVN: r11464
1996-03-05 15:28:32 -08:00
Jim Wilson
c1e8e6bd23
(machine_dependent_reorg): In TARGET_RELAX code...
...
(machine_dependent_reorg): In TARGET_RELAX code, when scan
forward from LINK, fail if pass a CODE_LABEL before finding INSN.
Fail if SCAN not INSN is a JUMP_INSN.
From-SVN: r11419
1996-03-04 14:37:57 -08:00
Jim Wilson
1a95a96373
(ctype.h): Delete.
...
(regno_reg_class, reg_class_from_letter, prepare_scc_operands,
broken_move, push, pop, push_regs, calc_live_regs, sh_expand_prologue,
sh_expand_epilogue, initial_elimination_offset, arith_reg_operand):
Add SH3e support.
(sh_builtin_saveregs, fp_zero_operand, fp_one_operand): New functions.
(sh_function_arg, sh_function_arg_partial_nregs): Delete.
From-SVN: r11068
1996-01-18 14:41:00 -08:00
Doug Evans
05a81fe58a
c-lex.c (check_newline): Pass character after `#pragma' to HANDLE_PRAGMA.
...
* c-lex.c (check_newline): Pass character after `#pragma' to
HANDLE_PRAGMA. Don't call get_directive_line if at end of line.
* c-common.c (get_directive_line): Watch for EOF.
* h8300/h8300.h (HANDLE_PRAGMA): New argument `c'.
Must issue `return' now.
* i960/i960.h (HANDLE_PRAGMA): Likewise.
* sh/sh.h (HANDLE_PRAGMA): Likewise.
* nextstep.h (HANDLE_PRAGMA): Likewise.
* h8300/h8300.c (handle_pragma): New argument `ch'.
Simplify pragma processing. Delete support for `#pragma section'.
* i960/i960.c (process_pragma): New argument `c'. Change result to
terminating character.
* nextstep.c (handle_pragma): Likewise.
* sh/sh.c (handle_pragma): Likewise. Also simplified.
From-SVN: r10999
1996-01-15 22:25:24 +00:00
Jim Wilson
c17f53a8cb
(gen_shifty_op): Output a NOP for a shift by 0.
...
(find_barrier): New variables si_limit, hi_limit. Set them depending
on whether we are optimizing. Set found_hi if the destination is
HImode.
(machine_dependent_reorg): If not optimizing, then change scan to a
note instead of calling delete_insn.
From-SVN: r10937
1996-01-02 13:27:38 -08:00
Jim Wilson
49b6d06b41
(shiftcosts): For SH3, max cost of arithmetic right shift is 3.
...
(shiftcosts): For SH3, max cost of arithmetic right
shift is 3.
(expand_ashiftrt): For SH3, if shift cost is more than 3, then
call gen_ashrsi3_d to use shad instruction.
From-SVN: r10674
1995-12-04 18:28:45 -08:00
Jim Wilson
24a25d4575
(from_compare): Get mode from operands instead of using SImode.
...
From-SVN: r10659
1995-11-30 17:02:34 -08:00
Jim Wilson
933c3ba3e7
(noncall_uses_reg): New function.
...
(machine_dependent_reorg): Add support for TARGET_RELAX.
(final_prescan_insn): Likewise.
From-SVN: r10651
1995-11-30 12:47:56 -08:00
Jim Wilson
956a5206b0
(insn-attr.h): Include.
...
(pragma_nosave_low_regs): New global variable.
(calc_live_regs): If SH3 and pragma_nosave_low_regs, then don't
save registers r0 through r7 for interrupt functions.
(function_epilogue): Clear pragma_nosave_low_regs.
(handle_pragma): Set pragma_nosave_low_regs if see pragma for it.
From-SVN: r10649
1995-11-30 12:31:06 -08:00
Richard Kenner
9374bd85eb
(prepare_scc_operands): New local variable mode.
...
(prepare_scc_operands): New local variable mode. Set it from
sh_compare_op0 or sh_compare_op1. Use it instead of SImode in
force_reg calls.
From-SVN: r10500
1995-10-21 18:31:06 -04:00
Richard Kenner
c8f6f18d84
(reg_unused_after): Ifdef out code for handling labels.
...
From-SVN: r10499
1995-10-21 18:29:14 -04:00
Richard Kenner
e081ed261f
(find_barrier): When create new label, set LABEL_NUSES to 1.
...
From-SVN: r10497
1995-10-21 18:25:06 -04:00