bootstrappable: HAVE_FLOAT.
This commit is contained in:
parent
d8578d242f
commit
843ed17eff
6
tccgen.c
6
tccgen.c
|
@ -1850,11 +1850,13 @@ static void gen_opif(int op)
|
|||
case '-': f1 -= f2; break;
|
||||
case '*': f1 *= f2; break;
|
||||
case '/':
|
||||
#if HAVE_FLOAT
|
||||
if (f2 == 0.0) {
|
||||
if (const_wanted)
|
||||
tcc_error("division by zero in constant");
|
||||
goto general_case;
|
||||
}
|
||||
#endif
|
||||
f1 /= f2;
|
||||
break;
|
||||
/* XXX: also handles tests ? */
|
||||
|
@ -4660,12 +4662,14 @@ ST_FUNC void unary(void)
|
|||
/* In IEEE negate(x) isn't subtract(0,x), but rather
|
||||
subtract(-0, x). */
|
||||
vpush(&vtop->type);
|
||||
#if HAVE_FLOAT
|
||||
if (t == VT_FLOAT)
|
||||
vtop->c.f = -1.0 * 0.0;
|
||||
else if (t == VT_DOUBLE)
|
||||
vtop->c.d = -1.0 * 0.0;
|
||||
else
|
||||
vtop->c.ld = -1.0 * 0.0;
|
||||
#endif
|
||||
} else
|
||||
vpushi(0);
|
||||
vswap();
|
||||
|
@ -6195,7 +6199,7 @@ static void init_putv(CType *type, Section *sec, unsigned long c)
|
|||
#if (defined __i386__ || defined __x86_64__) && (defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64)
|
||||
else if (sizeof (long double) >= 10)
|
||||
memcpy(memset(ptr, 0, LDOUBLE_SIZE), &vtop->c.ld, 10);
|
||||
#ifdef __TINYC__
|
||||
#if defined (__TINYC__) && HAVE_FLOAT
|
||||
else if (sizeof (long double) == sizeof (double))
|
||||
__asm__("fldl %1\nfstpt %0\n" : "=m"
|
||||
(memset(ptr, 0, LDOUBLE_SIZE), ptr) : "m" (vtop->c.ld));
|
||||
|
|
2
tccpp.c
2
tccpp.c
|
@ -2284,7 +2284,9 @@ static void parse_number(const char *p)
|
|||
|
||||
/* now we can generate the number */
|
||||
/* XXX: should patch directly float number */
|
||||
#if HAVE_FLOAT
|
||||
d = (double)bn[1] * 4294967296.0 + (double)bn[0];
|
||||
#endif
|
||||
d = ldexp(d, exp_val - frac_bits);
|
||||
t = toup(ch);
|
||||
if (t == 'F') {
|
||||
|
|
Loading…
Reference in New Issue