diff options
Diffstat (limited to 'gcc/config/mips/loongson.md')
-rw-r--r-- | gcc/config/mips/loongson.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/config/mips/loongson.md b/gcc/config/mips/loongson.md index 98b5113fbb5..8cdb5f466e9 100644 --- a/gcc/config/mips/loongson.md +++ b/gcc/config/mips/loongson.md @@ -473,3 +473,23 @@ "TARGET_HARD_FLOAT && TARGET_LOONGSON_VECTORS" "punpckl<V_stretch_half_suffix>\t%0,%1,%2" [(set_attr "type" "fdiv")]) + +;; Integer division and modulus. + +(define_insn "<u>div<mode>3" + [(set (match_operand:GPR 0 "register_operand" "=&d") + (any_div:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d")))] + "TARGET_LOONGSON_2EF" + { return mips_output_division ("<d>div<u>.g\t%0,%1,%2", operands); } + [(set_attr "type" "idiv3") + (set_attr "mode" "<MODE>")]) + +(define_insn "<u>mod<mode>3" + [(set (match_operand:GPR 0 "register_operand" "=&d") + (any_mod:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d")))] + "TARGET_LOONGSON_2EF" + { return mips_output_division ("<d>mod<u>.g\t%0,%1,%2", operands); } + [(set_attr "type" "idiv3") + (set_attr "mode" "<MODE>")]) |