Commit cd9b5ca8 by Kazu Hirata Committed by Kazu Hirata

h8300.c (output_a_shift): Do not output a variable shift.

	* config/h8300/h8300.c (output_a_shift): Do not output a
	variable shift.
	* config/h8300/h8300.md (two splitters): New.

From-SVN: r60915
parent 30e3682e
2003-01-05 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (output_a_shift): Do not output a
variable shift.
* config/h8300/h8300.md (two splitters): New.
2003-01-05 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.md: Disable the movstrsi define_split.
......
......@@ -3197,20 +3197,9 @@ output_a_shift (operands)
if (GET_CODE (operands[2]) != CONST_INT)
{
/* Indexing by reg, so have to loop and test at top. */
output_asm_insn ("mov.b %X2,%X4", operands);
fprintf (asm_out_file, "\tble .Lle%d\n", loopend_lab);
/* Get the assembler code to do one shift. */
get_shift_alg (shift_type, shift_mode, 1, &info);
fprintf (asm_out_file, ".Llt%d:\n", loopend_lab);
output_asm_insn (info.shift1, operands);
output_asm_insn ("add #0xff,%X4", operands);
fprintf (asm_out_file, "\tbne .Llt%d\n", loopend_lab);
fprintf (asm_out_file, ".Lle%d:\n", loopend_lab);
return "";
/* This case must be taken care of by one of the two splitters
that convert a variable shift into a loop. */
abort ();
}
else
{
......
......@@ -2234,6 +2234,75 @@
[(set (attr "length")
(symbol_ref "compute_a_shift_length (insn, operands)"))
(set_attr "cc" "clobber")])
;; Split a variable shift into a loop. If the register containing
;; the shift count dies, then we just use that register.
(define_split
[(parallel
[(set (match_operand 0 "register_operand" "")
(match_operator 2 "nshift_operator"
[(match_dup 0)
(match_operand:QI 1 "register_operand" "")]))
(clobber (match_operand:QI 3 "register_operand" ""))])]
"flow2_completed
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1]))"
[(set (cc0)
(match_dup 1))
(set (pc)
(if_then_else (le (cc0) (const_int 0))
(label_ref (match_dup 5))
(pc)))
(match_dup 4)
(parallel
[(set (match_dup 0)
(match_op_dup 2 [(match_dup 0) (const_int 1)]))
(clobber (scratch:QI))])
(set (match_dup 1)
(plus:QI (match_dup 1) (const_int -1)))
(set (cc0)
(match_dup 1))
(set (pc)
(if_then_else (ne (cc0) (const_int 0))
(label_ref (match_dup 4))
(pc)))
(match_dup 5)]
"operands[4] = gen_label_rtx ();
operands[5] = gen_label_rtx ();")
(define_split
[(parallel
[(set (match_operand 0 "register_operand" "")
(match_operator 2 "nshift_operator"
[(match_dup 0)
(match_operand:QI 1 "register_operand" "")]))
(clobber (match_operand:QI 3 "register_operand" ""))])]
"flow2_completed
&& !find_regno_note (insn, REG_DEAD, REGNO (operands[1]))"
[(set (match_dup 3)
(match_dup 1))
(set (cc0)
(match_dup 3))
(set (pc)
(if_then_else (le (cc0) (const_int 0))
(label_ref (match_dup 5))
(pc)))
(match_dup 4)
(parallel
[(set (match_dup 0)
(match_op_dup 2 [(match_dup 0) (const_int 1)]))
(clobber (scratch:QI))])
(set (match_dup 3)
(plus:QI (match_dup 3) (const_int -1)))
(set (cc0)
(match_dup 3))
(set (pc)
(if_then_else (ne (cc0) (const_int 0))
(label_ref (match_dup 4))
(pc)))
(match_dup 5)]
"operands[4] = gen_label_rtx ();
operands[5] = gen_label_rtx ();")
;; ----------------------------------------------------------------------
;; ROTATIONS
......
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