From dc48af195dfdf3ef36eee04542aede8dc7812ca8 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Mon, 25 Nov 2013 13:25:29 -0500 Subject: [PATCH] Pregenerate 2.0 for const folder since it's used often --- fold.c | 1 + intrin.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fold.c b/fold.c index 60517a7..a66b815 100644 --- 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)); diff --git a/intrin.c b/intrin.c index a53bcd4..b2ef3ed 100644 --- 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 */ ) ) ); -- 2.39.2