[PATCH] D53053: [Intrinsic] Signed Saturation Addition Intrinsic

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 12 01:11:43 PDT 2018


bjope added inline comments.


================
Comment at: lib/CodeGen/TargetLoweringBase.cpp:1890
+
+  SDValue SumPos = DAG.getSetCC(dl, BoolVT, Sum, Zero, ISD::SETGT);
+  SDValue SumNeg = DAG.getSetCC(dl, BoolVT, Sum, Zero, ISD::SETLT);
----------------
Maybe I miss something, but shouldn't it be SETGE here?
Assume that we have and SADDSAT(SignedMin, SignedMin). Then we overflow, and the result it zero. But we should still saturate to SignedMin.


Repository:
  rL LLVM

https://reviews.llvm.org/D53053





More information about the llvm-commits mailing list