Commit 23f6f34f by Torbjorn Granlund

(Several places): Declare values from INTVAL(x) as HOST_WIDE_INT.

(uint32_operand): New function.
(output_block_move): Change unroll threshold from 64 to 32.
(compute_movstrsi_length): Corresponding change.
(print_operand): Don't call debug_rtx, just abort.
(initialize_pic): Delete.
(finalize_pic): Use PIC_OFFSET_TABLE_REGNUM rather than 19.

From-SVN: r6292
parent 2d19a71c
...@@ -168,7 +168,7 @@ reg_or_0_or_nonsymb_mem_operand (op, mode) ...@@ -168,7 +168,7 @@ reg_or_0_or_nonsymb_mem_operand (op, mode)
general register. */ general register. */
int int
cint_ok_for_move (intval) cint_ok_for_move (intval)
int intval; HOST_WIDE_INT intval;
{ {
/* OK if ldo, ldil, or zdepi, can be used. */ /* OK if ldo, ldil, or zdepi, can be used. */
return (VAL_14_BITS_P (intval) || (intval & 0x7ff) == 0 return (VAL_14_BITS_P (intval) || (intval & 0x7ff) == 0
...@@ -340,7 +340,6 @@ uint5_operand (op, mode) ...@@ -340,7 +340,6 @@ uint5_operand (op, mode)
return (GET_CODE (op) == CONST_INT && INT_U5_BITS (op)); return (GET_CODE (op) == CONST_INT && INT_U5_BITS (op));
} }
int int
int11_operand (op, mode) int11_operand (op, mode)
rtx op; rtx op;
...@@ -350,6 +349,22 @@ int11_operand (op, mode) ...@@ -350,6 +349,22 @@ int11_operand (op, mode)
} }
int int
uint32_operand (op, mode)
rtx op;
enum machine_mode mode;
{
#if HOST_BITS_PER_WIDE_INT > 32
/* All allowed constants will fit a CONST_INT. */
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) >= 0 && INTVAL (op) < 0x100000000L));
#else
return (GET_CODE (op) == CONST_INT
|| (GET_CODE (op) == CONST_DOUBLE
&& CONST_DOUBLE_HIGH (op) == 0));
#endif
}
int
arith5_operand (op, mode) arith5_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode;
...@@ -360,7 +375,7 @@ arith5_operand (op, mode) ...@@ -360,7 +375,7 @@ arith5_operand (op, mode)
/* True iff zdepi can be used to generate this CONST_INT. */ /* True iff zdepi can be used to generate this CONST_INT. */
int int
zdepi_cint_p (x) zdepi_cint_p (x)
unsigned x; unsigned HOST_WIDE_INT x;
{ {
unsigned lsb_mask, t; unsigned lsb_mask, t;
...@@ -372,10 +387,14 @@ zdepi_cint_p (x) ...@@ -372,10 +387,14 @@ zdepi_cint_p (x)
return ((t & (t - 1)) == 0); return ((t & (t - 1)) == 0);
} }
/* True iff depi or extru can be used to compute (reg & mask). */ /* True iff depi or extru can be used to compute (reg & mask).
Accept bit pattern like these:
0....01....1
1....10....0
1..10..01..1 */
int int
and_mask_p (mask) and_mask_p (mask)
unsigned mask; unsigned HOST_WIDE_INT mask;
{ {
mask = ~mask; mask = ~mask;
mask += mask & -mask; mask += mask & -mask;
...@@ -395,7 +414,7 @@ and_operand (op, mode) ...@@ -395,7 +414,7 @@ and_operand (op, mode)
/* True iff depi can be used to compute (reg | MASK). */ /* True iff depi can be used to compute (reg | MASK). */
int int
ior_mask_p (mask) ior_mask_p (mask)
unsigned mask; unsigned HOST_WIDE_INT mask;
{ {
mask += mask & -mask; mask += mask & -mask;
return (mask & (mask - 1)) == 0; return (mask & (mask - 1)) == 0;
...@@ -512,14 +531,6 @@ legitimize_pic_address (orig, mode, reg) ...@@ -512,14 +531,6 @@ legitimize_pic_address (orig, mode, reg)
return pic_ref; return pic_ref;
} }
/* Set up PIC-specific rtl. This should not cause any insns
to be emitted. */
void
initialize_pic ()
{
}
/* Emit special PIC prologues and epilogues. */ /* Emit special PIC prologues and epilogues. */
void void
...@@ -529,14 +540,13 @@ finalize_pic () ...@@ -529,14 +540,13 @@ finalize_pic ()
{ {
emit_insn_after (gen_rtx (SET, VOIDmode, emit_insn_after (gen_rtx (SET, VOIDmode,
hppa_save_pic_table_rtx, hppa_save_pic_table_rtx,
gen_rtx (REG, Pmode, 19)), gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM)),
get_insns ()); get_insns ());
/* Need to emit this whether or not we obey regdecls, /* Need to emit this whether or not we obey regdecls,
since setjmp/longjmp can cause life info to screw up. */ since setjmp/longjmp can cause life info to screw up. */
hppa_save_pic_table_rtx = 0; hppa_save_pic_table_rtx = 0;
} }
emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx)); emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
} }
/* Try machine-dependent ways of modifying an illegitimate address /* Try machine-dependent ways of modifying an illegitimate address
...@@ -595,7 +605,6 @@ hppa_legitimize_address (x, oldx, mode) ...@@ -595,7 +605,6 @@ hppa_legitimize_address (x, oldx, mode)
rtx x, oldx; rtx x, oldx;
enum machine_mode mode; enum machine_mode mode;
{ {
rtx orig = x; rtx orig = x;
/* Strip off CONST. */ /* Strip off CONST. */
...@@ -765,7 +774,7 @@ emit_move_sequence (operands, mode, scratch_reg) ...@@ -765,7 +774,7 @@ emit_move_sequence (operands, mode, scratch_reg)
&& ! memory_address_p (DFmode, XEXP (operand1, 0)) && ! memory_address_p (DFmode, XEXP (operand1, 0))
&& scratch_reg) && scratch_reg)
{ {
emit_move_insn (scratch_reg, XEXP (operand1 , 0)); emit_move_insn (scratch_reg, XEXP (operand1, 0));
emit_insn (gen_rtx (SET, VOIDmode, operand0, gen_rtx (MEM, mode, emit_insn (gen_rtx (SET, VOIDmode, operand0, gen_rtx (MEM, mode,
scratch_reg))); scratch_reg)));
return 1; return 1;
...@@ -777,7 +786,7 @@ emit_move_sequence (operands, mode, scratch_reg) ...@@ -777,7 +786,7 @@ emit_move_sequence (operands, mode, scratch_reg)
&& ! memory_address_p (DFmode, XEXP (operand0, 0)) && ! memory_address_p (DFmode, XEXP (operand0, 0))
&& scratch_reg) && scratch_reg)
{ {
emit_move_insn (scratch_reg, XEXP (operand0 , 0)); emit_move_insn (scratch_reg, XEXP (operand0, 0));
emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (MEM, mode, scratch_reg), emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (MEM, mode, scratch_reg),
operand1)); operand1));
return 1; return 1;
...@@ -965,7 +974,7 @@ singlemove_string (operands) ...@@ -965,7 +974,7 @@ singlemove_string (operands)
/* See if we can handle this constant in a single instruction. */ /* See if we can handle this constant in a single instruction. */
if (cint_ok_for_move (INTVAL (operands[1]))) if (cint_ok_for_move (INTVAL (operands[1])))
{ {
int intval = INTVAL (operands[1]); HOST_WIDE_INT intval = INTVAL (operands[1]);
if (intval == 0) if (intval == 0)
return "copy 0,%0"; return "copy 0,%0";
...@@ -1008,7 +1017,7 @@ singlemove_string (operands) ...@@ -1008,7 +1017,7 @@ singlemove_string (operands)
instructions. Store the immediate value to insert in OP[0]. */ instructions. Store the immediate value to insert in OP[0]. */
void void
compute_zdepi_operands (imm, op) compute_zdepi_operands (imm, op)
unsigned imm; unsigned HOST_WIDE_INT imm;
unsigned *op; unsigned *op;
{ {
int lsb, len; int lsb, len;
...@@ -1384,7 +1393,7 @@ output_block_move (operands, size_is_constant) ...@@ -1384,7 +1393,7 @@ output_block_move (operands, size_is_constant)
if (align >= 4) if (align >= 4)
{ {
/* Don't unroll too large blocks. */ /* Don't unroll too large blocks. */
if (n_bytes > 64) if (n_bytes > 32)
goto copy_with_loop; goto copy_with_loop;
/* Read and store using two registers, and hide latency /* Read and store using two registers, and hide latency
...@@ -1555,7 +1564,7 @@ compute_movstrsi_length (insn) ...@@ -1555,7 +1564,7 @@ compute_movstrsi_length (insn)
if (align >= 4) if (align >= 4)
{ {
/* Don't unroll too large blocks. */ /* Don't unroll too large blocks. */
if (n_bytes > 64) if (n_bytes > 32)
goto copy_with_loop; goto copy_with_loop;
/* first load */ /* first load */
...@@ -1875,7 +1884,6 @@ load_reg (reg, disp, base) ...@@ -1875,7 +1884,6 @@ load_reg (reg, disp, base)
gen_rtx (PLUS, SImode, gen_rtx (PLUS, SImode,
gen_rtx (REG, SImode, base), gen_rtx (REG, SImode, base),
GEN_INT (disp)))); GEN_INT (disp))));
} }
else else
{ {
...@@ -1905,7 +1913,6 @@ set_reg_plus_d(reg, base, disp) ...@@ -1905,7 +1913,6 @@ set_reg_plus_d(reg, base, disp)
gen_rtx (PLUS, SImode, gen_rtx (PLUS, SImode,
gen_rtx (REG, SImode, base), gen_rtx (REG, SImode, base),
GEN_INT (disp))); GEN_INT (disp)));
} }
else else
{ {
...@@ -2092,7 +2099,7 @@ hppa_expand_prologue() ...@@ -2092,7 +2099,7 @@ hppa_expand_prologue()
register, is saved at sp - 32 (in this function's frame) when register, is saved at sp - 32 (in this function's frame) when
generating PIC code. */ generating PIC code. */
if (flag_pic) if (flag_pic)
store_reg (19, -32, STACK_POINTER_REGNUM); store_reg (PIC_OFFSET_TABLE_REGNUM, -32, STACK_POINTER_REGNUM);
/* Profiling code. /* Profiling code.
...@@ -2345,7 +2352,6 @@ hppa_expand_epilogue () ...@@ -2345,7 +2352,6 @@ hppa_expand_epilogue ()
emit_move_insn (gen_rtx (REG, DFmode, i), emit_move_insn (gen_rtx (REG, DFmode, i),
gen_rtx (MEM, DFmode, gen_rtx (MEM, DFmode,
gen_rtx (POST_INC, DFmode, tmpreg))); gen_rtx (POST_INC, DFmode, tmpreg)));
} }
else else
{ {
...@@ -2689,8 +2695,6 @@ print_operand (file, x, code) ...@@ -2689,8 +2695,6 @@ print_operand (file, x, code)
case LTU: case LTU:
fprintf (file, "<<"); break; fprintf (file, "<<"); break;
default: default:
printf ("Can't grok '%c' operator:\n", code);
debug_rtx (x);
abort (); abort ();
} }
return; return;
...@@ -2718,8 +2722,6 @@ print_operand (file, x, code) ...@@ -2718,8 +2722,6 @@ print_operand (file, x, code)
case LTU: case LTU:
fprintf (file, ">>="); break; fprintf (file, ">>="); break;
default: default:
printf ("Can't grok '%c' operator:\n", code);
debug_rtx (x);
abort (); abort ();
} }
return; return;
...@@ -2741,8 +2743,6 @@ print_operand (file, x, code) ...@@ -2741,8 +2743,6 @@ print_operand (file, x, code)
case LE: case LE:
fprintf (file, "!<="); break; fprintf (file, "!<="); break;
default: default:
printf ("Can't grok '%c' operator:\n", code);
debug_rtx (x);
abort (); abort ();
} }
return; return;
...@@ -2770,8 +2770,6 @@ print_operand (file, x, code) ...@@ -2770,8 +2770,6 @@ print_operand (file, x, code)
case LTU: case LTU:
fprintf (file, ">>"); break; fprintf (file, ">>"); break;
default: default:
printf ("Can't grok '%c' operator:\n", code);
debug_rtx (x);
abort (); abort ();
} }
return; return;
...@@ -2799,8 +2797,6 @@ print_operand (file, x, code) ...@@ -2799,8 +2797,6 @@ print_operand (file, x, code)
case LTU: case LTU:
fprintf (file, "<<="); break; fprintf (file, "<<="); break;
default: default:
printf ("Can't grok '%c' operator:\n", code);
debug_rtx (x);
abort (); abort ();
} }
return; return;
...@@ -3706,7 +3702,7 @@ output_movb (operands, insn, which_alternative, reverse_comparison) ...@@ -3706,7 +3702,7 @@ output_movb (operands, insn, which_alternative, reverse_comparison)
return "movb,%C2 %1,%0,%3"; return "movb,%C2 %1,%0,%3";
else if (length == 8) else if (length == 8)
{ {
/* Handle weird backwards branch with a fulled delay slot /* Handle weird backwards branch with a filled delay slot
which is nullified. */ which is nullified. */
if (dbr_sequence_length () != 0 if (dbr_sequence_length () != 0
&& ! forward_branch_p (insn) && ! forward_branch_p (insn)
...@@ -4013,4 +4009,3 @@ jump_in_call_delay (insn) ...@@ -4013,4 +4009,3 @@ jump_in_call_delay (insn)
else else
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment