From 76a35c035238c8a0bbe8f9804fb71562ed45db0c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 6 Feb 2022 20:59:49 +0900 Subject: [PATCH] [qfcc] Always test float against 0 for Ruamoko Float is not int, and Ruamoko has only int ifz/ifnz, which will fail for -0.0 (0x80000000 when viewed as an int). And then there's nan, but I haven't seen too many of those in quake. --- tools/qfcc/source/expr_bool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/expr_bool.c b/tools/qfcc/source/expr_bool.c index 5894e1bad..4d3431769 100644 --- a/tools/qfcc/source/expr_bool.c +++ b/tools/qfcc/source/expr_bool.c @@ -109,8 +109,9 @@ test_expr (expr_t *e) } return e; case ev_float: - if (options.code.fast_float - || options.code.progsversion == PROG_ID_VERSION) { + if (options.code.progsversion < PROG_VERSION + && (options.code.fast_float + || options.code.progsversion == PROG_ID_VERSION)) { if (!is_float(type_default)) { if (is_constant (e)) { return cast_expr (type_default, e);