[PATCH]rs6000: optimize li+rldicr+cmpd==>rotldi+cmpldi for 16bits cst

2022-05-08 Thread Jiufu Guo via Gcc-patches
Hi! I would like to ping for trunk: https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591905.html BR, Jiufu -- When checking eq/neq with a constant which has only 16bits, then it can be optimized to check the rotated data. By this, the constant building is optimized. As the exam

[PATCH]rs6000: optimize li+rldicr+cmpd==>rotldi+cmpldi for 16bits

2022-03-17 Thread Jiufu Guo via Gcc-patches
When checking eq/neq with a constant which has only 16bits, then it can be optimized to check the rotated data. By this, the constant building is optimized. As the example in PR103743: For "in == 0x8000LL", this patch generates: rotldi %r3,%r3,16 cmpldi %cr0,%r3,32768