mirror of
https://github.com/frida/tinycc
synced 2024-12-25 06:26:49 +03:00
Make type of __nan__ __inf__ and __snan__ be float
so that those builtins can be used directly for the C99 NAN and INFINITY math.h macros.
This commit is contained in:
parent
3b27b3b1d1
commit
9e47b18229
15
tccgen.c
15
tccgen.c
@ -5051,17 +5051,18 @@ ST_FUNC void unary(void)
|
||||
}
|
||||
// special qnan , snan and infinity values
|
||||
case TOK___NAN__:
|
||||
vpush64(VT_DOUBLE, 0x7ff8000000000000ULL);
|
||||
n = 0x7fc00000;
|
||||
special_math_val:
|
||||
vpushi(n);
|
||||
vtop->type.t = VT_FLOAT;
|
||||
next();
|
||||
break;
|
||||
case TOK___SNAN__:
|
||||
vpush64(VT_DOUBLE, 0x7ff0000000000001ULL);
|
||||
next();
|
||||
break;
|
||||
n = 0x7f800001;
|
||||
goto special_math_val;
|
||||
case TOK___INF__:
|
||||
vpush64(VT_DOUBLE, 0x7ff0000000000000ULL);
|
||||
next();
|
||||
break;
|
||||
n = 0x7f800000;
|
||||
goto special_math_val;
|
||||
|
||||
default:
|
||||
tok_identifier:
|
||||
|
Loading…
Reference in New Issue
Block a user