1276789Sdim//===-- ltdf2vfp.S - Implement ltdf2vfp -----------------------------------===//
2276789Sdim//
3276789Sdim//                     The LLVM Compiler Infrastructure
4276789Sdim//
5276789Sdim// This file is dual licensed under the MIT and the University of Illinois Open
6276789Sdim// Source Licenses. See LICENSE.TXT for details.
7276789Sdim//
8276789Sdim//===----------------------------------------------------------------------===//
9276789Sdim
10276789Sdim#include "../assembly.h"
11276789Sdim
12276789Sdim//
13276789Sdim// extern double __ltdf2vfp(double a, double b);
14276789Sdim//
15276789Sdim// Returns one iff a < b and neither is NaN.
16276789Sdim// Uses Darwin calling convention where double precision arguments are passsed
17276789Sdim// like in GPR pairs.
18276789Sdim//
19276789Sdim	.syntax unified
20276789Sdim	.p2align 2
21276789SdimDEFINE_COMPILERRT_FUNCTION(__ltdf2vfp)
22276789Sdim	vmov 	d6, r0, r1	// load r0/r1 pair in double register
23276789Sdim	vmov 	d7, r2, r3	// load r2/r3 pair in double register
24276789Sdim	vcmp.f64 d6, d7
25276789Sdim	vmrs	apsr_nzcv, fpscr
26276789Sdim	movmi	r0, #1		// set result register to 1 if equal
27276789Sdim	movpl	r0, #0
28276789Sdim	bx	lr
29276789SdimEND_COMPILERRT_FUNCTION(__ltdf2vfp)
30