[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] float value triggers error
From: |
Steven G. Messervey |
Subject: |
Re: [Tinycc-devel] float value triggers error |
Date: |
Mon, 4 Nov 2013 05:29:33 -0800 (PST) |
>----- Original Message -----
>From: Daniel Glöckner <address@hidden>
>To: address@hidden
>Cc:
>Sent: Sunday, November 3, 2013 5:29 PM
>Subject: Re: [Tinycc-devel] float value triggers error
>On Sun, Nov 03, 2013 at 12:09:32PM -0800, Steven G. Messervey wrote:
>> mob-branch, configured with "--with-libgcc" only, debian squeeze 32-bit:
>> tcc: error: undefined symbol '__tcc_fpinit'
>> tcc: error: undefined symbol '__tcc_cvt_ftol'
>--with-libgcc uses libgcc instead of libtcc1.
>This will of course fail for tcc specific functions.
>__tcc_cvt_ftol does the same as libgcc's __fix{s,d,x}fdi
>and there are already tokens defined for those functions
>for use on ARM. The only difference is that __tcc_cvt_ftol
>passes the floating point value in a register and therefore
>does not have to distinguish between float, double, and
>long double.
>__tcc_fpinit is probably redundant on Linux as GLIBC
>already calls __setfpucw right before calling main.
> Daniel
#idef 'ing out the call to _tcc_fpinit works.
I tried (blindly) substituting __fixsfdi for __tcc_cvt_ftol in an #ifdef in
tcctok.h ;
the result of the following program produces ridiculous results:
int y = (int)(25.0 * ((double)rand() / (double)RAND_MAX));
printf("y = %d\n",y);
On my test machine, this gives 1610612736, well above 25.
I'd like to push a patch for this issue, but I am still
unsure as to how to fix the problem.
Thanks,
Steve