VapourSynth-llvmexpr
Loading...
Searching...
No Matches
MathFunctionImpl< VectorWidth, MathOp::Asin > 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::Asin >

Definition at line 725 of file Math.hpp.

Member Function Documentation

◆ generate()

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

Definition at line 726 of file Math.hpp.

726 {
727 constexpr auto OP_INFO = get_math_op_info(MathOp::Asin);
728 // asin(x) = pi/2 - acos(x)
729 return gen->createFunction(
730 OP_INFO.name, OP_INFO.arity,
732 auto* x = args[0];
733 auto* pi_div_2 = gen->getConstant(
734 1.5707963267948966F); // NOLINT(cppcoreguidelines-avoid-magic-numbers)
735 auto* acos_func =
736 MathFunctionImpl<VectorWidth, MathOp::Acos>::generate(gen);
737 auto* acos_x = gen->builder.CreateCall(acos_func, {x});
738 return gen->builder.CreateFSub(pi_div_2, acos_x);
739 });
740 }
constexpr MathopInfo get_math_op_info(MathOp op)
Definition Math.hpp:86

References Asin, and get_math_op_info().


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