PR106907 has few warnings spotted from cppcheck. Here we have warnings for precedence clarification since boolean results are used in bitwise operation. Bitwise xor performed on bool is similar to checking inequality. So changed to inequality operator (!=) instead of bitwise xor (^). And fixed comment indentation
2023-06-12 Jeevitha Palanisamy <jeevi...@linux.ibm.com> gcc/ PR target/106907 * config/rs6000/rs6000.cc (altivec_expand_vec_perm_const): Change bitwise xor to inequality and fix comment indentation. diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index ea68ca6faef..ea7efda8dcd 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -23396,10 +23396,10 @@ altivec_expand_vec_perm_const (rtx target, rtx op0, rtx op1, && GET_MODE (XEXP (op0, 0)) != V8HImode))) continue; - /* For little-endian, the two input operands must be swapped - (or swapped back) to ensure proper right-to-left numbering - from 0 to 2N-1. */ - if (swapped ^ !BYTES_BIG_ENDIAN + /* For little-endian, the two input operands must be swapped + (or swapped back) to ensure proper right-to-left numbering + from 0 to 2N-1. */ + if (swapped != !BYTES_BIG_ENDIAN && icode != CODE_FOR_vsx_xxpermdi_v16qi) std::swap (op0, op1); if (imode != V16QImode)