- /*
- * vector-component constant folding works by matching the component sets
- * to eliminate expensive operations on whole-vectors (3 components at runtime).
- * to achive this effect in a clean manner this function generalizes the
- * values through the use of a set paramater, which is used as an indexing method
- * for creating the elided ast binary expression.
- *
- * Consider 'n 0 0' where y, and z need to be tested for 0, and x is
- * used as the value in a binary operation generating an INSTR_MUL instruction,
- * to acomplish the indexing of the correct component value we use set[0], set[1], set[2]
- * as x, y, z, where the values of those operations return 'x', 'y', 'z'. Because
- * of how ASCII works we can easily deliniate:
- * vec.z is the same as set[2]-'x' for when set[2] is 'z', 'z'-'x' results in a
- * literal value of 2, using this 2, we know that taking the address of vec->x (float)
- * and indxing it with this literal will yeild the immediate address of that component
- *
- * Of course more work needs to be done to generate the correct index for the ast_member_new
- * call, which is no problem: set[0]-'x' suffices that job.
- */