xref: /minix3/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/gtdf2vfp.S (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc//===-- gtdf2vfp.S - Implement gtdf2vfp -----------------------------------===//
2*0a6a1f1dSLionel Sambuc//
3*0a6a1f1dSLionel Sambuc//                     The LLVM Compiler Infrastructure
4*0a6a1f1dSLionel Sambuc//
5*0a6a1f1dSLionel Sambuc// This file is dual licensed under the MIT and the University of Illinois Open
6*0a6a1f1dSLionel Sambuc// Source Licenses. See LICENSE.TXT for details.
7*0a6a1f1dSLionel Sambuc//
8*0a6a1f1dSLionel Sambuc//===----------------------------------------------------------------------===//
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuc#include "../assembly.h"
11*0a6a1f1dSLionel Sambuc
12*0a6a1f1dSLionel Sambuc//
13*0a6a1f1dSLionel Sambuc// extern double __gtdf2vfp(double a, double b);
14*0a6a1f1dSLionel Sambuc//
15*0a6a1f1dSLionel Sambuc// Returns one iff a > b and neither is NaN.
16*0a6a1f1dSLionel Sambuc// Uses Darwin calling convention where double precision arguments are passsed
17*0a6a1f1dSLionel Sambuc// like in GPR pairs.
18*0a6a1f1dSLionel Sambuc//
19*0a6a1f1dSLionel Sambuc	.syntax unified
20*0a6a1f1dSLionel Sambuc	.p2align 2
21*0a6a1f1dSLionel SambucDEFINE_COMPILERRT_FUNCTION(__gtdf2vfp)
22*0a6a1f1dSLionel Sambuc	vmov 	d6, r0, r1	// load r0/r1 pair in double register
23*0a6a1f1dSLionel Sambuc	vmov 	d7, r2, r3	// load r2/r3 pair in double register
24*0a6a1f1dSLionel Sambuc	vcmp.f64 d6, d7
25*0a6a1f1dSLionel Sambuc	vmrs	apsr_nzcv, fpscr
26*0a6a1f1dSLionel Sambuc	movgt	r0, #1		// set result register to 1 if equal
27*0a6a1f1dSLionel Sambuc	movle	r0, #0
28*0a6a1f1dSLionel Sambuc	bx	lr
29*0a6a1f1dSLionel SambucEND_COMPILERRT_FUNCTION(__gtdf2vfp)
30