VapourSynth-llvmexpr
Loading...
Searching...
No Matches
ExprIRGenerator.hpp
Go to the documentation of this file.
1
19
20#ifndef LLVMEXPR_CODEGEN_LLVM_EXPRIRGenerator_HPP
21#define LLVMEXPR_CODEGEN_LLVM_EXPRIRGenerator_HPP
22
23#include "IRGeneratorBase.hpp"
24
26 public:
28 const std::vector<Token>& tokens_in, const VSVideoInfo* out_vi,
29 const std::vector<const VSVideoInfo*>& in_vi, int width_in,
30 int height_in, bool mirror,
31 const std::map<std::pair<int, std::string>, int>& p_map,
32 const analysis::ExpressionAnalysisResults& analysis_results_in,
33 llvm::LLVMContext& context_ref, llvm::Module& module_ref,
34 llvm::IRBuilder<>& builder_ref, MathLibraryManager& math_mgr,
35 std::string func_name_in, int approx_math_in, int tile_x_in,
36 int tile_y_in);
37
38 protected:
39 void defineFunctionSignature() override;
40 void generateLoops() override;
41
42 bool processModeSpecificToken(const Token& token,
43 std::vector<llvm::Value*>& rpn_stack,
44 llvm::Value* x, llvm::Value* y,
45 llvm::Value* x_fp, llvm::Value* y_fp,
46 bool no_x_bounds_check) override;
47
48 void finalizeAndStoreResult(llvm::Value* result_val, llvm::Value* x,
49 llvm::Value* y) override;
50
51 private:
52 void generate_x_loop_body(llvm::Value* x_var, llvm::Value* x_fp_var,
53 llvm::Value* y_var, llvm::Value* y_fp_var,
54 bool no_x_bounds_check);
55
56 int tile_x;
57 int tile_y;
58
59 // Arrays
60 std::map<std::string, llvm::Value*> named_arrays;
61};
62
63#endif // LLVMEXPR_CODEGEN_LLVM_EXPRIRGenerator_HPP
void defineFunctionSignature() override
void generateLoops() override
void finalizeAndStoreResult(llvm::Value *result_val, llvm::Value *x, llvm::Value *y) override
bool processModeSpecificToken(const Token &token, std::vector< llvm::Value * > &rpn_stack, llvm::Value *x, llvm::Value *y, llvm::Value *x_fp, llvm::Value *y_fp, bool no_x_bounds_check) override
ExprIRGenerator(const std::vector< Token > &tokens_in, const VSVideoInfo *out_vi, const std::vector< const VSVideoInfo * > &in_vi, int width_in, int height_in, bool mirror, const std::map< std::pair< int, std::string >, int > &p_map, const analysis::ExpressionAnalysisResults &analysis_results_in, llvm::LLVMContext &context_ref, llvm::Module &module_ref, llvm::IRBuilder<> &builder_ref, MathLibraryManager &math_mgr, std::string func_name_in, int approx_math_in, int tile_x_in, int tile_y_in)
IRGeneratorBase(const std::vector< Token > &tokens_in, const VSVideoInfo *out_vi, const std::vector< const VSVideoInfo * > &in_vi, int width_in, int height_in, bool mirror, const std::map< std::pair< int, std::string >, int > &p_map, const analysis::ExpressionAnalysisResults &analysis_results_in, llvm::LLVMContext &context_ref, llvm::Module &module_ref, llvm::IRBuilder<> &builder_ref, MathLibraryManager &math_mgr, std::string func_name_in, int approx_math_in)