"mul %2,%0"
[(set_attr "cc" "set_zn")])
-(define_expand "udivmodsi4"
- [(parallel [(set (match_operand:SI 0 "register_operand" "")
- (udiv:SI (match_operand:SI 1 "register_operand" "")
- (match_operand:SI 2 "register_operand" "")))
- (set (match_operand:SI 3 "register_operand" "")
- (umod:SI (match_dup 1) (match_dup 2)))])]
- ""
- "
-{
- rtx reg = gen_reg_rtx (SImode);
- emit_move_insn (reg, GEN_INT (0));
- emit_insn (gen_clear_mdr (reg));
-}")
-
-(define_insn ""
+(define_insn "udivmodsi4"
[(set (match_operand:SI 0 "general_operand" "=d")
(udiv:SI (match_operand:SI 1 "general_operand" "0")
(match_operand:SI 2 "general_operand" "d")))
- (set (match_operand:SI 3 "general_operand" "=d")
+ (set (match_operand:SI 3 "general_operand" "=&d")
(umod:SI (match_dup 1) (match_dup 2)))]
""
"*
{
+ if (zero_dreg)
+ output_asm_insn (\"mov %0,mdr\", &zero_dreg);
+ else
+ output_asm_insn (\"sub %3,%3\;mov %3,mdr\", operands);
+
if (find_reg_note (insn, REG_UNUSED, operands[3]))
return \"divu %2,%0\";
else
}"
[(set_attr "cc" "set_zn")])
-(define_expand "divmodsi4"
- [(parallel [(set (match_operand:SI 0 "register_operand" "")
- (div:SI (match_operand:SI 1 "register_operand" "")
- (match_operand:SI 2 "register_operand" "")))
- (set (match_operand:SI 3 "register_operand" "")
- (mod:SI (match_dup 1) (match_dup 2)))])]
- ""
- "")
-
-(define_insn ""
+(define_insn "divmodsi4"
[(set (match_operand:SI 0 "general_operand" "=d")
(div:SI (match_operand:SI 1 "general_operand" "0")
(match_operand:SI 2 "general_operand" "d")))
}"
[(set_attr "cc" "set_zn")])
-(define_insn "clear_mdr"
- [(unspec_volatile [(const_int 2)] 0)
- (use (match_operand:SI 0 "register_operand" "d"))]
- ""
- "mov %0,mdr"
- [(set_attr "cc" "none")])
\f
;; ----------------------------------------------------------------------
;; AND INSTRUCTIONS