xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/ltdf2vfp.S (revision 61f2f2562dcc3e4eb50e7ec5dab0dfa1f093861a)
1156cd587Sjoerg//===-- ltdf2vfp.S - Implement ltdf2vfp -----------------------------------===//
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 double __ltdf2vfp(double a, double b);
14156cd587Sjoerg//
15156cd587Sjoerg// Returns one iff a < b and neither is NaN.
16156cd587Sjoerg// Uses Darwin calling convention where double precision arguments are passsed
17156cd587Sjoerg// like in GPR pairs.
18156cd587Sjoerg//
19156cd587Sjoerg	.syntax unified
20*61f2f256Sjoerg	.p2align 2
21156cd587SjoergDEFINE_COMPILERRT_FUNCTION(__ltdf2vfp)
22156cd587Sjoerg	vmov 	d6, r0, r1	// load r0/r1 pair in double register
23156cd587Sjoerg	vmov 	d7, r2, r3	// load r2/r3 pair in double register
24156cd587Sjoerg	vcmp.f64 d6, d7
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(__ltdf2vfp)
30