]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Pregenerate 2.0 for const folder since it's used often
authorDale Weiler <killfieldengine@gmail.com>
Mon, 25 Nov 2013 18:25:29 +0000 (13:25 -0500)
committerDale Weiler <killfieldengine@gmail.com>
Mon, 25 Nov 2013 18:25:29 +0000 (13:25 -0500)
fold.c
intrin.c

diff --git a/fold.c b/fold.c
index 60517a7e57ae578f9c8521c26802aeaf8acda119..a66b8157091ed706d63fbfed6cfaec30e6256c63 100644 (file)
--- a/fold.c
+++ b/fold.c
@@ -230,6 +230,7 @@ fold_t *fold_init(parser_t *parser) {
     (void)fold_constgen_float (fold,  0.0f);
     (void)fold_constgen_float (fold,  1.0f);
     (void)fold_constgen_float (fold, -1.0f);
+    (void)fold_constgen_float (fold,  2.0f);
 
     (void)fold_constgen_vector(fold, vec3_create(0.0f, 0.0f, 0.0f));
     (void)fold_constgen_vector(fold, vec3_create(-1.0f, -1.0f, -1.0f));
index a53bcd4835c19e1e01cde0c96fe43294ad6f1408..b2ef3ed6b1b149981344fc8142e71f5c4077535c 100644 (file)
--- a/intrin.c
+++ b/intrin.c
@@ -784,7 +784,7 @@ static ast_expression *intrin_pow(intrin_t *intrin) {
             intrin_ctx(intrin),
             INSTR_DIV_F,
             (ast_expression*)exp,
-            (ast_expression*)fold_constgen_float(intrin->fold, 2.0f)
+            (ast_expression*)intrin->fold->imm_float[3] /* 2.0f */
         )
     );
 
@@ -887,7 +887,7 @@ static ast_expression *intrin_pow(intrin_t *intrin) {
                 intrin_ctx(intrin),
                 INSTR_DIV_F,
                 (ast_expression*)high,
-                (ast_expression*)fold_constgen_float(intrin->fold, 2.0f)
+                (ast_expression*)intrin->fold->imm_float[3] /* 2.0f */
             )
         )
     );
@@ -996,7 +996,7 @@ static ast_expression *intrin_pow(intrin_t *intrin) {
                     (ast_expression*)low,
                     (ast_expression*)high
                 ),
-                (ast_expression*)fold_constgen_float(intrin->fold, 2.0f)
+                (ast_expression*)intrin->fold->imm_float[3] /* 2.0f */
             )
         )
     );
@@ -1236,7 +1236,7 @@ static ast_expression *intrin_epsilon(intrin_t *intrin) {
                         intrin_ctx(intrin),
                         INSTR_MUL_F,
                         (ast_expression*)eps,
-                        (ast_expression*)fold_constgen_float(intrin->fold, 2.0f)
+                        (ast_expression*)intrin->fold->imm_float[3] /* 2.0f */
                     )
                 ),
                 (ast_expression*)intrin->fold->imm_float[1]
@@ -1248,7 +1248,7 @@ static ast_expression *intrin_epsilon(intrin_t *intrin) {
                 INSTR_STORE_F,
                 INSTR_DIV_F,
                 (ast_expression*)eps,
-                (ast_expression*)fold_constgen_float(intrin->fold, 2.0f)
+                (ast_expression*)intrin->fold->imm_float[3] /* 2.0f */
             )
         )
     );