Message ID | 402a4179-fea7-43b4-9e2e-4b164c76deb2@linux.vnet.ibm.com |
---|---|
State | New |
Headers | show |
Series | [v2] rs6000: Change bitwise xor to an equality operator [PR106907] | expand |
Hi, on 2023/10/11 19:50, jeevitha wrote: > Hi All, > > The following patch has been bootstrapped and regtested on powerpc64le-linux. > > PR106907 has a few warnings spotted from cppcheck. These warnings > are related to the need of precedence clarification. Instead of using xor, > it has been changed to equality check, which achieves the same result. > Additionally, comment indentation has been fixed. > Ok for trunk, thanks! BR, Kewen > 2023-10-11 Jeevitha Palanisamy <jeevitha@linux.ibm.com> > > gcc/ > PR target/106907 > * config/rs6000/rs6000.cc (altivec_expand_vec_perm_const): Change bitwise > xor to an equality and fix comment indentation. > > diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc > index 2828f01413c..00191f8656b 100644 > --- a/gcc/config/rs6000/rs6000.cc > +++ b/gcc/config/rs6000/rs6000.cc > @@ -23624,10 +23624,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) > >
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 2828f01413c..00191f8656b 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -23624,10 +23624,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)