xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/ltsf2vfp.S (revision 61f2f2562dcc3e4eb50e7ec5dab0dfa1f093861a)
1156cd587Sjoerg//===-- ltsf2vfp.S - Implement ltsf2vfp -----------------------------------===//
2156cd587Sjoerg//
3156cd587Sjoerg//                     The LLVM Compiler Infrastructure
4156cd587Sjoerg//
5156cd587Sjoerg// This file is dual licensed under the MIT and the University of Illinois Open
6156cd587Sjoerg// Source Licenses. See LICENSE.TXT for details.
7156cd587Sjoerg//
8156cd587Sjoerg//===----------------------------------------------------------------------===//
9156cd587Sjoerg
10156cd587Sjoerg#include "../assembly.h"
11156cd587Sjoerg
12156cd587Sjoerg//
13156cd587Sjoerg// extern int __ltsf2vfp(float a, float b);
14156cd587Sjoerg//
15156cd587Sjoerg// Returns one iff a < b and neither is NaN.
16156cd587Sjoerg// Uses Darwin calling convention where single precision arguments are passsed
17156cd587Sjoerg// like 32-bit ints
18156cd587Sjoerg//
19156cd587Sjoerg	.syntax unified
20*61f2f256Sjoerg	.p2align 2
21156cd587SjoergDEFINE_COMPILERRT_FUNCTION(__ltsf2vfp)
22156cd587Sjoerg	vmov	s14, r0     // move from GPR 0 to float register
23156cd587Sjoerg	vmov	s15, r1     // move from GPR 1 to float register
24156cd587Sjoerg	vcmp.f32 s14, s15
25156cd587Sjoerg	vmrs	apsr_nzcv, fpscr
26156cd587Sjoerg	movmi	r0, #1      // set result register to 1 if equal
27156cd587Sjoerg	movpl	r0, #0
28156cd587Sjoerg	bx	lr
29156cd587SjoergEND_COMPILERRT_FUNCTION(__ltsf2vfp)
30