unorddf2vfp.S 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //===-- unorddf2vfp.S - Implement unorddf2vfp ------------------------------===//
  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 int __unorddf2vfp(double a, double b);
  11. //
  12. // Returns one iff a or b is NaN
  13. // Uses Darwin calling convention where double precision arguments are passsed
  14. // like in GPR pairs.
  15. //
  16. .syntax unified
  17. .p2align 2
  18. DEFINE_COMPILERRT_FUNCTION(__unorddf2vfp)
  19. #if defined(COMPILER_RT_ARMHF_TARGET)
  20. vcmp.f64 d0, d1
  21. #else
  22. vmov d6, r0, r1 // load r0/r1 pair in double register
  23. vmov d7, r2, r3 // load r2/r3 pair in double register
  24. vcmp.f64 d6, d7
  25. #endif
  26. vmrs apsr_nzcv, fpscr
  27. ITE(vs)
  28. movvs r0, #1 // set result register to 1 if "overflow" (any NaNs)
  29. movvc r0, #0
  30. bx lr
  31. END_COMPILERRT_FUNCTION(__unorddf2vfp)
  32. NO_EXEC_STACK_DIRECTIVE