Home | History | Annotate | Line # | Download | only in i386
      1      1.1  joerg // This file is dual licensed under the MIT and the University of Illinois Open
      2      1.1  joerg // Source Licenses. See LICENSE.TXT for details.
      3      1.1  joerg 
      4      1.1  joerg #include "../assembly.h"
      5      1.1  joerg 
      6      1.1  joerg // float __floatdixf(di_int a);
      7      1.1  joerg 
      8      1.1  joerg #ifdef __i386__
      9      1.1  joerg 
     10      1.1  joerg // This routine has some extra memory traffic, loading the 64-bit input via two
     11      1.1  joerg // 32-bit loads, then immediately storing it back to the stack via a single 64-bit
     12      1.1  joerg // store.  This is to avoid a write-small, read-large stall.
     13      1.1  joerg // However, if callers of this routine can be safely assumed to store the argument
     14      1.1  joerg // via a 64-bt store, this is unnecessary memory traffic, and should be avoided.
     15      1.1  joerg // It can be turned off by defining the TRUST_CALLERS_USE_64_BIT_STORES macro.
     16      1.1  joerg 
     17      1.1  joerg .text
     18  1.1.1.2  joerg .balign 4
     19      1.1  joerg DEFINE_COMPILERRT_FUNCTION(__floatdixf)
     20      1.1  joerg #ifndef TRUST_CALLERS_USE_64_BIT_STORES
     21      1.1  joerg 	movd		4(%esp),	%xmm0
     22      1.1  joerg 	movd		8(%esp),	%xmm1
     23      1.1  joerg 	punpckldq	%xmm1,		%xmm0
     24      1.1  joerg 	movq		%xmm0,		4(%esp)
     25      1.1  joerg #endif
     26      1.1  joerg 	fildll		4(%esp)
     27      1.1  joerg 	ret
     28      1.1  joerg END_COMPILERRT_FUNCTION(__floatdixf)
     29      1.1  joerg 
     30      1.1  joerg #endif // __i386__
     31