History

Long double Constant problem

ayush-varshney committed 5 years ago

Commit 405aef91 parent fbef90a1 file · +3 −3Browse files

Unified · Split

tccgen.c+3−3
@@ -3024,7 +3024,7 @@ static void gen_opif(int op) · 3023 unmodified lines
3024 case '-': f1 -= f2; break;3024 case '-': f1 -= f2; break;
3025 case '*': f1 *= f2; break;3025 case '*': f1 *= f2; break;
3026 case '/': 3026 case '/':
3027 if (f2 == 0.0) {3027 if (f2 == (f1-f1) ) {
3028 union { float f; unsigned u; } x1, x2, y;3028 union { float f; unsigned u; } x1, x2, y;
3029 /* If not in initializer we need to potentially generate3029 /* If not in initializer we need to potentially generate
3030 FP exceptions at runtime, otherwise we want to fold. */3030 FP exceptions at runtime, otherwise we want to fold. */
@@ -3033,7 +3033,7 @@ static void gen_opif(int op) · 2 unmodified lines
3033 /* the run-time result of 0.0/0.0 on x87, also of other compilers3033 /* the run-time result of 0.0/0.0 on x87, also of other compilers
3034 when used to compile the f1 /= f2 below, would be -nan */3034 when used to compile the f1 /= f2 below, would be -nan */
3035 x1.f = f1, x2.f = f2;3035 x1.f = f1, x2.f = f2;
3036 if (f1 == 0.0)3036 if (f1 == (f1-f1) )
3037 y.u = 0x7fc00000; /* nan */3037 y.u = 0x7fc00000; /* nan */
3038 else3038 else
3039 y.u = 0x7f800000; /* infinity */3039 y.u = 0x7f800000; /* infinity */
@@ -8102,7 +8102,7 @@ static void init_putv(init_params *p, CType *type, unsigned long c) · 5062 unmodified lines
8102 else if (sizeof (long double) == sizeof (double))8102 else if (sizeof (long double) == sizeof (double))
8103 __asm__("fldl %1\nfstpt %0\n" : "=m" (*ptr) : "m" (vtop->c.ld));8103 __asm__("fldl %1\nfstpt %0\n" : "=m" (*ptr) : "m" (vtop->c.ld));
8104#endif8104#endif
8105 else if (vtop->c.ld == 0.0)8105 else if (vtop->c.ld == (f1-f1) )
8106 ;8106 ;
8107 else8107 else
8108#endif8108#endif

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