forked from metalibm/metalibm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.dox
27 lines (14 loc) · 1.5 KB
/
doc.dox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Fixed-Point formats are assumed to be left aligned
pre-statement:
This Operation Node's field is used to factorize Code Blocks between Conditional branches.
For example, it is used by subexpression_sharing pass in OptimizationEngine to store common expression between two branch sides, thus common code will be generated first and shared between the two branches.
It avoids code duplication.
It is also used during fast path factorization as a container for the extracted, linearezd most likely execution path. Which will then be executed before any other code (without condition consideration).
Folding:
Code generation may become quite messy if a lot of operations are involved. To simplify the generated code, folding may be enabled. Once enabled one statement with one variable assignation is generated for each elementary expression.
Dynamic attribute registration
By using the static method Attributes.add_dyn_attribute which take an object inheriting from AttributeCtor it is possible to add other attributes to every Operation node with user-defined configuration (default value, required, ...). By keeping an handle on the AttributeCtor object, the attribute may even be modified between new node creation.
Pipeline:
Auto pipelining uses several mechanism
CodeEntity registers 2 dynamic attributes, init_stage and init_op. Each time an operation is declared, it store the current values of init_stage into its own field.
init_stage is initialized to 0 and update by add_pipeline_stage function