Mentions légales du service

Skip to content

Compiler: implement optimization to use math.X() functions when available

Created by: vaussard

Commit 11b7be49 introduces an intermediate vectorial syntax tree. A tree operating on a vector of N-element will expand to N-trees operating on single elements. This can be expensive when operating on long statement or vectors.

If math.X() functions are available on the target, the compiler could optimize the process by using them for operations like "+" (math.add) or "=" (math.copy). If a specific function is not available, we would have to fall back on the expansion to N-trees.

The complexity comes when mixing vectorial and non-vectorial operations into the same statement. A N-element tree will have to be split into several vectorial / non-vectorial trees, to be executed in the right order.