aarch64: fabs and sqrt implementation with inline asm
* libm/machine/aarch64/e_sqrt.c: New file. * libm/machine/aarch64/ef_sqrt.c: New file. * libm/machine/aarch64/s_fabs.c: New file. * libm/machine/aarch64/sf_fabs.c: New file. * libm/machine/aarch64/Makefile.in: Add new source files. * libm/machine/aarch64/Makefile.am: Regenerate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
8fe35bd15f
commit
b27c7d1d9a
@ -1,3 +1,12 @@
|
|||||||
|
2015-06-01 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||||
|
|
||||||
|
* libm/machine/aarch64/e_sqrt.c: New file.
|
||||||
|
* libm/machine/aarch64/ef_sqrt.c: New file.
|
||||||
|
* libm/machine/aarch64/s_fabs.c: New file.
|
||||||
|
* libm/machine/aarch64/sf_fabs.c: New file.
|
||||||
|
* libm/machine/aarch64/Makefile.in: Add new source files.
|
||||||
|
* libm/machine/aarch64/Makefile.am: Regenerate.
|
||||||
|
|
||||||
2015-05-31 David Stacey <drstacey@tiscali.co.uk>
|
2015-05-31 David Stacey <drstacey@tiscali.co.uk>
|
||||||
|
|
||||||
* libc/argz/argz_replace.c (argz_replace): Correct behaviour when memory
|
* libc/argz/argz_replace.c (argz_replace): Correct behaviour when memory
|
||||||
|
@ -6,7 +6,10 @@ INCLUDES = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
|
|||||||
$(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
$(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||||
|
|
||||||
LIB_SOURCES = \
|
LIB_SOURCES = \
|
||||||
|
e_sqrt.c \
|
||||||
|
ef_sqrt.c \
|
||||||
s_ceil.c \
|
s_ceil.c \
|
||||||
|
s_fabs.c \
|
||||||
s_floor.c \
|
s_floor.c \
|
||||||
s_fma.c \
|
s_fma.c \
|
||||||
s_fmax.c \
|
s_fmax.c \
|
||||||
@ -20,6 +23,7 @@ LIB_SOURCES = \
|
|||||||
s_round.c \
|
s_round.c \
|
||||||
s_trunc.c \
|
s_trunc.c \
|
||||||
sf_ceil.c \
|
sf_ceil.c \
|
||||||
|
sf_fabs.c \
|
||||||
sf_floor.c \
|
sf_floor.c \
|
||||||
sf_fma.c \
|
sf_fma.c \
|
||||||
sf_fmax.c \
|
sf_fmax.c \
|
||||||
|
@ -70,13 +70,15 @@ LIBRARIES = $(noinst_LIBRARIES)
|
|||||||
ARFLAGS = cru
|
ARFLAGS = cru
|
||||||
lib_a_AR = $(AR) $(ARFLAGS)
|
lib_a_AR = $(AR) $(ARFLAGS)
|
||||||
lib_a_LIBADD =
|
lib_a_LIBADD =
|
||||||
am__objects_1 = lib_a-s_ceil.$(OBJEXT) lib_a-s_floor.$(OBJEXT) \
|
am__objects_1 = lib_a-e_sqrt.$(OBJEXT) lib_a-ef_sqrt.$(OBJEXT) \
|
||||||
lib_a-s_fma.$(OBJEXT) lib_a-s_fmax.$(OBJEXT) \
|
lib_a-s_ceil.$(OBJEXT) lib_a-s_fabs.$(OBJEXT) \
|
||||||
lib_a-s_fmin.$(OBJEXT) lib_a-s_llrint.$(OBJEXT) \
|
lib_a-s_floor.$(OBJEXT) lib_a-s_fma.$(OBJEXT) \
|
||||||
lib_a-s_llround.$(OBJEXT) lib_a-s_lrint.$(OBJEXT) \
|
lib_a-s_fmax.$(OBJEXT) lib_a-s_fmin.$(OBJEXT) \
|
||||||
lib_a-s_lround.$(OBJEXT) lib_a-s_nearbyint.$(OBJEXT) \
|
lib_a-s_llrint.$(OBJEXT) lib_a-s_llround.$(OBJEXT) \
|
||||||
lib_a-s_rint.$(OBJEXT) lib_a-s_round.$(OBJEXT) \
|
lib_a-s_lrint.$(OBJEXT) lib_a-s_lround.$(OBJEXT) \
|
||||||
lib_a-s_trunc.$(OBJEXT) lib_a-sf_ceil.$(OBJEXT) \
|
lib_a-s_nearbyint.$(OBJEXT) lib_a-s_rint.$(OBJEXT) \
|
||||||
|
lib_a-s_round.$(OBJEXT) lib_a-s_trunc.$(OBJEXT) \
|
||||||
|
lib_a-sf_ceil.$(OBJEXT) lib_a-sf_fabs.$(OBJEXT) \
|
||||||
lib_a-sf_floor.$(OBJEXT) lib_a-sf_fma.$(OBJEXT) \
|
lib_a-sf_floor.$(OBJEXT) lib_a-sf_fma.$(OBJEXT) \
|
||||||
lib_a-sf_fmax.$(OBJEXT) lib_a-sf_fmin.$(OBJEXT) \
|
lib_a-sf_fmax.$(OBJEXT) lib_a-sf_fmin.$(OBJEXT) \
|
||||||
lib_a-sf_llrint.$(OBJEXT) lib_a-sf_llround.$(OBJEXT) \
|
lib_a-sf_llrint.$(OBJEXT) lib_a-sf_llround.$(OBJEXT) \
|
||||||
@ -209,7 +211,10 @@ INCLUDES = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
|
|||||||
$(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
$(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||||
|
|
||||||
LIB_SOURCES = \
|
LIB_SOURCES = \
|
||||||
|
e_sqrt.c \
|
||||||
|
ef_sqrt.c \
|
||||||
s_ceil.c \
|
s_ceil.c \
|
||||||
|
s_fabs.c \
|
||||||
s_floor.c \
|
s_floor.c \
|
||||||
s_fma.c \
|
s_fma.c \
|
||||||
s_fmax.c \
|
s_fmax.c \
|
||||||
@ -223,6 +228,7 @@ LIB_SOURCES = \
|
|||||||
s_round.c \
|
s_round.c \
|
||||||
s_trunc.c \
|
s_trunc.c \
|
||||||
sf_ceil.c \
|
sf_ceil.c \
|
||||||
|
sf_fabs.c \
|
||||||
sf_floor.c \
|
sf_floor.c \
|
||||||
sf_fma.c \
|
sf_fma.c \
|
||||||
sf_fmax.c \
|
sf_fmax.c \
|
||||||
@ -302,12 +308,30 @@ distclean-compile:
|
|||||||
.c.obj:
|
.c.obj:
|
||||||
$(COMPILE) -c `$(CYGPATH_W) '$<'`
|
$(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||||
|
|
||||||
|
lib_a-e_sqrt.o: e_sqrt.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-e_sqrt.o `test -f 'e_sqrt.c' || echo '$(srcdir)/'`e_sqrt.c
|
||||||
|
|
||||||
|
lib_a-e_sqrt.obj: e_sqrt.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-e_sqrt.obj `if test -f 'e_sqrt.c'; then $(CYGPATH_W) 'e_sqrt.c'; else $(CYGPATH_W) '$(srcdir)/e_sqrt.c'; fi`
|
||||||
|
|
||||||
|
lib_a-ef_sqrt.o: ef_sqrt.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ef_sqrt.o `test -f 'ef_sqrt.c' || echo '$(srcdir)/'`ef_sqrt.c
|
||||||
|
|
||||||
|
lib_a-ef_sqrt.obj: ef_sqrt.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ef_sqrt.obj `if test -f 'ef_sqrt.c'; then $(CYGPATH_W) 'ef_sqrt.c'; else $(CYGPATH_W) '$(srcdir)/ef_sqrt.c'; fi`
|
||||||
|
|
||||||
lib_a-s_ceil.o: s_ceil.c
|
lib_a-s_ceil.o: s_ceil.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_ceil.o `test -f 's_ceil.c' || echo '$(srcdir)/'`s_ceil.c
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_ceil.o `test -f 's_ceil.c' || echo '$(srcdir)/'`s_ceil.c
|
||||||
|
|
||||||
lib_a-s_ceil.obj: s_ceil.c
|
lib_a-s_ceil.obj: s_ceil.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_ceil.obj `if test -f 's_ceil.c'; then $(CYGPATH_W) 's_ceil.c'; else $(CYGPATH_W) '$(srcdir)/s_ceil.c'; fi`
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_ceil.obj `if test -f 's_ceil.c'; then $(CYGPATH_W) 's_ceil.c'; else $(CYGPATH_W) '$(srcdir)/s_ceil.c'; fi`
|
||||||
|
|
||||||
|
lib_a-s_fabs.o: s_fabs.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fabs.o `test -f 's_fabs.c' || echo '$(srcdir)/'`s_fabs.c
|
||||||
|
|
||||||
|
lib_a-s_fabs.obj: s_fabs.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fabs.obj `if test -f 's_fabs.c'; then $(CYGPATH_W) 's_fabs.c'; else $(CYGPATH_W) '$(srcdir)/s_fabs.c'; fi`
|
||||||
|
|
||||||
lib_a-s_floor.o: s_floor.c
|
lib_a-s_floor.o: s_floor.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo '$(srcdir)/'`s_floor.c
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo '$(srcdir)/'`s_floor.c
|
||||||
|
|
||||||
@ -386,6 +410,12 @@ lib_a-sf_ceil.o: sf_ceil.c
|
|||||||
lib_a-sf_ceil.obj: sf_ceil.c
|
lib_a-sf_ceil.obj: sf_ceil.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_ceil.obj `if test -f 'sf_ceil.c'; then $(CYGPATH_W) 'sf_ceil.c'; else $(CYGPATH_W) '$(srcdir)/sf_ceil.c'; fi`
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_ceil.obj `if test -f 'sf_ceil.c'; then $(CYGPATH_W) 'sf_ceil.c'; else $(CYGPATH_W) '$(srcdir)/sf_ceil.c'; fi`
|
||||||
|
|
||||||
|
lib_a-sf_fabs.o: sf_fabs.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fabs.o `test -f 'sf_fabs.c' || echo '$(srcdir)/'`sf_fabs.c
|
||||||
|
|
||||||
|
lib_a-sf_fabs.obj: sf_fabs.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fabs.obj `if test -f 'sf_fabs.c'; then $(CYGPATH_W) 'sf_fabs.c'; else $(CYGPATH_W) '$(srcdir)/sf_fabs.c'; fi`
|
||||||
|
|
||||||
lib_a-sf_floor.o: sf_floor.c
|
lib_a-sf_floor.o: sf_floor.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_floor.o `test -f 'sf_floor.c' || echo '$(srcdir)/'`sf_floor.c
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_floor.o `test -f 'sf_floor.c' || echo '$(srcdir)/'`sf_floor.c
|
||||||
|
|
||||||
|
35
newlib/libm/machine/aarch64/e_sqrt.c
Normal file
35
newlib/libm/machine/aarch64/e_sqrt.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* e_sqrt.c -- define __ieee754_sqrt
|
||||||
|
Copyright (c) 2015 ARM Ltd. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. The name of the company may not be used to endorse or promote
|
||||||
|
products derived from this software without specific prior written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
double
|
||||||
|
__ieee754_sqrt (double x)
|
||||||
|
{
|
||||||
|
double result;
|
||||||
|
asm ("fsqrt\t%d0, %d1" : "=w" (result) : "w" (x));
|
||||||
|
return result;
|
||||||
|
}
|
35
newlib/libm/machine/aarch64/ef_sqrt.c
Normal file
35
newlib/libm/machine/aarch64/ef_sqrt.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* ef_sqrt.c -- define __ieee754_sqrtf
|
||||||
|
Copyright (c) 2015 ARM Ltd. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. The name of the company may not be used to endorse or promote
|
||||||
|
products derived from this software without specific prior written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
float
|
||||||
|
__ieee754_sqrtf (float x)
|
||||||
|
{
|
||||||
|
float result;
|
||||||
|
asm ("fsqrt\t%s0, %s1" : "=w" (result) : "w" (x));
|
||||||
|
return result;
|
||||||
|
}
|
35
newlib/libm/machine/aarch64/s_fabs.c
Normal file
35
newlib/libm/machine/aarch64/s_fabs.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* s_fabs.c -- define fabs
|
||||||
|
Copyright (c) 2015 ARM Ltd. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. The name of the company may not be used to endorse or promote
|
||||||
|
products derived from this software without specific prior written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
double
|
||||||
|
fabs (double x)
|
||||||
|
{
|
||||||
|
double result;
|
||||||
|
asm ("fabs\t%d0, %d1" : "=w" (result) : "w" (x));
|
||||||
|
return result;
|
||||||
|
}
|
35
newlib/libm/machine/aarch64/sf_fabs.c
Normal file
35
newlib/libm/machine/aarch64/sf_fabs.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* sf_fabs.c -- define fabsf
|
||||||
|
Copyright (c) 2015 ARM Ltd. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. The name of the company may not be used to endorse or promote
|
||||||
|
products derived from this software without specific prior written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
float
|
||||||
|
fabsf (float x)
|
||||||
|
{
|
||||||
|
float result;
|
||||||
|
asm ("fabs\t%s0, %s1" : "=w" (result) : "w" (x));
|
||||||
|
return result;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user