<div class="gmail_extra"><div class="gmail_quote">On Sat, Aug 11, 2012 at 3:49 PM, Michael Liao <span dir="ltr"><<a href="mailto:michael.liao@intel.com" target="_blank" class="cremed">michael.liao@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
Sorry, PR13577 and recent failures of compiler-rt failures is introduced<br>
by r161687. The root cause is that FCMOV (only used for 80-bit double)<br>
only supports a subset of X86 conditions. The attached patch fixes that<br>
by checking whether it's a CMOV on f80 and whether the condition is<br>
valid. A minimal test case (copysign) for PR13577 is also added.<br></blockquote><div><br></div><div>Hmm, my diagnosis of that PR may have been a bit off -- you should check whether this patch actually fixes it, as it seems to potentially predate r161687. Fixing it may however re-use this logic.</div>
<div><br></div><div>Either way, that patch seems fine, and should at least fix the failures David sent you mail about. One nit-pick:</div><div><br></div><div><div>@@ -13877,10 +13893,14 @@ static SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG,</div>
<div> </div><div>   Flags = BoolTestSetCCCombine(Cond, CC);</div><div>   if (Flags.getNode()) {</div><div>-    SDValue Ops[] = { FalseOp, TrueOp,</div><div>-                      DAG.getConstant(CC, MVT::i8), Flags };</div>
<div>-    return DAG.getNode(X86ISD::CMOV, DL, N->getVTList(),</div><div>-                       Ops, array_lengthof(Ops));</div><div>+    // Check for FCMOV which only supports a subset of X86 cond.</div><div>+    if (FalseOp.getValueType() != MVT::f80 ||</div>
<div>+        IsValidFCMOVCondition(CC)) {</div><div><br></div><div>Just combine this and the above condition:</div><div><br></div><div>if (Flags.genNode() && (FalseOp.getValueType() != MVT::f80 || ...)) {</div><div>
  ...</div><div>}</div><div><br></div><div>+      SDValue Ops[] = { FalseOp, TrueOp,</div><div>+                        DAG.getConstant(CC, MVT::i8), Flags };</div><div>+      return DAG.getNode(X86ISD::CMOV, DL, N->getVTList(),</div>
<div>+                         Ops, array_lengthof(Ops));</div><div>+    }</div><div>   }</div></div><div><br></div></div></div>