@@ -4556,7 +4556,8 @@ arc_split_ashr (rtx *operands)
if (CONST_INT_P (operands[2]))
{
int n = INTVAL (operands[2]) & 0x1f;
- if (n <= 4)
+ if (n <= 4
+ || (n == 5 && !optimize_function_for_size_p (cfun)))
{
if (n != 0)
{
@@ -4577,6 +4578,17 @@ arc_split_ashr (rtx *operands)
emit_insn (gen_ashrsi3_cnt1 (operands[0], operands[0]));
return;
}
+ else if (n >= 19 && n <= 29 && TARGET_SWAP
+ && !optimize_function_for_size_p (cfun))
+ {
+ emit_insn (gen_rotrsi2_cnt16 (operands[0], operands[1]));
+ emit_insn (gen_extendhisi2 (operands[0],
+ gen_lowpart (HImode, operands[0])));
+ operands[1] = operands[0];
+ operands[2] = GEN_INT (n - 16);
+ arc_split_ashr (operands);
+ return;
+ }
else if (n == 30)
{
rtx tmp = gen_reg_rtx (SImode);
@@ -4592,6 +4604,13 @@ arc_split_ashr (rtx *operands)
emit_insn (gen_sbc (operands[0], operands[0], operands[0]));
return;
}
+ else if ((n & 1) != 0 && !optimize_function_for_size_p (cfun))
+ {
+ emit_insn (gen_ashrsi3_cnt1 (operands[0], operands[1]));
+ emit_insn (gen_ashrsi3_loop (operands[0], operands[0],
+ GEN_INT (n - 1)));
+ return;
+ }
}
emit_insn (gen_ashrsi3_loop (operands[0], operands[1], operands[2]));
@@ -4604,7 +4623,8 @@ arc_split_lshr (rtx *operands)
if (CONST_INT_P (operands[2]))
{
int n = INTVAL (operands[2]) & 0x1f;
- if (n <= 4)
+ if (n <= 4
+ || (n == 5 && !optimize_function_for_size_p (cfun)))
{
if (n != 0)
{
@@ -4623,6 +4643,15 @@ arc_split_lshr (rtx *operands)
emit_insn (gen_lshrsi3_cnt1 (operands[0], operands[0]));
return;
}
+ else if (n >= 20 && n <= 29 && TARGET_SWAP && TARGET_V2
+ && !optimize_function_for_size_p (cfun))
+ {
+ emit_insn (gen_lshrsi2_cnt16 (operands[0], operands[1]));
+ operands[1] = operands[0];
+ operands[2] = GEN_INT (n - 16);
+ arc_split_lshr (operands);
+ return;
+ }
else if (n == 30)
{
rtx tmp = gen_reg_rtx (SImode);
@@ -4638,6 +4667,13 @@ arc_split_lshr (rtx *operands)
emit_insn (gen_scc_ltu_cc_c (operands[0]));
return;
}
+ else if ((n & 1) != 0 && !optimize_function_for_size_p (cfun))
+ {
+ emit_insn (gen_lshrsi3_cnt1 (operands[0], operands[1]));
+ emit_insn (gen_lshrsi3_loop (operands[0], operands[0],
+ GEN_INT (n - 1)));
+ return;
+ }
}
emit_insn (gen_lshrsi3_loop (operands[0], operands[1], operands[2]));