1*c85f09ccSJohn Levon // If (t >> S) is simplified into (x >> S) 2*c85f09ccSJohn Levon // then the whole expression will be 0. 3*c85f09ccSJohn Levon // The test is only interesting if the sub-expression 4*c85f09ccSJohn Levon // (x & M) is referenced more than once 5*c85f09ccSJohn Levon // (because otherwise other simplifications apply). lsr_and1(unsigned x)6*c85f09ccSJohn Levonunsigned lsr_and1(unsigned x) 7*c85f09ccSJohn Levon { 8*c85f09ccSJohn Levon unsigned t = (x & 0xfffff000); 9*c85f09ccSJohn Levon return ((t >> 12) ^ (x >> 12)) & t; 10*c85f09ccSJohn Levon } 11*c85f09ccSJohn Levon 12*c85f09ccSJohn Levon /* 13*c85f09ccSJohn Levon * check-name: lsr-and1 14*c85f09ccSJohn Levon * check-command: test-linearize -Wno-decl $file 15*c85f09ccSJohn Levon * 16*c85f09ccSJohn Levon * check-output-ignore 17*c85f09ccSJohn Levon * check-output-contains: ret\\..*\\$0$ 18*c85f09ccSJohn Levon */ 19