[llvm-commits] [llvm] r57247 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Andrew Lenharth andrewl at lenharth.org
Tue Oct 7 11:27:47 PDT 2008


On Tue, Oct 7, 2008 at 12:53 PM, Dan Gohman <gohman at apple.com> wrote:
> Previously, it was possible to do an i256 add on x86. I guess we
> don't have any testcases for that in the repository though.
> How about a more general approach? Warning untested code:
>
>  bool hasCarry = false;
>  for (unsigned BitSize = NVT.getSizeInBits(); BitSize != 0; BitSize /= 2) {
>    MVT AVT = MVT::getIntegerVT(BitSize);
>    if (TLI.isOperationLegal(OpV, AVT)) {
>      hasCarry = true;
>      break;
>    }
>  }

Yes, much better.  And now tested.

Andrew



More information about the llvm-commits mailing list