floatundisf.S 692 B

123456789101112131415161718192021222324252627282930313233343536373839
  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
  4. #include "../assembly.h"
  5. // float __floatundisf(du_int a);
  6. #ifdef __x86_64__
  7. CONST_SECTION
  8. .balign 16
  9. two:
  10. .single 2.0
  11. #define REL_ADDR(_a) (_a)(%rip)
  12. .text
  13. .balign 4
  14. DEFINE_COMPILERRT_FUNCTION(__floatundisf)
  15. movq $1, %rsi
  16. testq %rdi, %rdi
  17. js 1f
  18. cvtsi2ssq %rdi, %xmm0
  19. ret
  20. 1: andq %rdi, %rsi
  21. shrq %rdi
  22. orq %rsi, %rdi
  23. cvtsi2ssq %rdi, %xmm0
  24. mulss REL_ADDR(two), %xmm0
  25. ret
  26. END_COMPILERRT_FUNCTION(__floatundisf)
  27. #endif // __x86_64__
  28. NO_EXEC_STACK_DIRECTIVE