nedf2vfp.S 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //===-- nedf2vfp.S - Implement nedf2vfp -----------------------------------===//
  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. // extern double __nedf2vfp(double a, double b);
  10. //
  11. // Returns zero if a and b are unequal and neither is NaN.
  12. // Uses Darwin calling convention where double precision arguments are passsed
  13. // like in GPR pairs.
  14. .syntax unified
  15. .p2align 2
  16. DEFINE_COMPILERRT_FUNCTION(__nedf2vfp)
  17. #if defined(COMPILER_RT_ARMHF_TARGET)
  18. vcmp.f64 d0, d1
  19. #else
  20. vmov d6, r0, r1 // load r0/r1 pair in double register
  21. vmov d7, r2, r3 // load r2/r3 pair in double register
  22. vcmp.f64 d6, d7
  23. #endif
  24. vmrs apsr_nzcv, fpscr
  25. ITE(ne)
  26. movne r0, #1 // set result register to 0 if unequal
  27. moveq r0, #0
  28. bx lr
  29. END_COMPILERRT_FUNCTION(__nedf2vfp)
  30. NO_EXEC_STACK_DIRECTIVE