Skip to content

Commit 6036a1a

Browse files
Alpha: Remove code duplication in block clear trailer
Remove code duplication in the part of `alpha_expand_block_clear' that handles any aligned trailing part of the block, observing that the two legs of code only differ by the machine mode and that we already take the same approach with handling any unaligned prefix earlier on. No functional change, just code shuffling. gcc/ * config/alpha/alpha.cc (alpha_expand_block_clear): Fold two legs of a conditional together.
1 parent 3c99ea1 commit 6036a1a

File tree

1 file changed

+12
-29
lines changed

1 file changed

+12
-29
lines changed

gcc/config/alpha/alpha.cc

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4236,40 +4236,23 @@ alpha_expand_block_clear (rtx operands[])
42364236

42374237
/* If we have appropriate alignment (and it wouldn't take too many
42384238
instructions otherwise), mask out the bytes we need. */
4239-
if (TARGET_BWX ? words > 2 : bytes > 0)
4239+
if ((TARGET_BWX ? words > 2 : bytes > 0)
4240+
&& (align >= 64 || (align >= 32 && bytes < 4)))
42404241
{
4241-
if (align >= 64)
4242-
{
4243-
rtx mem, tmp;
4244-
HOST_WIDE_INT mask;
4242+
machine_mode mode = (align >= 64 ? DImode : SImode);
4243+
rtx mem, tmp;
4244+
HOST_WIDE_INT mask;
42454245

4246-
mem = adjust_address (orig_dst, DImode, ofs);
4247-
set_mem_alias_set (mem, 0);
4246+
mem = adjust_address (orig_dst, mode, ofs);
4247+
set_mem_alias_set (mem, 0);
42484248

4249-
mask = HOST_WIDE_INT_M1U << (bytes * 8);
4249+
mask = HOST_WIDE_INT_M1U << (bytes * 8);
42504250

4251-
tmp = expand_binop (DImode, and_optab, mem, GEN_INT (mask),
4252-
NULL_RTX, 1, OPTAB_WIDEN);
4251+
tmp = expand_binop (mode, and_optab, mem, GEN_INT (mask),
4252+
NULL_RTX, 1, OPTAB_WIDEN);
42534253

4254-
emit_move_insn (mem, tmp);
4255-
return 1;
4256-
}
4257-
else if (align >= 32 && bytes < 4)
4258-
{
4259-
rtx mem, tmp;
4260-
HOST_WIDE_INT mask;
4261-
4262-
mem = adjust_address (orig_dst, SImode, ofs);
4263-
set_mem_alias_set (mem, 0);
4264-
4265-
mask = HOST_WIDE_INT_M1U << (bytes * 8);
4266-
4267-
tmp = expand_binop (SImode, and_optab, mem, GEN_INT (mask),
4268-
NULL_RTX, 1, OPTAB_WIDEN);
4269-
4270-
emit_move_insn (mem, tmp);
4271-
return 1;
4272-
}
4254+
emit_move_insn (mem, tmp);
4255+
return 1;
42734256
}
42744257

42754258
if (!TARGET_BWX && bytes >= 4)

0 commit comments

Comments
 (0)