41 #ifndef SOFT_FLOAT_CG_EXT_HPP 42 #define SOFT_FLOAT_CG_EXT_HPP 157 void replaceWithCall(
const FloatFormatRef& specFF,
const std::string& fu_name, std::vector<tree_nodeRef>
args,
159 const std::string& current_scrp);
182 FloatFormatRef outFF)
const;
191 tree_nodeRef cstCast(uint64_t in,
const FloatFormatRef& inFF,
const FloatFormatRef& outFF)
const;
245 FPRounding_Truncate = 0,
246 FPRounding_NearestEven = 1
251 FPException_Overflow = 0,
252 FPException_IEEE = 1,
253 FPException_Saturation = 2
265 FloatFormat(uint8_t _exp_bits, uint8_t _frac_bits, int32_t _exp_bias,
273 bool ieee_format()
const;
277 static FloatFormatRef FromString(std::string ff_str);
297 FunctionVersion(CallGraph::vertex_descriptor func_v,
const FloatFormatRef& userFormat =
nullptr);
303 int compare(
const FunctionVersion& other,
bool format_only =
false)
const;
309 bool ieee_format()
const;
static bool lowering_needed(const ssa_name *ssa)
tree_nodeRef generate_interface(const blocRef &bb, tree_nodeRef stmt, const tree_nodeRef &ssa, FloatFormatRef inFF, FloatFormatRef outFF) const
Generate necessary statements to convert ssa variable from inFF to outFF and insert them after stmt i...
tree_nodeRef floatNegate(const tree_nodeRef &op, const FloatFormatRef &ff) const
Generate float negate operation based on given floating-point format.
static tree_nodeRef float64_type
CustomMap< ssa_name *, std::set< unsigned int > > hwParam
Hardware implemented functions need parameters specified as real_type, thus it is necessary to add a ...
std::vector< tree_nodeRef > paramBinding
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
const CallGraph::vertex_descriptor function_vertex
CustomMap< ssa_name *, std::tuple< FloatFormatRef, std::vector< unsigned int > > > inputInterface
SSA variable which requires cast renaming from standard to user-defined float format in all but given...
static bool inline_conversion
RelationshipType
The relationship type.
struct definition of the function_decl tree node.
This class manages the tree structures extracted from the raw file.
bool signature_lowering(function_decl *f_decl) const
CustomMap< ssa_name *, bool > viewConvert
DesignFlowStep_Status InternalExec() override
Fixes the var_decl duplication.
static tree_nodeRef float32_ptr_type
bool operator!=(const DiscrepancyOpInfo &a, const DiscrepancyOpInfo &b)
CustomOrderedMap< T, U > CustomMap
bool RecursiveExaminate(const tree_nodeRef ¤t_statement, const tree_nodeRef ¤t_tree_node, int castRename)
Recursive examine tree node.
void ssa_lowering(ssa_name *ssa, bool internal_type) const
This class contains the base representation for a generic frontend flow step which works on a single ...
static CustomMap< CallGraph::vertex_descriptor, FunctionVersionRef > funcFF
Floating-point function version map.
redefinition of map to manage ordered/unordered structures
Abstract pure class for the tree structure.
Auxiliary methods for manipulating string.
void replaceWithCall(const FloatFormatRef &specFF, const std::string &fu_name, std::vector< tree_nodeRef > args, const tree_nodeRef ¤t_statement, const tree_nodeRef ¤t_tree_node, const std::string ¤t_scrp)
Replace current_tree_node with a call_expr to fu_name function specialized with specFF fp format in c...
std::string ToString(ActorGraphBackend_Type actor_graph_backend_type)
Header include.
soft_float_cg_ext(const ParameterConstRef _parameters, const application_managerRef AppM, unsigned int _function_id, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
CustomMap< ssa_name *, std::tuple< FloatFormatRef, std::vector< tree_nodeRef > > > outputInterface
SSA variable which requires cast renaming from user-defined to standard float format in given stateme...
tree_nodeRef floatAbs(const tree_nodeRef &op, const FloatFormatRef &ff) const
Generate float absolute value operation based on given floating-point format.
tree_nodeRef int_ptr_type
FloatFormatRef userRequired
static tree_nodeRef float64_ptr_type
redefinition of set to manage ordered/unordered structures
~soft_float_cg_ext() override
Destructor.
tree_nodeRef int_type_for(const tree_nodeRef &type, bool use_internal) const
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
Classes specification of the tree_node data structures.
DesignFlowStep_Status
The status of a step.
CustomUnorderedSet< unsigned int > already_visited
Already visited tree node (used to avoid infinite recursion)
tree_nodeRef cstCast(uint64_t in, const FloatFormatRef &inFF, const FloatFormatRef &outFF) const
Cast real type constant from inFF to outFF format.
std::vector< tree_nodeRef > topReturn
static tree_nodeRef float32_type
Template definition of refcount.
bool operator==(const DiscrepancyOpInfo &a, const DiscrepancyOpInfo &b)
const tree_managerRef TreeM
Tree manager.
std::vector< tree_nodeRef > nopConvert
const application_managerRef AppM
The application manager.
FunctionVersionRef _version
std::vector< ssa_name * > hwReturn
Hardware implemented functions return values as real_type, thus a view_convert is necessary...
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
This struct specifies the ssa_name node.
REF_FORWARD_DECL(FloatFormat)
Add to the call graph the function calls associated with the floating point primitive operations...
static CustomMap< unsigned int, std::array< tree_nodeRef, 8 > > versioning_args
Static arguments list to feed specialization parameters of versioned functions.
std::vector< FunctionVersionRef > callers
This class creates a layer to add nodes and to manipulate the tree_nodes manager. ...
const tree_manipulationRef tree_man
tree manipulation
A brief description of the C++ Header File.