2 * Copyright (C) 2013 Andrew Turner
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include <machine/asm.h>
29 __FBSDID("$FreeBSD$");
31 #include "aeabi_vfp.h"
36 /* void __aeabi_cfcmpeq(float, float) */
38 LOAD_SREGS(s0, s1, r0, r1)
44 /* void __aeabi_cfcmple(float, float) */
46 LOAD_SREGS(s0, s1, r0, r1)
52 /* void __aeabi_cfrcmple(float, float) */
54 LOAD_SREGS(s0, s1, r0, r1)
60 /* int __aeabi_fcmpeq(float, float) */
62 LOAD_SREGS(s0, s1, r0, r1)
70 /* int __aeabi_fcmplt(float, float) */
72 LOAD_SREGS(s0, s1, r0, r1)
80 /* int __aeabi_fcmple(float, float) */
82 LOAD_SREGS(s0, s1, r0, r1)
90 /* int __aeabi_fcmpge(float, float) */
92 LOAD_SREGS(s0, s1, r0, r1)
100 /* int __aeabi_fcmpgt(float, float) */
102 LOAD_SREGS(s0, s1, r0, r1)
104 vmrs APSR_nzcv, fpscr
110 /* int __aeabi_fcmpun(float, float) */
112 LOAD_SREGS(s0, s1, r0, r1)
114 vmrs APSR_nzcv, fpscr
120 /* int __aeabi_f2iz(float) */
125 * This should be the correct instruction, but binutils incorrectly
126 * encodes it as the version that used FPSCR to determine the rounding.
127 * When binutils is fixed we can use this again.
137 /* double __aeabi_f2d(float) */
141 UNLOAD_DREG(r0, r1, d0)
145 /* float __aeabi_i2f(int) */
153 /* float __aeabi_fadd(float, float) */
155 LOAD_SREGS(s0, s1, r0, r1)
161 /* float __aeabi_fmul(float, float) */
163 LOAD_SREGS(s0, s1, r0, r1)
169 /* float __aeabi_fmul(float, float) */
171 LOAD_SREGS(s0, s1, r0, r1)
177 /* float __aeabi_fsub(float, float) */
179 LOAD_SREGS(s0, s1, r0, r1)