Skip to content

Commit

Permalink
Fixed clang-format complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
dpankratz committed May 24, 2020
1 parent 67567ff commit 2e58173
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/tir/transforms/lower_intrin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ class IntrinInjecter : public tvm::arith::IRMutatorWithAnalyzer {

// floor(a / b)
auto fdtype = DataType::Float(dtype.bits() * 2, dtype.lanes());
auto div = tir::CastNode::make(fdtype, op->a)
/ tir::CastNode::make(fdtype, op->b);
auto div = tir::CastNode::make(fdtype, op->a) / tir::CastNode::make(fdtype, op->b);
auto f = tvm::floor(div);
return tir::CastNode::make(dtype, VisitExpr_(f.as<CallNode>()));
} else {
Expand All @@ -124,7 +123,7 @@ class IntrinInjecter : public tvm::arith::IRMutatorWithAnalyzer {
PrimExpr rdiv = truncdiv(op->a, op->b);
PrimExpr rmod = truncmod(op->a, op->b);
return tir::SelectNode::make((op->b >= 0 && rmod >= 0) || (op->b < 0 && rmod <= 0), rdiv,
rdiv - make_const(dtype, 1));
rdiv - make_const(dtype, 1));
}
}
}
Expand Down Expand Up @@ -174,8 +173,7 @@ class IntrinInjecter : public tvm::arith::IRMutatorWithAnalyzer {

// a - floor(a / b) * b
auto fdtype = DataType::Float(dtype.bits() * 2, dtype.lanes());
auto div = tir::CastNode::make(fdtype, op->a)
/ tir::CastNode::make(fdtype, op->b);
auto div = tir::CastNode::make(fdtype, op->a) / tir::CastNode::make(fdtype, op->b);
auto f = tvm::floor(div);
auto floor_lowered = tir::CastNode::make(dtype, VisitExpr_(f.as<CallNode>()));

Expand All @@ -189,7 +187,7 @@ class IntrinInjecter : public tvm::arith::IRMutatorWithAnalyzer {
// b < 0 && rmod < 0 -> rmod
// b < 0 && rmod > 0 -> rmod + b
return tir::SelectNode::make((op->b >= 0 && rmod >= 0) || (op->b < 0 && rmod <= 0), rmod,
rmod + op->b);
rmod + op->b);
}
}
}
Expand Down

0 comments on commit 2e58173

Please sign in to comment.