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
{
[(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 ();")
\f
;; ----------------------------------------------------------------------
;; ROTATIONS