mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-18 11:52:22 -07:00
apply abs fix to constant system too
This commit is contained in:
@@ -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<u64>(operand->value.value_float);
|
||||
abs &= 0x7FFFFFFFFFFFFFFF;
|
||||
operand->value.value_float = bit_cast<f64>(abs);
|
||||
break;
|
||||
}
|
||||
case ExactValue_Complex: {
|
||||
f64 r = operand->value.value_complex->real;
|
||||
f64 i = operand->value.value_complex->imag;
|
||||
|
||||
@@ -2175,9 +2175,9 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu
|
||||
}
|
||||
GB_PANIC("Unknown complex type");
|
||||
} else if (is_type_float(t)) {
|
||||
Type *t_float;
|
||||
Type *t_unsigned;
|
||||
lbValue mask;
|
||||
Type *t_float = nullptr;
|
||||
Type *t_unsigned = nullptr;
|
||||
lbValue mask = {0};
|
||||
switch (type_size_of(t)) {
|
||||
case 2:
|
||||
t_float = t_f16;
|
||||
|
||||
Reference in New Issue
Block a user