diff --git a/mlir/include/mlir/Dialect/AffineOps/EDSC/Builders.h b/mlir/include/mlir/Dialect/AffineOps/EDSC/Builders.h --- a/mlir/include/mlir/Dialect/AffineOps/EDSC/Builders.h +++ b/mlir/include/mlir/Dialect/AffineOps/EDSC/Builders.h @@ -113,6 +113,16 @@ using op::operator/; return static_cast(*this) / e; } +template +ValueHandle TemplatedIndexedValue::operator%(ValueHandle e) { + using op::operator%; + return static_cast(*this) % e; +} +template +ValueHandle TemplatedIndexedValue::operator^(ValueHandle e) { + using op::operator^; + return static_cast(*this) ^ e; +} template OperationHandle TemplatedIndexedValue::operator+=(ValueHandle e) { @@ -134,6 +144,58 @@ using op::operator/; return Store(*this / e, getBase(), {indices.begin(), indices.end()}); } +template +OperationHandle TemplatedIndexedValue::operator%=(ValueHandle e) { + using op::operator%; + return Store(*this % e, getBase(), {indices.begin(), indices.end()}); +} +template +OperationHandle TemplatedIndexedValue::operator^=(ValueHandle e) { + using op::operator^; + return Store(*this ^ e, getBase(), {indices.begin(), indices.end()}); +} + +template +ValueHandle TemplatedIndexedValue::operator&&(ValueHandle e) { + using op::operator&&; + return static_cast(*this) && e; +} +template +ValueHandle TemplatedIndexedValue::operator||(ValueHandle e) { + using op::operator||; + return static_cast(*this) || e; +} + +template +ValueHandle TemplatedIndexedValue::operator==(ValueHandle e) { + using op::operator==; + return static_cast(*this) == e; +} +template +ValueHandle TemplatedIndexedValue::operator!=(ValueHandle e) { + using op::operator!=; + return static_cast(*this) != e; +} +template +ValueHandle TemplatedIndexedValue::operator<(ValueHandle e) { + using op::operator<; + return static_cast(*this) < e; +} +template +ValueHandle TemplatedIndexedValue::operator<=(ValueHandle e) { + using op::operator<=; + return static_cast(*this) <= e; +} +template +ValueHandle TemplatedIndexedValue::operator>(ValueHandle e) { + using op::operator>; + return static_cast(*this) > e; +} +template +ValueHandle TemplatedIndexedValue::operator>=(ValueHandle e) { + using op::operator>=; + return static_cast(*this) >= e; +} } // namespace edsc } // namespace mlir diff --git a/mlir/include/mlir/EDSC/Builders.h b/mlir/include/mlir/EDSC/Builders.h --- a/mlir/include/mlir/EDSC/Builders.h +++ b/mlir/include/mlir/EDSC/Builders.h @@ -543,10 +543,14 @@ ValueHandle operator-(ValueHandle e); ValueHandle operator*(ValueHandle e); ValueHandle operator/(ValueHandle e); + ValueHandle operator%(ValueHandle e); + ValueHandle operator^(ValueHandle e); OperationHandle operator+=(ValueHandle e); OperationHandle operator-=(ValueHandle e); OperationHandle operator*=(ValueHandle e); OperationHandle operator/=(ValueHandle e); + OperationHandle operator%=(ValueHandle e); + OperationHandle operator^=(ValueHandle e); ValueHandle operator+(TemplatedIndexedValue e) { return *this + static_cast(e); } @@ -559,6 +563,12 @@ ValueHandle operator/(TemplatedIndexedValue e) { return *this / static_cast(e); } + ValueHandle operator%(TemplatedIndexedValue e) { + return *this % static_cast(e); + } + ValueHandle operator^(TemplatedIndexedValue e) { + return *this ^ static_cast(e); + } OperationHandle operator+=(TemplatedIndexedValue e) { return this->operator+=(static_cast(e)); } @@ -571,6 +581,46 @@ OperationHandle operator/=(TemplatedIndexedValue e) { return this->operator/=(static_cast(e)); } + OperationHandle operator%=(TemplatedIndexedValue e) { + return this->operator%=(static_cast(e)); + } + OperationHandle operator^=(TemplatedIndexedValue e) { + return this->operator^=(static_cast(e)); + } + + ValueHandle operator&&(ValueHandle e); + ValueHandle operator||(ValueHandle e); + ValueHandle operator&&(TemplatedIndexedValue e) { + return *this && static_cast(e); + } + ValueHandle operator||(TemplatedIndexedValue e) { + return *this || static_cast(e); + } + + ValueHandle operator==(ValueHandle e); + ValueHandle operator!=(ValueHandle e); + ValueHandle operator<(ValueHandle e); + ValueHandle operator<=(ValueHandle e); + ValueHandle operator>(ValueHandle e); + ValueHandle operator>=(ValueHandle e); + ValueHandle operator==(TemplatedIndexedValue e) { + return *this == static_cast(e); + } + ValueHandle operator!=(TemplatedIndexedValue e) { + return *this != static_cast(e); + } + ValueHandle operator<(TemplatedIndexedValue e) { + return *this < static_cast(e); + } + ValueHandle operator<=(TemplatedIndexedValue e) { + return *this <= static_cast(e); + } + ValueHandle operator>(TemplatedIndexedValue e) { + return *this > static_cast(e); + } + ValueHandle operator>=(TemplatedIndexedValue e) { + return *this >= static_cast(e); + } private: TemplatedIndexedValue(ValueHandle base, ArrayRef indices)