[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / lib / builtins / x86_64 / floatundisf.S
blob246bdff5a4c30824c3fadf8913151dd4029b43ad
1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 #include "../assembly.h"
7 // float __floatundisf(du_int a);
9 #ifdef __x86_64__
11 CONST_SECTION
13         .balign 16
14 two:
15         .single 2.0
17 #define REL_ADDR(_a)    (_a)(%rip)
19 .text
20 .balign 4
21 DEFINE_COMPILERRT_FUNCTION(__floatundisf)
22         movq            $1,                     %rsi
23         testq           %rdi,           %rdi
24         js                      1f
25         cvtsi2ssq       %rdi,           %xmm0
26         ret
28 1:      andq            %rdi,           %rsi
29         shrq            %rdi
30         orq                     %rsi,           %rdi
31         cvtsi2ssq       %rdi,           %xmm0
32         mulss   REL_ADDR(two),  %xmm0
33         ret
34 END_COMPILERRT_FUNCTION(__floatundisf)
36 #endif // __x86_64__
38 NO_EXEC_STACK_DIRECTIVE