History

partial revert of the commit 4ad186c5ef61 A test program:

/* result of the new version inroduced in 4ad186c5ef61: t2a = 44100312 */ #include<stdio.h> int main() { int t1 = 176401255; float f = 0.25f; int t2a = (int)(t1 * f); // must be 44100313 int t2b = (int)(t1 * (float)0.25f); printf("t2a=%d t2b=%d \n",t2a,t2b); return 0; }

seyko committed 11 years ago

Commit 664c19a1 parent bfb7b0d3 files · +41 −0Browse files

Showing the changes to lib (1 of 3 files). Show all

Unified · Split

lib/libtcc1.c+14−0
@@ -480,6 +480,20 @@ long long __ashldi3(long long a, int b) · 479 unmodified lines
480480 #endif
481481 }
482482
483+#ifndef COMMIT_4ad186c5ef61_IS_FIXED
484+long long __tcc_cvt_ftol(long double x)
485+{
486+ unsigned c0, c1;
487+ long long ret;
488+ __asm__ __volatile__ ("fnstcw %0" : "=m" (c0));
489+ c1 = c0 | 0x0C00;
490+ __asm__ __volatile__ ("fldcw %0" : : "m" (c1));
491+ __asm__ __volatile__ ("fistpll %0" : "=m" (ret));
492+ __asm__ __volatile__ ("fldcw %0" : : "m" (c0));
493+ return ret;
494+}
495+#endif
496+
483497 #endif /* !__x86_64__ */
484498
485499 /* XXX: fix tcc's code generator to do this instead */

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