From: Dale Weiler Date: Sat, 24 May 2014 15:50:16 +0000 (-0400) Subject: Mage inexact travel across constants. X-Git-Tag: xonotic-v0.8.1~9^2~32^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=68c2baa7c1b9ee1ca7804656d6fb5cf65b435a90;p=xonotic%2Fgmqcc.git Mage inexact travel across constants. --- diff --git a/fold.c b/fold.c index aca45c0..8227537 100644 --- a/fold.c +++ b/fold.c @@ -692,7 +692,6 @@ ast_expression *fold_constgen_float(fold_t *fold, qcfloat_t value, bool inexact) out->hasvalue = true; out->inexact = inexact; out->constval.vfloat = value; - (void)inexact; vec_push(fold->imm_float, out); @@ -923,11 +922,7 @@ static GMQCC_INLINE ast_expression *fold_op_div(fold_t *fold, ast_value *a, ast_ if (isfloat(a)) { if (fold_can_2(a, b)) { bool inexact = fold_check_except_float(&sfloat_div, fold, a, b); - ast_expression *e; - con_out("inexact: %d (%x:%x)\n", inexact, a, b); - e = fold_constgen_float(fold, fold_immvalue_float(a) / fold_immvalue_float(b), inexact); - con_out("%x\n", e); - return e; + return fold_constgen_float(fold, fold_immvalue_float(a) / fold_immvalue_float(b), inexact); } else if (fold_can_1(b)) { return (ast_expression*)ast_binary_new( fold_ctx(fold), @@ -1083,7 +1078,6 @@ static GMQCC_INLINE ast_expression *fold_op_cmp(fold_t *fold, ast_value *a, ast_ if (isfloat(a) && isfloat(b)) { float la = fold_immvalue_float(a); float lb = fold_immvalue_float(b); - con_out("CMP: %x:%x\n", a, b); fold_check_inexact_float(fold, a, b); return (ast_expression*)fold->imm_float[!(ne ? la == lb : la != lb)]; } if (isvector(a) && isvector(b)) { diff --git a/parser.c b/parser.c index 354ad03..00f8dfd 100644 --- a/parser.c +++ b/parser.c @@ -5842,6 +5842,7 @@ skipvar: else { var->hasvalue = true; + var->inexact = ((ast_value*)cexp)->inexact; if (cval->expression.vtype == TYPE_STRING) var->constval.vstring = parser_strdup(cval->constval.vstring); else if (cval->expression.vtype == TYPE_FIELD)