46#include "data/untypedSharedPtr.h"
91 const uint64_t& opIdx)
const;
144 inline static const std::string GET_PRINT_PRIMITIVE_OPERAND_TYPE{
145 "(const )?((struct )?[\\w:\\*]*)[ ]?(\\[(\\d)+\\])*"};
159 const std::vector<std::reference_wrapper<const std::type_info>>&
179 const std::vector<Data::UntypedSharedPtr>& arguments)
const;
195 const std::vector<Data::UntypedSharedPtr>& args)
const = 0;
198#ifndef CODE_GENERATION
211 std::vector<std::reference_wrapper<const std::type_info>> operandTypes;
This abstract class is the base class for any instruction to be used in a Program.
Definition: instruction.h:59
const std::vector< std::reference_wrapper< const std::type_info > > & getOperandTypes() const
Get the list of operand types needed by the Instruction.
Definition: instruction.cpp:56
unsigned int getNbOperands() const
Get the number of operands required to execute the Instruction.
Definition: instruction.cpp:61
virtual std::string getPrintablePrimitiveOperandType(const uint64_t &opIdx) const
Retrieve the primitive data type of the operand.
Definition: instruction.cpp:113
virtual double execute(const std::vector< Data::UntypedSharedPtr > &args) const =0
Execute the Instruction for the given arguments.
Definition: instruction.cpp:81
Instruction(std::string printTemplate)
Protected constructor to force the class abstract nature.
Definition: instruction.cpp:98
virtual const std::string & getPrintTemplate() const
This function return the printTemplate of the line of code used to represent the instruction.
Definition: instruction.cpp:108
virtual bool isPrintable() const
function saying if an Instruction can be printed in a C file during the code gen.
Definition: instruction.cpp:103
virtual bool checkOperandTypes(const std::vector< Data::UntypedSharedPtr > &arguments) const
Check if a given vector contains elements whose types corresponds to the types of the Instruction ope...
Definition: instruction.cpp:66
virtual ~Instruction()=default
Default virtual destructor for polyphormism.
std::string printTemplate
Definition: instruction.h:110
Definition: addPrimitiveType.h:48