diff options
Diffstat (limited to 'ports/sysdeps/aarch64/fpu')
28 files changed, 781 insertions, 2 deletions
diff --git a/ports/sysdeps/aarch64/fpu/s_ceil.c b/ports/sysdeps/aarch64/fpu/s_ceil.c new file mode 100644 index 0000000000..087b9b49e7 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_ceil.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 ceil +#define INSN "frintp" +#include <s_frint.x> diff --git a/ports/sysdeps/aarch64/fpu/s_ceilf.c b/ports/sysdeps/aarch64/fpu/s_ceilf.c new file mode 100644 index 0000000000..e503f991b3 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_ceilf.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 ceilf +#define INSN "frintp" +#include <s_frintf.x> diff --git a/ports/sysdeps/aarch64/fpu/s_floor.c b/ports/sysdeps/aarch64/fpu/s_floor.c new file mode 100644 index 0000000000..3f914b6454 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_floor.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 floor +#define INSN "frintm" +#include <s_frint.x> diff --git a/ports/sysdeps/aarch64/fpu/s_floorf.c b/ports/sysdeps/aarch64/fpu/s_floorf.c new file mode 100644 index 0000000000..f5452c5bc2 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_floorf.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 floorf +#define INSN "frintm" +#include <s_frintf.x> diff --git a/ports/sysdeps/aarch64/fpu/s_fma.c b/ports/sysdeps/aarch64/fpu/s_fma.c index 8f62605870..7d8bd77aae 100644 --- a/ports/sysdeps/aarch64/fpu/s_fma.c +++ b/ports/sysdeps/aarch64/fpu/s_fma.c @@ -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 diff --git a/ports/sysdeps/aarch64/fpu/s_fmaf.c b/ports/sysdeps/aarch64/fpu/s_fmaf.c new file mode 100644 index 0000000000..bcda67bef8 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_fmaf.c @@ -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> diff --git a/ports/sysdeps/aarch64/fpu/s_fmax.c b/ports/sysdeps/aarch64/fpu/s_fmax.c new file mode 100644 index 0000000000..6fe1ecc249 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_fmax.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> diff --git a/ports/sysdeps/aarch64/fpu/s_fmaxf.c b/ports/sysdeps/aarch64/fpu/s_fmaxf.c new file mode 100644 index 0000000000..fa2a4bd0dc --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_fmaxf.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> diff --git a/ports/sysdeps/aarch64/fpu/s_fmin.c b/ports/sysdeps/aarch64/fpu/s_fmin.c new file mode 100644 index 0000000000..3214aa80b4 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/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 diff --git a/ports/sysdeps/aarch64/fpu/s_fminf.c b/ports/sysdeps/aarch64/fpu/s_fminf.c new file mode 100644 index 0000000000..5e8b60e878 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_fminf.c @@ -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> diff --git a/ports/sysdeps/aarch64/fpu/s_frint.x b/ports/sysdeps/aarch64/fpu/s_frint.x new file mode 100644 index 0000000000..b3e21e13c1 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_frint.x @@ -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 diff --git a/ports/sysdeps/aarch64/fpu/s_frintf.x b/ports/sysdeps/aarch64/fpu/s_frintf.x new file mode 100644 index 0000000000..8ce97df880 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_frintf.x @@ -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> diff --git a/ports/sysdeps/aarch64/fpu/s_llrint.c b/ports/sysdeps/aarch64/fpu/s_llrint.c new file mode 100644 index 0000000000..6eceb6821f --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_llrint.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 llrint +#define OTYPE long long int +#include <s_lrint.c> diff --git a/ports/sysdeps/aarch64/fpu/s_llrintf.c b/ports/sysdeps/aarch64/fpu/s_llrintf.c new file mode 100644 index 0000000000..17b73a7c25 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_llrintf.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> diff --git a/ports/sysdeps/aarch64/fpu/s_llround.c b/ports/sysdeps/aarch64/fpu/s_llround.c new file mode 100644 index 0000000000..5646e00ba6 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_llround.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> diff --git a/ports/sysdeps/aarch64/fpu/s_llroundf.c b/ports/sysdeps/aarch64/fpu/s_llroundf.c new file mode 100644 index 0000000000..2555226523 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_llroundf.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> diff --git a/ports/sysdeps/aarch64/fpu/s_lrint.c b/ports/sysdeps/aarch64/fpu/s_lrint.c new file mode 100644 index 0000000000..a5ad1eaebf --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_lrint.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 diff --git a/ports/sysdeps/aarch64/fpu/s_lrintf.c b/ports/sysdeps/aarch64/fpu/s_lrintf.c new file mode 100644 index 0000000000..06eb4b7ea7 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_lrintf.c @@ -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> diff --git a/ports/sysdeps/aarch64/fpu/s_lround.c b/ports/sysdeps/aarch64/fpu/s_lround.c new file mode 100644 index 0000000000..ca68bd76b5 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_lround.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 diff --git a/ports/sysdeps/aarch64/fpu/s_lroundf.c b/ports/sysdeps/aarch64/fpu/s_lroundf.c new file mode 100644 index 0000000000..9700d3f2d7 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_lroundf.c @@ -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> diff --git a/ports/sysdeps/aarch64/fpu/s_nearbyint.c b/ports/sysdeps/aarch64/fpu/s_nearbyint.c new file mode 100644 index 0000000000..11fcd01243 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_nearbyint.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> diff --git a/ports/sysdeps/aarch64/fpu/s_nearbyintf.c b/ports/sysdeps/aarch64/fpu/s_nearbyintf.c new file mode 100644 index 0000000000..8d6af83e7c --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_nearbyintf.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 nearbyintf +#define INSN "frinti" +#include <s_frintf.x> diff --git a/ports/sysdeps/aarch64/fpu/s_rint.c b/ports/sysdeps/aarch64/fpu/s_rint.c new file mode 100644 index 0000000000..7f37f7cbe1 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_rint.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 rint +#define INSN "frintx" +#include <s_frint.x> diff --git a/ports/sysdeps/aarch64/fpu/s_rintf.c b/ports/sysdeps/aarch64/fpu/s_rintf.c new file mode 100644 index 0000000000..2d7832ab5b --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_rintf.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 rintf +#define INSN "frintx" +#include <s_frintf.x> diff --git a/ports/sysdeps/aarch64/fpu/s_round.c b/ports/sysdeps/aarch64/fpu/s_round.c new file mode 100644 index 0000000000..71ec2544b3 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_round.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 round +#define INSN "frinta" +#include <s_frint.x> diff --git a/ports/sysdeps/aarch64/fpu/s_roundf.c b/ports/sysdeps/aarch64/fpu/s_roundf.c new file mode 100644 index 0000000000..919a7529c8 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_roundf.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 roundf +#define INSN "frinta" +#include <s_frintf.x> diff --git a/ports/sysdeps/aarch64/fpu/s_trunc.c b/ports/sysdeps/aarch64/fpu/s_trunc.c new file mode 100644 index 0000000000..caf7ec13a1 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_trunc.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 trunc +#define INSN "frintz" +#include <s_frint.x> diff --git a/ports/sysdeps/aarch64/fpu/s_truncf.c b/ports/sysdeps/aarch64/fpu/s_truncf.c new file mode 100644 index 0000000000..3cbba72bf9 --- /dev/null +++ b/ports/sysdeps/aarch64/fpu/s_truncf.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 truncf +#define INSN "frintz" +#include <s_frintf.x> |