]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/compiler-rt/lib/x86_64/floatundisf.S
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / compiler-rt / lib / x86_64 / floatundisf.S
1 // This file is dual licensed under the MIT and the University of Illinois Open
2 // Source Licenses. See LICENSE.TXT for details.
3
4 #include "../assembly.h"
5
6 // float __floatundisf(du_int a);
7
8 #ifdef __x86_64__
9
10 #ifndef __ELF__
11 .literal4
12 #endif
13 two: .single 2.0
14
15 #define REL_ADDR(_a)    (_a)(%rip)
16
17 .text
18 .align 4
19 DEFINE_COMPILERRT_FUNCTION(__floatundisf)
20         movq            $1,                     %rsi
21         testq           %rdi,           %rdi
22         js                      1f
23         cvtsi2ssq       %rdi,           %xmm0
24         ret
25         
26 1:      andq            %rdi,           %rsi
27         shrq            %rdi
28         orq                     %rsi,           %rdi
29         cvtsi2ssq       %rdi,           %xmm0
30         mulss   REL_ADDR(two),  %xmm0
31         ret
32         
33 #endif // __x86_64__