This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Does neon_vset_lane<mode> expand wrong code when BYTES_BIG_ENDIAN?
- From: Xinyu Qi <xyqi at marvell dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 4 Jan 2012 23:13:55 -0800
- Subject: Does neon_vset_lane<mode> expand wrong code when BYTES_BIG_ENDIAN?
Hi,
In neon.md, the define_expand "neon_vset_lane<mode>" has extra code to deal with the imm operand when BYTE_BIG_ENDIAN,
unsigned int elt = INTVAL (operands[3]);
if (BYTES_BIG_ENDIAN)
{
unsigned int reg_nelts
= 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode));
elt ^= reg_nelts - 1;
}
Then,
emit_insn (gen_vec_set<mode>_internal (operands[0], operands[1],
GEN_INT (1 << elt), operands[2]));
While the define_insn "vec_set<mode>_internal" has the extra code as well,
int elt = ffs ((int) INTVAL (operands[2])) - 1;
if (BYTES_BIG_ENDIAN)
elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
operands[2] = GEN_INT (elt);
It seems these two parts of the code dealing with BYTE_BIG_ENDIAN will cancel each other,
and result in the original imm op unchanged.
Is there something wrong with these code?
Thanks,
Xinyu