<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Using the Thumb-2 target we see that ORN ( a | ^b) and BIC (a & ^b) have similar patterns, as we would expect:<div><br></div><div><div><font class="Apple-style-span" face="'Courier New'" size="3"><span class="Apple-style-span" style="font-size: 12px;">defm t2BIC : T2I_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="3"><span class="Apple-style-span" style="font-size: 12px;">defm t2ORN : T2I_bin_irs<"orn", BinOpFrag<(or node:$LHS, (not node:$RHS))>>;</span></font></div><div><br></div><div>Compiling the following three works as expected:</div><div><br></div><div><div><font class="Apple-style-span" face="'Courier New'" size="3"><span class="Apple-style-span" style="font-size: 12px;"> %tmp1 = xor i32 4294967295, %b ; %tmp2 = or i32 %a, %tmp1 --> </span></font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;"><font class="Apple-style-span" face="'Courier New'"> </font></span></font></span><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;"><font class="Apple-style-span" face="'Courier New'">orn r0, r0, r1</font></span></font></div><div><div><font class="Apple-style-span" face="'Courier New'"> %tmp1 = xor i32 4294967295, %b ; %tmp2 = or i32 %tmp1, %a --> orn r0, r0, r1</font></div></div><div><div><font class="Apple-style-span" face="'Courier New'"> %tmp = xor i32 %b, 4294967295 ; %tmp1 = and i32 %a, %tmp --> bic r0, r0, r1</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div>But this doesn't:</div><div><br></div><div><div><font class="Apple-style-span" face="'Courier New'" size="3"><span class="Apple-style-span" style="font-size: 12px;"> %tmp = xor i32 %b, 4294967295 ; %tmp1 = and i32 %tmp, %a --> eor r1, r1, #4294967295 ; a<span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><font class="Apple-style-span" face="'Courier New'" size="3"><span class="Apple-style-span" style="font-size: 12px;">nd r0, r1, r0</span></font></span></span></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div>On the surface it seems that the selector is not commuting the AND operands. I've attached the complete test files. I can take a look but I need a pointer to get started.</div><div><br></div><div>David</div><div><br></div><div></div></div></div></div></div></body></html>