extendsfdf2vfp.S 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. //===-- extendsfdf2vfp.S - Implement extendsfdf2vfp -----------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "../assembly.h"
  9. //
  10. // extern double __extendsfdf2vfp(float a);
  11. //
  12. // Converts single precision float to double precision result.
  13. // Uses Darwin calling convention where a single precision parameter is
  14. // passed in a GPR and a double precision result is returned in R0/R1 pair.
  15. //
  16. .syntax unified
  17. .p2align 2
  18. DEFINE_COMPILERRT_FUNCTION(__extendsfdf2vfp)
  19. #if defined(COMPILER_RT_ARMHF_TARGET)
  20. vcvt.f64.f32 d0, s0
  21. #else
  22. vmov s15, r0 // load float register from R0
  23. vcvt.f64.f32 d7, s15 // convert single to double
  24. vmov r0, r1, d7 // return result in r0/r1 pair
  25. #endif
  26. bx lr
  27. END_COMPILERRT_FUNCTION(__extendsfdf2vfp)
  28. NO_EXEC_STACK_DIRECTIVE