This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]