37 lines · plain
1//===-- nesf2vfp.S - Implement nesf2vfp -----------------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "../assembly.h"10 11//12// extern int __nesf2vfp(float a, float b);13//14// Returns one iff a != b and neither is NaN.15// Uses Darwin calling convention where single precision arguments are passsed16// like 32-bit ints17//18 .syntax unified19 .p2align 220DEFINE_COMPILERRT_FUNCTION(__nesf2vfp)21#if defined(COMPILER_RT_ARMHF_TARGET)22 vcmp.f32 s0, s123#else24 vmov s14, r0 // move from GPR 0 to float register25 vmov s15, r1 // move from GPR 1 to float register26 vcmp.f32 s14, s1527#endif28 vmrs apsr_nzcv, fpscr29 ITE(ne)30 movne r0, #1 // set result register to 1 if unequal31 moveq r0, #032 bx lr33END_COMPILERRT_FUNCTION(__nesf2vfp)34 35NO_EXEC_STACK_DIRECTIVE36 37