xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/adddf3vfp.S (revision 61f2f2562dcc3e4eb50e7ec5dab0dfa1f093861a)
1156cd587Sjoerg//===-- adddf3vfp.S - Implement adddf3vfp ---------------------------------===//
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// double __adddf3vfp(double a, double b) { return a + b; }
14156cd587Sjoerg//
15156cd587Sjoerg// Adds two double precision floating point numbers using the Darwin
16156cd587Sjoerg// calling convention where double arguments are passsed in GPR pairs
17156cd587Sjoerg//
18156cd587Sjoerg	.syntax unified
19*61f2f256Sjoerg	.p2align 2
20156cd587SjoergDEFINE_COMPILERRT_FUNCTION(__adddf3vfp)
21156cd587Sjoerg	vmov	d6, r0, r1		// move first param from r0/r1 pair into d6
22156cd587Sjoerg	vmov	d7, r2, r3		// move second param from r2/r3 pair into d7
23156cd587Sjoerg	vadd.f64 d6, d6, d7
24156cd587Sjoerg	vmov	r0, r1, d6		// move result back to r0/r1 pair
25156cd587Sjoerg	bx	lr
26156cd587SjoergEND_COMPILERRT_FUNCTION(__adddf3vfp)
27