eqsf2vfp.S 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //===-- eqsf2vfp.S - Implement eqsf2vfp -----------------------------------===//
  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 __eqsf2vfp(float a, float b);
  11. //
  12. // Returns one iff a == b and neither is NaN.
  13. // Uses Darwin calling convention where single precision arguments are passsed
  14. // like 32-bit ints
  15. //
  16. .syntax unified
  17. .p2align 2
  18. DEFINE_COMPILERRT_FUNCTION(__eqsf2vfp)
  19. #if defined(COMPILER_RT_ARMHF_TARGET)
  20. vcmp.f32 s0, s1
  21. #else
  22. vmov s14, r0 // move from GPR 0 to float register
  23. vmov s15, r1 // move from GPR 1 to float register
  24. vcmp.f32 s14, s15
  25. #endif
  26. vmrs apsr_nzcv, fpscr
  27. ITE(eq)
  28. moveq r0, #1 // set result register to 1 if equal
  29. movne r0, #0
  30. bx lr
  31. END_COMPILERRT_FUNCTION(__eqsf2vfp)
  32. NO_EXEC_STACK_DIRECTIVE