1214152Sed//===-- eqdf2vfp.S - Implement eqdf2vfp -----------------------------------===//
2214152Sed//
3214152Sed//                     The LLVM Compiler Infrastructure
4214152Sed//
5222656Sed// This file is dual licensed under the MIT and the University of Illinois Open
6222656Sed// Source Licenses. See LICENSE.TXT for details.
7214152Sed//
8214152Sed//===----------------------------------------------------------------------===//
9214152Sed
10214152Sed#include "../assembly.h"
11214152Sed
12214152Sed//
13214152Sed// extern int __eqdf2vfp(double a, double b);
14214152Sed//
15214152Sed// Returns one iff a == b and neither is NaN.
16214152Sed// Uses Darwin calling convention where double precision arguments are passsed
17214152Sed// like in GPR pairs.
18214152Sed//
19236011Smarius	.syntax unified
20214152Sed	.align 2
21214152SedDEFINE_COMPILERRT_FUNCTION(__eqdf2vfp)
22236011Smarius	vmov	d6, r0, r1	// load r0/r1 pair in double register
23236011Smarius	vmov	d7, r2, r3	// load r2/r3 pair in double register
24236011Smarius	vcmp.f64 d6, d7
25236011Smarius	vmrs	apsr_nzcv, fpscr
26214152Sed	moveq	r0, #1		// set result register to 1 if equal
27214152Sed	movne	r0, #0
28214152Sed	bx	lr
29