From de83ad2a251ec126a02378b83e4cae5b853e34ac Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Thu, 6 Feb 2025 21:06:25 +0100 Subject: apply abs fix to constant system too --- src/check_builtin.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/check_builtin.cpp') diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index ea902387b..bf4c004d7 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -3488,9 +3488,12 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As case ExactValue_Integer: mp_abs(&operand->value.value_integer, &operand->value.value_integer); break; - case ExactValue_Float: - operand->value.value_float = gb_abs(operand->value.value_float); + case ExactValue_Float: { + u64 abs = bit_cast(operand->value.value_float); + abs &= 0x7FFFFFFFFFFFFFFF; + operand->value.value_float = bit_cast(abs); break; + } case ExactValue_Complex: { f64 r = operand->value.value_complex->real; f64 i = operand->value.value_complex->imag; -- cgit v1.2.3