Halide 16.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
FindIntrinsics.h
Go to the documentation of this file.
1#ifndef HALIDE_FIND_INTRINSICS_H
2#define HALIDE_FIND_INTRINSICS_H
3
4/** \file
5 * Tools to replace common patterns with more readily recognizable intrinsics.
6 */
7
8#include "IR.h"
9
10namespace Halide {
11namespace Internal {
12
13/** Implement intrinsics with non-intrinsic using equivalents. */
14Expr lower_widen_right_add(const Expr &a, const Expr &b);
15Expr lower_widen_right_mul(const Expr &a, const Expr &b);
16Expr lower_widen_right_sub(const Expr &a, const Expr &b);
17Expr lower_widening_add(const Expr &a, const Expr &b);
18Expr lower_widening_mul(const Expr &a, const Expr &b);
19Expr lower_widening_sub(const Expr &a, const Expr &b);
22
25
26Expr lower_saturating_add(const Expr &a, const Expr &b);
27Expr lower_saturating_sub(const Expr &a, const Expr &b);
28Expr lower_saturating_cast(const Type &t, const Expr &a);
29
30Expr lower_halving_add(const Expr &a, const Expr &b);
31Expr lower_halving_sub(const Expr &a, const Expr &b);
33
34Expr lower_mul_shift_right(const Expr &a, const Expr &b, const Expr &q);
35Expr lower_rounding_mul_shift_right(const Expr &a, const Expr &b, const Expr &q);
36
37/** Replace one of the above ops with equivalent arithmetic. */
39
40/** Replace common arithmetic patterns with intrinsics. */
43
44/** The reverse of find_intrinsics. */
47
48} // namespace Internal
49} // namespace Halide
50
51#endif
Subtypes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Expr lower_widen_right_add(const Expr &a, const Expr &b)
Implement intrinsics with non-intrinsic using equivalents.
Expr lower_mul_shift_right(const Expr &a, const Expr &b, const Expr &q)
Expr lower_halving_sub(const Expr &a, const Expr &b)
Expr lower_halving_add(const Expr &a, const Expr &b)
Expr lower_rounding_halving_add(const Expr &a, const Expr &b)
Expr lower_widening_shift_left(const Expr &a, const Expr &b)
Expr lower_saturating_add(const Expr &a, const Expr &b)
Expr lower_widening_add(const Expr &a, const Expr &b)
Expr lower_saturating_cast(const Type &t, const Expr &a)
Expr lower_widening_shift_right(const Expr &a, const Expr &b)
Expr lower_intrinsics(const Expr &e)
The reverse of find_intrinsics.
Expr lower_widen_right_sub(const Expr &a, const Expr &b)
Expr lower_widen_right_mul(const Expr &a, const Expr &b)
Expr lower_rounding_shift_right(const Expr &a, const Expr &b)
Expr lower_widening_sub(const Expr &a, const Expr &b)
Stmt find_intrinsics(const Stmt &s)
Replace common arithmetic patterns with intrinsics.
Expr lower_intrinsic(const Call *op)
Replace one of the above ops with equivalent arithmetic.
Expr lower_rounding_mul_shift_right(const Expr &a, const Expr &b, const Expr &q)
Expr lower_widening_mul(const Expr &a, const Expr &b)
Expr lower_saturating_sub(const Expr &a, const Expr &b)
Expr lower_rounding_shift_left(const Expr &a, const Expr &b)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
Expr cast(Expr a)
Cast an expression to the halide type corresponding to the C++ type T.
Definition IROperator.h:358
A fragment of Halide syntax.
Definition Expr.h:257
A function call.
Definition IR.h:482
A reference-counted handle to a statement node.
Definition Expr.h:418
Types in the halide type system.
Definition Type.h:276