X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=intrin.h;h=1503d60755e318eb6ce97edd25b4914c13efa72f;hp=81af620c18a7f8e4966a94e0c8c3dad33ce88340;hb=6f749d61b1688752bb902efd635f55d584ad7087;hpb=2923b718e16d7c82b9cd3244d77bb8c701fd5b53 diff --git a/intrin.h b/intrin.h index 81af620..1503d60 100644 --- a/intrin.h +++ b/intrin.h @@ -36,7 +36,7 @@ typedef struct { const char *alias; } intrin_t; -static ht intrin_intrinsics() { +static ht intrin_intrinsics(void) { static ht intrinsics = NULL; if (!intrinsics) intrinsics = util_htnew(PARSER_HT_SIZE); @@ -115,7 +115,7 @@ static ast_expression *intrin_pow (parser_t *parser) { parser_ctx(parser), INSTR_STORE_F, (ast_expression*)local, - (ast_expression*)parser_const_float_1(parser) + (ast_expression*)parser->fold->imm_float[1] /* 1 == 1.0f */ ) ); @@ -126,7 +126,7 @@ static ast_expression *intrin_pow (parser_t *parser) { INSTR_STORE_F, INSTR_MUL_F, (ast_expression*)arg2, - (ast_expression*)parser_const_float(parser, 0.25f) + (ast_expression*)fold_constgen_float(parser->fold, 0.25f) ) ); @@ -149,7 +149,7 @@ static ast_expression *intrin_pow (parser_t *parser) { parser_ctx(parser), INSTR_AND, (ast_expression*)arg2, - (ast_expression*)parser_const_float_1(parser) + (ast_expression*)parser->fold->imm_float[1] /* 1 == 1.0f */ ), true, /* ! not */ NULL, @@ -168,7 +168,7 @@ static ast_expression *intrin_pow (parser_t *parser) { INSTR_STORE_F, INSTR_SUB_F, (ast_expression*)arg2, - (ast_expression*)parser_const_float_1(parser) + (ast_expression*)parser->fold->imm_float[1] /* 1 == 1.0f */ ) ); /* local *= x */ @@ -190,7 +190,7 @@ static ast_expression *intrin_pow (parser_t *parser) { parser_ctx(parser), INSTR_GT, (ast_expression*)arg2, - (ast_expression*)parser_const_float_0(parser) + (ast_expression*)parser->fold->imm_float[0] /* 0 == 0.0f */ ), false, NULL, @@ -291,7 +291,7 @@ static ast_expression *intrin_exp(parser_t *parser) { INTRIN_VAL(value, "exp", func, "", TYPE_FLOAT); /* push arguments for params to call */ - vec_push(call->params, (ast_expression*)parser_const_float(parser, QC_M_E)); + vec_push(call->params, (ast_expression*)fold_constgen_float(parser->fold, QC_M_E)); vec_push(call->params, (ast_expression*)arg1); /* return pow(QC_M_E, x) */