mirror of git://sourceware.org/git/glibc.git
AArch64: Adding optimized maths functions.
This commit is contained in:
parent
cfde9b463d
commit
a6d9783fe7
|
@ -1,3 +1,34 @@
|
|||
2012-11-19 Marcus Shawcroft <marcus.shawcroft@linaro.org>
|
||||
|
||||
* sysdeps/aarch64/fpu/s_ceil.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_ceilf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_floor.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_floorf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_fma.c: Replace file.
|
||||
* sysdeps/aarch64/fpu/s_fmaf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_fmax.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_fmaxf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_fmin.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_fminf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_frint.x: New file.
|
||||
* sysdeps/aarch64/fpu/s_frintf.x: New file.
|
||||
* sysdeps/aarch64/fpu/s_llrint.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_llrintf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_llround.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_llroundf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_lrint.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_lrintf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_lround.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_lroundf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_nearbyint.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_nearbyintf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_rint.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_rintf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_round.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_roundf.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_trunc.c: New file.
|
||||
* sysdeps/aarch64/fpu/s_truncf.c: New file.
|
||||
|
||||
2012-11-09 Marcus Shawcroft <marcus.shawcroft@linaro.org>
|
||||
|
||||
* sysdeps/aarch64/Implies: New file.
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC ceil
|
||||
#define INSN "frintp"
|
||||
#include <s_frint.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC ceilf
|
||||
#define INSN "frintp"
|
||||
#include <s_frintf.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC floor
|
||||
#define INSN "frintm"
|
||||
#include <s_frint.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC floorf
|
||||
#define INSN "frintm"
|
||||
#include <s_frintf.x>
|
|
@ -1,2 +1,54 @@
|
|||
/* Always use dbl-64 version because long double is emulated in software. */
|
||||
#include <sysdeps/ieee754/dbl-64/s_fma.c>
|
||||
/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef FUNC
|
||||
#define FUNC fma
|
||||
#endif
|
||||
|
||||
#ifndef TYPE
|
||||
#define TYPE double
|
||||
#define REGS "d"
|
||||
#else
|
||||
#ifndef REGS
|
||||
#error REGS not defined
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define __CONCATX(a,b) __CONCAT(a,b)
|
||||
|
||||
TYPE
|
||||
__CONCATX(__,FUNC) (x, y, z)
|
||||
TYPE x;
|
||||
TYPE y;
|
||||
TYPE z;
|
||||
{
|
||||
TYPE result;
|
||||
asm ( "fmadd" "\t%" REGS "0, %" REGS "1, %" REGS "2, %" REGS "3"
|
||||
: "=w" (result) : "w" (x), "w" (y), "w" (z) );
|
||||
return result;
|
||||
}
|
||||
|
||||
#define weak_aliasx(a,b) weak_alias(a,b)
|
||||
weak_aliasx (__CONCATX(__,FUNC), FUNC)
|
||||
#define strong_aliasx(a,b) strong_alias(a,b)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_aliasx (__CONCATX(__,FUNC), __CONCATX(__,__CONCATX(FUNC,l)))
|
||||
weak_aliasx (__CONCATX(__,FUNC), __CONCATX(FUNC,l))
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC fmaf
|
||||
#define TYPE float
|
||||
#define REGS "s"
|
||||
#include <s_fma.c>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC fmax
|
||||
#define INSN "fmaxnm"
|
||||
#include <s_fmin.c>
|
|
@ -0,0 +1,23 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC fmaxf
|
||||
#define INSN "fmaxnm"
|
||||
#define TYPE float
|
||||
#define REGS "s"
|
||||
#include <s_fmin.c>
|
|
@ -0,0 +1,57 @@
|
|||
/* Copyright (C) 1996, 1997, 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef FUNC
|
||||
#define FUNC fmin
|
||||
#endif
|
||||
|
||||
#ifndef INSN
|
||||
#define INSN "fminnm"
|
||||
#endif
|
||||
|
||||
#ifndef TYPE
|
||||
#define TYPE double
|
||||
#define REGS "d"
|
||||
#else
|
||||
#ifndef REGS
|
||||
#error REGS not defined
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define __CONCATX(a,b) __CONCAT(a,b)
|
||||
|
||||
TYPE
|
||||
__CONCATX(__,FUNC) (x, y)
|
||||
TYPE x;
|
||||
TYPE y;
|
||||
{
|
||||
TYPE result;
|
||||
asm ( INSN "\t%" REGS "0, %" REGS "1, %" REGS "2"
|
||||
: "=w" (result) : "w" (x), "w" (y) );
|
||||
return result;
|
||||
}
|
||||
|
||||
#define weak_aliasx(a,b) weak_alias(a,b)
|
||||
weak_aliasx (__CONCATX(__,FUNC), FUNC)
|
||||
#define strong_aliasx(a,b) strong_alias(a,b)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_aliasx (__CONCATX(__,FUNC), __CONCATX(__,__CONCATX(FUNC,l)))
|
||||
weak_aliasx (__CONCATX(__,FUNC), __CONCATX(FUNC,l))
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC fminf
|
||||
#define TYPE float
|
||||
#define REGS "s"
|
||||
#include <s_fmin.c>
|
|
@ -0,0 +1,56 @@
|
|||
/* Copyright (C) 1996, 1997, 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef FUNC
|
||||
#error FUNC not defined
|
||||
#endif
|
||||
|
||||
#ifndef TYPE
|
||||
#define TYPE double
|
||||
#define REGS "d"
|
||||
#else
|
||||
#ifndef REGS
|
||||
#error REGS not defined
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INSN
|
||||
#error INSN not defined
|
||||
#endif
|
||||
|
||||
#define __CONCATX(a,b) __CONCAT(a,b)
|
||||
|
||||
TYPE
|
||||
__CONCATX(__,FUNC) (x)
|
||||
TYPE x;
|
||||
{
|
||||
TYPE result;
|
||||
asm ( INSN "\t%" REGS "0, %" REGS "1" :
|
||||
"=w" (result) : "w" (x) );
|
||||
return result;
|
||||
}
|
||||
|
||||
#define weak_aliasx(a,b) weak_alias(a,b)
|
||||
weak_aliasx (__CONCATX(__,FUNC), FUNC)
|
||||
#define strong_aliasx(a,b) strong_alias(a,b)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_aliasx (__CONCATX(__,FUNC), __CONCATX(__,__CONCATX(FUNC,l)))
|
||||
weak_aliasx (__CONCATX(__,FUNC), __CONCATX(FUNC,l))
|
||||
#endif
|
|
@ -0,0 +1,24 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef FUNC
|
||||
#error FUNC not defined
|
||||
#endif
|
||||
#define TYPE float
|
||||
#define REGS "s"
|
||||
#include <s_frint.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC llrint
|
||||
#define OTYPE long long int
|
||||
#include <s_lrint.c>
|
|
@ -0,0 +1,23 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC llrintf
|
||||
#define ITYPE float
|
||||
#define IREGS "s"
|
||||
#define OTYPE long long int
|
||||
#include <s_lrint.c>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC llround
|
||||
#define OTYPE long long int
|
||||
#include <s_lround.c>
|
|
@ -0,0 +1,23 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC llroundf
|
||||
#define ITYPE float
|
||||
#define IREGS "s"
|
||||
#define OTYPE long long int
|
||||
#include <s_lround.c>
|
|
@ -0,0 +1,60 @@
|
|||
/* Copyright (C) 1996, 1997, 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef FUNC
|
||||
#define FUNC lrint
|
||||
#endif
|
||||
|
||||
#ifndef ITYPE
|
||||
#define ITYPE double
|
||||
#define IREGS "d"
|
||||
#else
|
||||
#ifndef IREGS
|
||||
#error IREGS not defined
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef OTYPE
|
||||
#define OTYPE long int
|
||||
#endif
|
||||
|
||||
#define OREGS "x"
|
||||
|
||||
#define __CONCATX(a,b) __CONCAT(a,b)
|
||||
|
||||
OTYPE
|
||||
__CONCATX(__,FUNC) (x)
|
||||
ITYPE x;
|
||||
{
|
||||
OTYPE result;
|
||||
ITYPE temp;
|
||||
asm ( "frintx" "\t%" IREGS "1, %" IREGS "2\n\t"
|
||||
"fcvtzs" "\t%" OREGS "0, %" IREGS "1"
|
||||
: "=r" (result), "=w" (temp) : "w" (x) );
|
||||
return result;
|
||||
}
|
||||
|
||||
#define weak_aliasx(a,b) weak_alias(a,b)
|
||||
weak_aliasx (__CONCATX(__,FUNC), FUNC)
|
||||
#define strong_aliasx(a,b) strong_alias(a,b)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_aliasx (__CONCATX(__,FUNC), __CONCATX(__,__CONCATX(FUNC,l)))
|
||||
weak_aliasx (__CONCATX(__,FUNC), __CONCATX(FUNC,l))
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC lrintf
|
||||
#define ITYPE float
|
||||
#define IREGS "s"
|
||||
#include <s_lrint.c>
|
|
@ -0,0 +1,58 @@
|
|||
/* Copyright (C) 1996, 1997, 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef FUNC
|
||||
#define FUNC lround
|
||||
#endif
|
||||
|
||||
#ifndef ITYPE
|
||||
#define ITYPE double
|
||||
#define IREGS "d"
|
||||
#else
|
||||
#ifndef IREGS
|
||||
#error IREGS not defined
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef OTYPE
|
||||
#define OTYPE long int
|
||||
#endif
|
||||
|
||||
#define OREGS "x"
|
||||
|
||||
#define __CONCATX(a,b) __CONCAT(a,b)
|
||||
|
||||
OTYPE
|
||||
__CONCATX(__,FUNC) (x)
|
||||
ITYPE x;
|
||||
{
|
||||
OTYPE result;
|
||||
asm ( "fcvtas" "\t%" OREGS "0, %" IREGS "1"
|
||||
: "=r" (result) : "w" (x) );
|
||||
return result;
|
||||
}
|
||||
|
||||
#define weak_aliasx(a,b) weak_alias(a,b)
|
||||
weak_aliasx (__CONCATX(__,FUNC), FUNC)
|
||||
#define strong_aliasx(a,b) strong_alias(a,b)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_aliasx (__CONCATX(__,FUNC), __CONCATX(__,__CONCATX(FUNC,l)))
|
||||
weak_aliasx (__CONCATX(__,FUNC), __CONCATX(FUNC,l))
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC lroundf
|
||||
#define ITYPE float
|
||||
#define IREGS "s"
|
||||
#include <s_lround.c>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC nearbyint
|
||||
#define INSN "frinti"
|
||||
#include <s_frint.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC nearbyintf
|
||||
#define INSN "frinti"
|
||||
#include <s_frintf.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC rint
|
||||
#define INSN "frintx"
|
||||
#include <s_frint.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC rintf
|
||||
#define INSN "frintx"
|
||||
#include <s_frintf.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC round
|
||||
#define INSN "frinta"
|
||||
#include <s_frint.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC roundf
|
||||
#define INSN "frinta"
|
||||
#include <s_frintf.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC trunc
|
||||
#define INSN "frintz"
|
||||
#include <s_frint.x>
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define FUNC truncf
|
||||
#define INSN "frintz"
|
||||
#include <s_frintf.x>
|
Loading…
Reference in New Issue