Skip to content

Commit

Permalink
Support bitwise, shift, comparison, and remainder operators
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Aug 1, 2024
1 parent 7d1e26c commit 32aac24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Differentiator/BaseForwardModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,9 @@ BaseForwardModeVisitor::VisitBinaryOperator(const BinaryOperator* BinOp) {
} else
opDiff = BuildOp(BO_Comma, BuildParens(Ldiff.getExpr()),
BuildParens(Rdiff.getExpr_dx()));
} else if (BinOp->isLogicalOp()) {
} else if (BinOp->isLogicalOp() || BinOp->isBitwiseOp() ||
BinOp->isShiftOp() || BinOp->isComparisonOp() ||
opCode == BO_Rem) {
// For (A && B) return ((dA, A) && (dB, B)) to ensure correct evaluation and
// correct derivative execution.
auto buildOneSide = [this](StmtDiff& Xdiff) {
Expand Down

0 comments on commit 32aac24

Please sign in to comment.