[PATCH] D35192: [ARM] Use ADDCARRY / SUBCARRY

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 11:04:16 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:12823
+    }
     // These nodes' second result is a boolean
     Known.Zero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);
----------------
rogfer01 wrote:
> efriedma wrote:
> > Is this true?
> Maybe I do not understand what this function computes.
> 
> The result of the first operand (`Op.getResNo() == 0`) should be either 0 or 1 in the given nodes so all bits are zero but the lowermost one.
I was asking specifically about the comment "These nodes' second result is a boolean".  (I know it isn't new, but we should fix it while we're here.)


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:7448
+    // Now convert the carry flag into a boolean value. We do this
+    // using ARMISDD:ADDE 0, 0, Carry
+    Carry = DAG.getNode(ARMISD::ADDE, DL, VTs, DAG.getConstant(0, DL, MVT::i32),
----------------
Typo "ARMISDD".


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:7458
+    // Now convert the carry flag into a boolean value. We do this using
+    // ARMISDD:SUBE 1, 0, Carry because SUBCARRY actually returns a borrow not a
+    // carry.
----------------
Typo "ARMISDD".


https://reviews.llvm.org/D35192





More information about the llvm-commits mailing list