xref: /minix3/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/subdf3vfp.S (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc//===-- subdf3vfp.S - Implement subdf3vfp ---------------------------------===//
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 __subdf3vfp(double a, double b);
14*0a6a1f1dSLionel Sambuc//
15*0a6a1f1dSLionel Sambuc// Returns difference between two double precision floating point numbers using
16*0a6a1f1dSLionel Sambuc// the Darwin calling convention where double arguments are passsed in GPR pairs
17*0a6a1f1dSLionel Sambuc//
18*0a6a1f1dSLionel Sambuc	.syntax unified
19*0a6a1f1dSLionel Sambuc	.p2align 2
20*0a6a1f1dSLionel SambucDEFINE_COMPILERRT_FUNCTION(__subdf3vfp)
21*0a6a1f1dSLionel Sambuc	vmov 	d6, r0, r1         // move first param from r0/r1 pair into d6
22*0a6a1f1dSLionel Sambuc	vmov 	d7, r2, r3         // move second param from r2/r3 pair into d7
23*0a6a1f1dSLionel Sambuc	vsub.f64 d6, d6, d7
24*0a6a1f1dSLionel Sambuc	vmov 	r0, r1, d6         // move result back to r0/r1 pair
25*0a6a1f1dSLionel Sambuc	bx	lr
26*0a6a1f1dSLionel SambucEND_COMPILERRT_FUNCTION(__subdf3vfp)
27