<div dir="ltr">That's an excellent question. :)<div><br></div><div>I'd say it should _probably_ be defined as having the same boolean value as the hardware's carry-flag, and there should be a TargetLowering function which describes the semantics upon subtract.<br></div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 27, 2017 at 4:53 AM, Roger Ferrer Ibanez via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
a couple of new generic DAG nodes ISD::ADCARRY and ISD::SUBCARRY were recently introduced in <a href="https://reviews.llvm.org/D29872" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D29872</a><br>
<br>
These nodes have three inputs and two outputs, the second output being the "carry". I understand that carry is well defined for ADDCARRY but my question is about SUBCARRY.<br>
<br>
Some architectures set the "carry" of a "x - y" subtraction is set when x < y (e.g x86, "borrow") and some others set it when x >= y (e.g. ARM). Does the ISD::SUBCARRY picks one interpretation (and uses it for combiners on top of this node) or leaves the interpretation to the target.<br>
<br>
Maybe my whole question does not make sense and even if only one interpretation is chosen this does not impact the target?<br>
<br>
Thank you very much,<br>
Roger<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div></div></div>