History

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.

Michael Matz committed 8 years ago

Commit 9e47b181 parent 3b27b3b1 file · +8 −7Browse files

Unified · Split

tccgen.c+8−7
@@ -5051,17 +5051,18 @@ ST_FUNC void unary(void) · 5050 unmodified lines
50515051 }
50525052 // special qnan , snan and infinity values
50535053 case TOK___NAN__:
5054− vpush64(VT_DOUBLE, 0x7ff8000000000000ULL);
5054+ n = 0x7fc00000;
5055+special_math_val:
5056+ vpushi(n);
5057+ vtop->type.t = VT_FLOAT;
50555058 next();
50565059 break;
50575060 case TOK___SNAN__:
5058− vpush64(VT_DOUBLE, 0x7ff0000000000001ULL);
5059− next();
5060− break;
5061+ n = 0x7f800001;
5062+ goto special_math_val;
50615063 case TOK___INF__:
5062− vpush64(VT_DOUBLE, 0x7ff0000000000000ULL);
5063− next();
5064− break;
5064+ n = 0x7f800000;
5065+ goto special_math_val;
50655066
50665067 default:
50675068 tok_identifier:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t