VapourSynth-llvmexpr
Loading...
Searching...
No Matches
MathFunctionImpl< VectorWidth, MathOp::Tan > Struct Template Reference

#include <llvmexpr/codegen/llvm/Math.hpp>

Static Public Member Functions

static llvm::Function * generate (MathFunctionGenerator< VectorWidth > *gen)

Detailed Description

template<int VectorWidth>
struct MathFunctionImpl< VectorWidth, MathOp::Tan >

Definition at line 541 of file Math.hpp.

Member Function Documentation

◆ generate()

template<int VectorWidth>
llvm::Function * MathFunctionImpl< VectorWidth, MathOp::Tan >::generate ( MathFunctionGenerator< VectorWidth > * gen)
inlinestatic

Definition at line 542 of file Math.hpp.

542 {
543 constexpr auto OP_INFO = get_math_op_info(MathOp::Tan);
544 return gen->createFunction(
545 OP_INFO.name, OP_INFO.arity,
547 auto* x = args[0];
548 llvm::Function* sin_func =
549 MathFunctionImpl<VectorWidth, MathOp::Sin>::generate(gen);
550 llvm::Function* cos_func =
551 MathFunctionImpl<VectorWidth, MathOp::Cos>::generate(gen);
552 llvm::Value* sin_x = gen->builder.CreateCall(sin_func, {x});
553 llvm::Value* cos_x = gen->builder.CreateCall(cos_func, {x});
554 return gen->builder.CreateFDiv(sin_x, cos_x);
555 });
556 }
constexpr MathopInfo get_math_op_info(MathOp op)
Definition Math.hpp:86

References get_math_op_info(), and Tan.


The documentation for this struct was generated from the following file: