Daniel Dunbar | fd08999 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 1 | // This file is distributed under the University of Illinois Open Source |
| 2 | // License. See LICENSE.TXT for details. |
| 3 | |
| 4 | // float __floatdisf(di_int a); |
| 5 | |
| 6 | // This routine has some extra memory traffic, loading the 64-bit input via two |
| 7 | // 32-bit loads, then immediately storing it back to the stack via a single 64-bit |
| 8 | // store. This is to avoid a write-small, read-large stall. |
| 9 | // However, if callers of this routine can be safely assumed to store the argument |
| 10 | // via a 64-bt store, this is unnecessary memory traffic, and should be avoided. |
| 11 | // It can be turned off by defining the TRUST_CALLERS_USE_64_BIT_STORES macro. |
| 12 | |
| 13 | #ifdef __i386__ |
| 14 | |
| 15 | .text |
| 16 | .align 4 |
| 17 | .globl ___floatdisf |
| 18 | ___floatdisf: |
| 19 | #ifndef TRUST_CALLERS_USE_64_BIT_STORES |
| 20 | movd 4(%esp), %xmm0 |
| 21 | movd 8(%esp), %xmm1 |
| 22 | punpckldq %xmm1, %xmm0 |
| 23 | movq %xmm0, 4(%esp) |
| 24 | #endif |
| 25 | fildll 4(%esp) |
| 26 | fstps 4(%esp) |
| 27 | flds 4(%esp) |
| 28 | ret |
| 29 | |
| 30 | #endif // __i386__ |