1 #ifndef HALIDE_IR_OPERATOR_H 2 #define HALIDE_IR_OPERATOR_H 240 Type t = type_of<T>();
248 int64_t b_zero = (ib == 0) ? -1 : 0;
250 int64_t r = ia % (ib | b_zero);
251 r += (a_neg & ((ib ^ b_neg) + ~b_neg));
261 Type t = type_of<T>();
270 int64_t b_zero = (ib == 0) ? -1 : 0;
274 q += a_neg & (~b_neg - b_neg);
286 float f = a - b * (floorf(a / b));
327 static constexpr
bool value = std::is_convertible<T, const char *>::value ||
328 std::is_convertible<T, Halide::Expr>::value;
331 template<
typename... Args>
338 template<
typename... Args>
340 args.emplace_back(std::string(arg));
344 template<
typename... Args>
346 args.push_back(std::move(arg));
365 return cast(type_of<T>(), std::move(a));
369 Expr
cast(Type t, Expr a);
626 Expr
max(Expr a, Expr b);
633 Expr
max(Expr a,
int b);
640 Expr
max(
int a, Expr b);
643 return max(
Expr(a), std::move(b));
646 return max(std::move(a),
Expr(b));
655 template<
typename A,
typename B,
typename C,
typename... Rest,
657 inline Expr max(A &&a, B &&b, C &&c, Rest &&...rest) {
658 return max(std::forward<A>(a),
max(std::forward<B>(b), std::forward<C>(c), std::forward<Rest>(rest)...));
661 Expr
min(Expr a, Expr b);
668 Expr
min(Expr a,
int b);
675 Expr
min(
int a, Expr b);
678 return min(
Expr(a), std::move(b));
681 return min(std::move(a),
Expr(b));
690 template<
typename A,
typename B,
typename C,
typename... Rest,
692 inline Expr min(A &&a, B &&b, C &&c, Rest &&...rest) {
693 return min(std::forward<A>(a),
min(std::forward<B>(b), std::forward<C>(c), std::forward<Rest>(rest)...));
701 return std::move(a) +
Expr(b);
704 return Expr(a) + std::move(b);
707 return std::move(a) -
Expr(b);
710 return Expr(a) - std::move(b);
713 return std::move(a) *
Expr(b);
716 return Expr(a) * std::move(b);
719 return std::move(a) /
Expr(b);
722 return Expr(a) / std::move(b);
725 return std::move(a) %
Expr(b);
728 return Expr(a) % std::move(b);
731 return std::move(a) >
Expr(b);
734 return Expr(a) > std::move(b);
737 return std::move(a) <
Expr(b);
740 return Expr(a) < std::move(b);
743 return std::move(a) >=
Expr(b);
746 return Expr(a) >= std::move(b);
749 return std::move(a) <=
Expr(b);
752 return Expr(a) <= std::move(b);
755 return std::move(a) ==
Expr(b);
758 return Expr(a) == std::move(b);
761 return std::move(a) !=
Expr(b);
764 return Expr(a) != std::move(b);
770 Expr
clamp(Expr a,
const Expr &min_val,
const Expr &max_val);
783 Expr
absd(Expr a, Expr b);
789 Expr
select(Expr condition, Expr true_value, Expr false_value);
795 template<
typename... Args,
798 return select(std::move(c0), std::move(v0),
select(std::move(c1), std::move(v1), std::forward<Args>(args)...));
805 Tuple
tuple_select(const Tuple &condition, const Tuple &true_value, const Tuple &false_value);
807 Tuple
tuple_select(const Expr &condition, const Tuple &true_value, const Tuple &false_value);
808 Tuple
select(const Tuple &condition, const Tuple &true_value, const Tuple &false_value);
809 Tuple
select(const Expr &condition, const Tuple &true_value, const Tuple &false_value);
815 template<typename... Args>
820 template<
typename... Args>
825 template<
typename... Args>
827 return select(c0, v0,
select(c1, v1, std::forward<Args>(args)...));
829 template<
typename... Args>
831 return select(c0, v0,
select(c1, v1, std::forward<Args>(args)...));
840 Expr
select(
const Expr &condition,
const FuncRef &true_value,
const FuncRef &false_value);
841 template<
typename... Args>
843 return select(c0, v0,
select(c1, v1, std::forward<Args>(args)...));
860 Expr
mux(
const Expr &
id,
const std::initializer_list<Expr> &values);
861 Expr
mux(
const Expr &
id,
const std::vector<Expr> &values);
862 Expr
mux(
const Expr &
id,
const Tuple &values);
863 Expr
mux(
const Expr &
id,
const std::initializer_list<FuncRef> &values);
864 Tuple
mux(
const Expr &
id,
const std::initializer_list<Tuple> &values);
865 Tuple
mux(
const Expr &
id,
const std::vector<Tuple> &values);
901 Expr
atan2(Expr y, Expr x);
941 Expr
hypot(
const Expr &x,
const Expr &y);
967 Expr
pow(Expr x, Expr y);
972 Expr
erf(
const Expr &x);
1059 Expr
fract(
const Expr &x);
1064 template<
typename T>
1202 Expr
lerp(Expr zero_val, Expr one_val, Expr weight);
1272 Expr
print(
const std::vector<Expr> &values);
1274 template<
typename... Args>
1276 std::vector<Expr> collected_args = {std::move(a)};
1278 return print(collected_args);
1285 Expr
print_when(Expr condition,
const std::vector<Expr> &values);
1287 template<
typename... Args>
1289 std::vector<Expr> collected_args = {std::move(a)};
1291 return print_when(std::move(condition), collected_args);
1318 Expr
require(Expr condition,
const std::vector<Expr> &values);
1320 template<
typename... Args>
1322 std::vector<Expr> collected_args = {std::move(value)};
1324 return require(std::move(condition), collected_args);
1348 template<
typename T>
1350 return undef(type_of<T>());
1353 namespace Internal {
1361 template<
typename T>
1395 template<
typename... Args>
1397 std::vector<Expr> collected_args{std::forward<Args>(args)...};
1424 template<
typename T>
1460 namespace Internal {
1554 Expr
scatter(
const std::vector<Expr> &args);
1555 Expr
gather(
const std::vector<Expr> &args);
1557 template<
typename... Args>
1559 return scatter({e, std::forward<Args>(args)...});
1562 template<
typename... Args>
1564 return gather({e, std::forward<Args>(args)...});
1590 Expr
extract_bits(Type t,
const Expr &e,
const Expr &lsb);
1592 template<
typename T>
1699 namespace Internal {
1701 template<
typename T =
void>
1706 template<
typename T =
void>
1711 template<
typename T =
void>
1716 template<
typename T =
void>
1721 template<
typename T =
void>
1726 template<
typename T =
void>
1731 template<
typename T =
void>
1736 template<
typename T =
void>
1741 template<
typename T =
void>
1746 template<
typename T =
void>
1751 template<
typename T =
void>
1756 template<
typename T =
void>
1761 template<
typename T =
void>
1766 template<
typename T =
void>
1771 template<
typename T =
void>
1776 template<
typename T =
void>
1781 template<
typename T =
void>
1786 template<
typename T =
void>
1791 template<
typename T =
void>
1796 template<
typename T =
void>
1801 template<
typename T =
void>
1806 template<
typename T =
void>
1811 template<
typename T =
void>
Expr widen_right_add(Expr a, Expr b)
Below is a collection of intrinsics for fixed-point programming.
auto operator<(const Other &a, const GeneratorParam< T > &b) -> decltype(a<(T) b)
Less than comparison between GeneratorParam<T> and any type that supports operator< with T...
Expr atan(Expr x)
Return the arctangent of a floating-point expression.
Create a small array of Exprs for defining and calling functions with multiple outputs.
Expr halide_erf(const Expr &a)
Halide's vectorizable transcendentals.
Expr random_uint(Expr seed=Expr())
Return a random variable representing a uniformly distributed unsigned 32-bit integer.
Expr erf(const Expr &x)
Evaluate the error function erf.
Expr remove_likelies(const Expr &e)
Return an Expr that is identical to the input Expr, but with all calls to likely() and likely_if_inne...
Expr max(const FuncRef &a, const FuncRef &b)
Explicit overloads of min and max for FuncRef.
Expr rounding_shift_right(const Expr &a, const Expr &b, T *=nullptr)
Expr round(Expr x)
Return the whole number closest to a floating-point expression.
auto operator||(const Other &a, const GeneratorParam< T > &b) -> decltype(a||(T) b)
Logical or between between GeneratorParam<T> and any type that supports operator|| with T...
auto operator>(const Other &a, const GeneratorParam< T > &b) -> decltype(a >(T) b)
Greater than comparison between GeneratorParam<T> and any type that supports operator> with T...
Expr lossless_negate(const Expr &x)
Attempt to negate x without introducing new IR and without overflow.
A fragment of Halide syntax.
Expr halving_sub(const Expr &a, const Expr &b, T *=nullptr)
Expr strided_ramp_base(const Expr &e, int stride=1)
If e is a ramp expression with stride, default 1, return the base, otherwise undefined.
Expr const_true(int lanes=1)
Construct the constant boolean true.
Expr rounding_mul_shift_right(Expr a, Expr b, Expr q)
Compute saturating_narrow(rounding_shift_right(widening_mul(a, b), q))
bool is_no_op(const Stmt &s)
Is the statement a no-op (which we represent as either an undefined Stmt, or as an Evaluate node of a...
Expr halving_sub(Expr a, Expr b)
Compute narrow((widen(a) - widen(b)) / 2)
Expr clamp(Expr a, const Expr &min_val, const Expr &max_val)
Clamps an expression to lie within the given bounds.
bool is_negative_const(const Expr &e)
Is the expression a const (as defined by is_const), and also strictly less than zero (in all lanes...
Expr unwrap_tags(const Expr &e)
If the expression is a tag helper call, remove it and return the tagged expression.
Expr saturating_sub(const Expr &a, const Expr &b, T *=nullptr)
Expr sqrt(Expr x)
Return the square root of a floating-point expression.
HALIDE_NO_USER_CODE_INLINE void collect_print_args(std::vector< Expr > &args)
Expr min(const FuncRef &a, const FuncRef &b)
Explicit overloads of min and max for FuncRef.
Expr make_bool(bool val, int lanes=1)
Construct a boolean constant from a C++ boolean value.
bool is_undef(const Expr &e)
Is the expression an undef.
Expr saturating_add(const Expr &a, const Expr &b, T *=nullptr)
Expr count_trailing_zeros(Expr x)
Count the number of trailing zero bits in an expression.
auto operator!=(const Other &a, const GeneratorParam< T > &b) -> decltype(a !=(T) b)
Inequality comparison between between GeneratorParam<T> and any type that supports operator!= with T...
Expr fast_log(const Expr &x)
Fast approximate cleanly vectorizable log for Float(32).
Expr concat_bits(const std::vector< Expr > &e)
Given a number of Exprs of the same type, concatenate their bits producing a single Expr of the same ...
Expr mod_round_to_zero(Expr x, Expr y)
Compute the remainder of dividing two integers, when division is rounding toward zero.
Expr random_float(Expr seed=Expr())
Return a random variable representing a uniformly distributed float in the half-open interval [0...
Expr undef(Type t)
Return an undef value of the given type.
Expr require(Expr condition, const std::vector< Expr > &values)
Create an Expr that that guarantees a precondition.
auto operator*(const Other &a, const GeneratorParam< T > &b) -> decltype(a *(T) b)
Multiplication between GeneratorParam<T> and any type that supports operator* with T...
Expr sin(Expr x)
Return the sine of a floating-point expression.
Expr fast_pow(Expr x, Expr y)
Fast approximate cleanly vectorizable pow for Float(32).
Expr raise_to_integer_power(Expr a, int64_t b)
Raise an expression to an integer power by repeatedly multiplying it by itself.
auto operator &&(const Other &a, const GeneratorParam< T > &b) -> decltype(a &&(T) b)
Logical and between between GeneratorParam<T> and any type that supports operator&& with T...
Expr acosh(Expr x)
Return the hyperbolic arccosine of a floating-point expression.
#define HALIDE_ATTRIBUTE_DEPRECATED(x)
HALIDE_ALWAYS_INLINE bool is_float() const
Is this type a floating point type (float or double).
signed __INT8_TYPE__ int8_t
Expr widening_shift_right(const Expr &a, const Expr &b, T *=nullptr)
Expr make_zero(Type t)
Construct the representation of zero in the given type.
Expr lossless_cast(Type t, Expr e)
Attempt to cast an expression to a smaller type while provably not losing information.
Expr widen_right_add(const Expr &a, const Expr &b, T *=nullptr)
A fragment of front-end syntax of the form f(x, y, z), where x, y, z are Vars or Exprs.
Expr div_round_to_zero(Expr x, Expr y)
Divide two integers, rounding towards zero.
Expr cast(Expr a)
Cast an expression to the halide type corresponding to the C++ type T.
Expr extract_bits(Type t, const Expr &e, const Expr &lsb)
Extract a contiguous subsequence of the bits of 'e', starting at the bit index given by 'lsb'...
bool is_const_power_of_two_integer(const Expr &e, int *bits)
Is the expression a constant integer power of two.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
Expr widening_add(const Expr &a, const Expr &b, T *=nullptr)
void check_representable(Type t, int64_t val)
Check if a constant value can be correctly represented as the given type.
Expr fract(const Expr &x)
Return the fractional part of a floating-point expression.
Expr is_finite(Expr x)
Returns true if the argument is a finite value (ie, neither NaN nor Inf).
Expr & operator+=(Expr &a, Expr b)
Modify the first expression to be the sum of two expressions, without changing its type...
unsigned __INT8_TYPE__ uint8_t
Expr make_two(Type t)
Construct the representation of two in the given type.
T mod_imp(T a, T b)
Implementations of division and mod that are specific to Halide.
Expr tan(Expr x)
Return the tangent of a floating-point expression.
double mod_imp< double >(double a, double b)
Expr & operator*=(Expr &a, Expr b)
Modify the first expression to be the product of two expressions, without changing its type...
auto operator>=(const Other &a, const GeneratorParam< T > &b) -> decltype(a >=(T) b)
Greater than or equal comparison between GeneratorParam<T> and any type that supports operator>= with...
auto operator%(const Other &a, const GeneratorParam< T > &b) -> decltype(a %(T) b)
Modulo between GeneratorParam<T> and any type that supports operator% with T.
Expr gather(const std::vector< Expr > &args)
Scatter and gather are used for update definition which must store multiple values to distinct locati...
Expr select(Expr condition, Expr true_value, Expr false_value)
Returns an expression similar to the ternary operator in C, except that it always evaluates all argum...
Expr acos(Expr x)
Return the arccosine of a floating-point expression.
Expr atan2(Expr y, Expr x)
Return the angle of a floating-point gradient.
Expr halving_add(Expr a, Expr b)
Compute narrow((widen(a) + widen(b)) / 2)
Expr absd(Expr a, Expr b)
Return the absolute difference between two values.
std::vector< Expr > strides
Expr random_int(Expr seed=Expr())
Return a random variable representing a uniformly distributed 32-bit integer.
Expr rounding_shift_left(const Expr &a, const Expr &b, T *=nullptr)
Expr floor(Expr x)
Return the greatest whole number less than or equal to a floating-point expression.
Expr ceil(Expr x)
Return the least whole number greater than or equal to a floating-point expression.
Expr widening_sub(const Expr &a, const Expr &b, T *=nullptr)
void reset_random_counters()
Reset the counters used for random-number seeds in random_float/int/uint.
Expr widening_mul(const Expr &a, const Expr &b, T *=nullptr)
Expr operator|(Expr x, Expr y)
Return the bitwise or of two expressions (which need not have the same type).
Expr abs(Expr a)
Returns the absolute value of a signed integer or floating-point expression.
Expr is_inf(Expr x)
Returns true if the argument is Inf or -Inf.
auto operator==(const Other &a, const GeneratorParam< T > &b) -> decltype(a==(T) b)
Equality comparison between GeneratorParam<T> and any type that supports operator== with T...
const double * as_const_float(const Expr &e)
If an expression is a FloatImm or a Broadcast of a FloatImm, return a pointer to its value...
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt) ...
Class that provides a type that implements half precision floating point (IEEE754 2008 binary16) in s...
Expr pow(Expr x, Expr y)
Return one floating point expression raised to the power of another.
Expr cos(Expr x)
Return the cosine of a floating-point expression.
Expr & operator-=(Expr &a, Expr b)
Modify the first expression to be the difference of two expressions, without changing its type...
Expr fast_sin(const Expr &x)
Fast vectorizable approximation to some trigonometric functions for Float(32).
Expr trunc(Expr x)
Return the integer part of a floating-point expression.
Expr print(const std::vector< Expr > &values)
Create an Expr that prints out its value whenever it is evaluated.
Expr mux(const Expr &id, const std::initializer_list< Expr > &values)
Oftentimes we want to pack a list of expressions with the same type into a channel dimension...
Expr cosh(Expr x)
Return the hyperbolic cosine of a floating-point expression.
Expr fast_inverse(Expr x)
Fast approximate inverse for Float(32).
Expr widening_shift_left(Expr a, Expr b)
Compute widen(a) << b.
Expr make_const(Type t, int64_t val)
Construct an immediate of the given type from any numeric C++ type.
A builder to help create Exprs representing halide_buffer_t structs (e.g.
Expr widen_right_mul(Expr a, Expr b)
Compute a * widen(b).
Expr make_one(Type t)
Construct the representation of one in the given type.
Expr const_false(int lanes=1)
Construct the constant boolean false.
Expr sinh(Expr x)
Return the hyperbolic sine of a floating-point expression.
Expr log(Expr x)
Return the logarithm of a floating-point expression.
Expr unsafe_promise_clamped(const Expr &value, const Expr &min, const Expr &max)
Create an Expr that that promises another Expr is clamped but do not generate code to check the asser...
HALIDE_NO_USER_CODE_INLINE Expr memoize_tag(Expr result, Args &&...args)
Control the values used in the memoization cache key for memoize.
unsigned __INT32_TYPE__ uint32_t
void match_types_bitwise(Expr &a, Expr &b, const char *op_name)
Asserts that both expressions are integer types and are either both signed or both unsigned...
#define HALIDE_NO_USER_CODE_INLINE
Expr asin(Expr x)
Return the arcsine of a floating-point expression.
Not visible externally, similar to 'static' linkage in C.
Expr atanh(Expr x)
Return the hyperbolic arctangent of a floating-point expression.
Expr operator^(Expr x, Expr y)
Return the bitwise xor of two expressions (which need not have the same type).
float mod_imp< float >(float a, float b)
Expr reinterpret(Type t, Expr e)
Reinterpret the bits of one value as another type.
Expr halide_exp(const Expr &a)
Halide's vectorizable transcendentals.
signed __INT64_TYPE__ int64_t
auto operator!(const GeneratorParam< T > &a) -> decltype(!(T) a)
Not operator for GeneratorParam.
Expr fast_inverse_sqrt(Expr x)
Fast approximate inverse square root for Float(32).
Tuple tuple_select(const Tuple &condition, const Tuple &true_value, const Tuple &false_value)
Equivalent of ternary select(), but taking/returning tuples.
auto operator/(const Other &a, const GeneratorParam< T > &b) -> decltype(a/(T) b)
Division between GeneratorParam<T> and any type that supports operator/ with T.
Expr rounding_shift_right(Expr a, Expr b)
Compute saturating_narrow(widening_add(a, (1 << max(b, 0)) / 2) >> b).
Expr scatter(const std::vector< Expr > &args)
Scatter and gather are used for update definition which must store multiple values to distinct locati...
Expr widening_add(Expr a, Expr b)
Compute widen(a) + widen(b).
Expr widen_right_sub(Expr a, Expr b)
Compute a - widen(b).
bool is_const(const Expr &e)
Is the expression either an IntImm, a FloatImm, a StringImm, or a Cast of the same, or a Ramp or Broadcast of the same.
Expr widening_sub(Expr a, Expr b)
Compute widen(a) - widen(b).
Expr print_when(Expr condition, const std::vector< Expr > &values)
Create an Expr that prints whenever it is evaluated, provided that the condition is true...
Expr rounding_shift_left(Expr a, Expr b)
Compute saturating_narrow(widening_add(a, (1 >> min(b, 0)) / 2) << b).
Expr widening_shift_left(const Expr &a, const Expr &b, T *=nullptr)
Expr rounding_halving_add(Expr a, Expr b)
Compute narrow((widen(a) + widen(b) + 1) / 2)
float div_imp< float >(float a, float b)
bool is_positive_const(const Expr &e)
Is the expression a const (as defined by is_const), and also strictly greater than zero (in all lanes...
bool is_const_zero(const Expr &e)
Is the expression a const (as defined by is_const), and also equal to zero (in all lanes...
Expr fast_exp(const Expr &x)
Fast approximate cleanly vectorizable exp for Float(32).
Expr mul_shift_right(Expr a, Expr b, Expr q)
Compute saturating_narrow(shift_right(widening_mul(a, b), q))
Expr make_signed_integer_overflow(Type type)
Construct a unique signed_integer_overflow Expr.
HALIDE_ALWAYS_INLINE bool is_int() const
Is this type a signed integer type?
Expr memoize_tag_helper(Expr result, const std::vector< Expr > &cache_key_values)
Expr rounding_mul_shift_right(const Expr &a, const Expr &b, const Expr &q, T *=nullptr)
Expr tanh(Expr x)
Return the hyperbolic tangent of a floating-point expression.
Expr strict_float(Expr e)
Makes a best effort attempt to preserve IEEE floating-point semantics in evaluating an expression...
Expr widen_right_sub(const Expr &a, const Expr &b, T *=nullptr)
unsigned __INT16_TYPE__ uint16_t
const int64_t * as_const_int(const Expr &e)
If an expression is an IntImm or a Broadcast of an IntImm, return a pointer to its value...
Types in the halide type system.
auto operator-(const Other &a, const GeneratorParam< T > &b) -> decltype(a -(T) b)
Subtraction between GeneratorParam<T> and any type that supports operator- with T.
Expr unreachable(Type t=Int(32))
Return an expression that should never be evaluated.
Expr operator>>(Expr x, Expr y)
Shift the bits of an integer value right.
std::ostream & operator<<(std::ostream &stream, const Expr &)
Emit an expression on an output stream (such as std::cout) in human-readable form.
auto operator<=(const Other &a, const GeneratorParam< T > &b) -> decltype(a<=(T) b)
Less than or equal comparison between GeneratorParam<T> and any type that supports operator<= with T...
auto operator+(const Other &a, const GeneratorParam< T > &b) -> decltype(a+(T) b)
Addition between GeneratorParam<T> and any type that supports operator+ with T.
Expr halide_log(const Expr &a)
Halide's vectorizable transcendentals.
Expr is_nan(Expr x)
Returns true if the argument is a Not a Number (NaN).
Expr requirement_failed_error(Expr condition, const std::vector< Expr > &args)
Expr fast_cos(const Expr &x)
Fast vectorizable approximation to some trigonometric functions for Float(32).
bool is_const_one(const Expr &e)
Is the expression a const (as defined by is_const), and also equal to one (in all lanes...
Expr & operator/=(Expr &a, Expr b)
Modify the first expression to be the ratio of two expressions, without changing its type...
Expr rounding_halving_add(const Expr &a, const Expr &b, T *=nullptr)
Expr likely_if_innermost(Expr e)
Equivalent to likely, but only triggers a loop partitioning if found in an innermost loop...
Expr operator &(Expr x, Expr y)
Return the bitwise and of two expressions (which need not have the same type).
Expr operator~(Expr x)
Return the bitwise not of an expression.
const uint64_t * as_const_uint(const Expr &e)
If an expression is a UIntImm or a Broadcast of a UIntImm, return a pointer to its value...
Expr halving_add(const Expr &a, const Expr &b, T *=nullptr)
Expr hypot(const Expr &x, const Expr &y)
Return the square root of the sum of the squares of two floating-point expressions.
Expr lerp(Expr zero_val, Expr one_val, Expr weight)
Linear interpolate between the two values according to a weight.
void split_into_ands(const Expr &cond, std::vector< Expr > &result)
Split a boolean condition into vector of ANDs.
Expr exp(Expr x)
Return the exponential of a floating-point expression.
Expr promise_clamped(const Expr &value, const Expr &min, const Expr &max)
FOR INTERNAL USE ONLY.
Expr widening_shift_right(Expr a, Expr b)
Compute widen(a) >> b.
Expr remove_promises(const Expr &e)
Return an Expr that is identical to the input Expr, but with all calls to promise_clamped() and unsaf...
Expr saturating_sub(Expr a, Expr b)
Compute saturating_narrow(widen(a) - widen(b))
Expr mul_shift_right(const Expr &a, const Expr &b, const Expr &q, T *=nullptr)
unsigned __INT64_TYPE__ uint64_t
Expr widen_right_mul(const Expr &a, const Expr &b, T *=nullptr)
T div_imp(T a, T b)
Implementations of division and mod that are specific to Halide.
void match_types(Expr &a, Expr &b)
Coerce the two expressions to have the same type, using C-style casting rules.
static constexpr bool value
Expr saturating_add(Expr a, Expr b)
Compute saturating_narrow(widen(a) + widen(b))
Expr widening_mul(Expr a, Expr b)
Compute widen(a) * widen(b).
Defines Tuple - the front-end handle on small arrays of expressions.
double div_imp< double >(double a, double b)
Expr likely(Expr e)
Expressions tagged with this intrinsic are considered to be part of the steady state of some loop wit...
bool is_signed_integer_overflow(const Expr &expr)
Check if an expression is a signed_integer_overflow.
Expr asinh(Expr x)
Return the hyperbolic arcsinhe of a floating-point expression.
signed __INT32_TYPE__ int32_t
Type Int(int bits, int lanes=1)
Constructing a signed integer type.
std::vector< Expr > extents
signed __INT16_TYPE__ int16_t
bool is_pure(const Expr &e)
Does the expression 1) Take on the same value no matter where it appears in a Stmt, and 2) Evaluating it has no side-effects.
Expr saturating_cast(Expr e)
Cast an expression to the halide type corresponding to the C++ type T.
Expr count_leading_zeros(Expr x)
Count the number of leading zero bits in an expression.
Expr popcount(Expr x)
Count the number of set bits in an expression.