From 94c459cc7a611211d10773eef526826a8da80456 Mon Sep 17 00:00:00 2001 From: joseph Date: Sun, 2 Dec 2012 21:11:45 +0000 Subject: Merge changes between r21775 and r21911 from /fsf/trunk. git-svn-id: svn://svn.eglibc.org/trunk@21912 7b3dc134-2b1b-0410-93df-9e9f96275f8d --- libc/ports/sysdeps/aarch64/dl-tlsdesc.S | 2 +- libc/ports/sysdeps/aarch64/dl-tlsdesc.h | 2 +- libc/ports/sysdeps/aarch64/fpu/s_ceil.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_ceilf.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_floor.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_floorf.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_fma.c | 47 +++++++++++++++++++++++- libc/ports/sysdeps/aarch64/fpu/s_fmaf.c | 22 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_fmax.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c | 23 ++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_fmin.c | 49 +++++++++++++++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_fminf.c | 22 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_frint.c | 49 +++++++++++++++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_frintf.c | 24 ++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_llrint.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_llrintf.c | 23 ++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_llround.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_llroundf.c | 23 ++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_lrint.c | 53 +++++++++++++++++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_lrintf.c | 22 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_lround.c | 51 ++++++++++++++++++++++++++ libc/ports/sysdeps/aarch64/fpu/s_lroundf.c | 22 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_rint.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_rintf.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_round.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_roundf.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_trunc.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/fpu/s_truncf.c | 21 +++++++++++ libc/ports/sysdeps/aarch64/libm-test-ulps | 45 +++++++++++++++++++++++ libc/ports/sysdeps/aarch64/tlsdesc.c | 2 +- 32 files changed, 791 insertions(+), 5 deletions(-) create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_ceil.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_ceilf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_floor.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_floorf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_fmaf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_fmax.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_fmin.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_fminf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_frint.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_frintf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_llrint.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_llrintf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_llround.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_llroundf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_lrint.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_lrintf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_lround.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_lroundf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_rint.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_rintf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_round.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_roundf.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_trunc.c create mode 100644 libc/ports/sysdeps/aarch64/fpu/s_truncf.c (limited to 'libc/ports/sysdeps/aarch64') diff --git a/libc/ports/sysdeps/aarch64/dl-tlsdesc.S b/libc/ports/sysdeps/aarch64/dl-tlsdesc.S index 0e590518f..b78a096e5 100644 --- a/libc/ports/sysdeps/aarch64/dl-tlsdesc.S +++ b/libc/ports/sysdeps/aarch64/dl-tlsdesc.S @@ -1,6 +1,6 @@ /* Thread-local storage handling in the ELF dynamic linker. AArch64 version. - Copyright (C) 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/libc/ports/sysdeps/aarch64/dl-tlsdesc.h b/libc/ports/sysdeps/aarch64/dl-tlsdesc.h index 514e4ecfb..3e2eaa0a8 100644 --- a/libc/ports/sysdeps/aarch64/dl-tlsdesc.h +++ b/libc/ports/sysdeps/aarch64/dl-tlsdesc.h @@ -1,6 +1,6 @@ /* Thread-local storage descriptor handling in the ELF dynamic linker. AArch64 version. - Copyright (C) 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/libc/ports/sysdeps/aarch64/fpu/s_ceil.c b/libc/ports/sysdeps/aarch64/fpu/s_ceil.c new file mode 100644 index 000000000..5010c4f79 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC ceil +#define INSN "frintp" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_ceilf.c b/libc/ports/sysdeps/aarch64/fpu/s_ceilf.c new file mode 100644 index 000000000..e7f47361f --- /dev/null +++ b/libc/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 + . */ + +#define FUNC ceilf +#define INSN "frintp" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_floor.c b/libc/ports/sysdeps/aarch64/fpu/s_floor.c new file mode 100644 index 000000000..26b79b447 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC floor +#define INSN "frintm" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_floorf.c b/libc/ports/sysdeps/aarch64/fpu/s_floorf.c new file mode 100644 index 000000000..1b7e01908 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC floorf +#define INSN "frintm" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fma.c b/libc/ports/sysdeps/aarch64/fpu/s_fma.c index 8f6260587..c3b2344f7 100644 --- a/libc/ports/sysdeps/aarch64/fpu/s_fma.c +++ b/libc/ports/sysdeps/aarch64/fpu/s_fma.c @@ -1,2 +1,45 @@ -/* Always use dbl-64 version because long double is emulated in software. */ -#include +/* 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 + . */ + +#include + +#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) (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; +} + +weak_alias (__CONCATX(__,FUNC), FUNC) diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmaf.c b/libc/ports/sysdeps/aarch64/fpu/s_fmaf.c new file mode 100644 index 000000000..016d7bd64 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC fmaf +#define TYPE float +#define REGS "s" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmax.c b/libc/ports/sysdeps/aarch64/fpu/s_fmax.c new file mode 100644 index 000000000..40804cc46 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC fmax +#define INSN "fmaxnm" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c b/libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c new file mode 100644 index 000000000..ed282bbda --- /dev/null +++ b/libc/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 + . */ + +#define FUNC fmaxf +#define INSN "fmaxnm" +#define TYPE float +#define REGS "s" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmin.c b/libc/ports/sysdeps/aarch64/fpu/s_fmin.c new file mode 100644 index 000000000..49ff9b365 --- /dev/null +++ b/libc/ports/sysdeps/aarch64/fpu/s_fmin.c @@ -0,0 +1,49 @@ +/* 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 + . */ + +#include + +#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) (TYPE x, TYPE y) +{ + TYPE result; + asm ( INSN "\t%" REGS "0, %" REGS "1, %" REGS "2" + : "=w" (result) : "w" (x), "w" (y) ); + return result; +} + +weak_alias (__CONCATX(__,FUNC), FUNC) diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fminf.c b/libc/ports/sysdeps/aarch64/fpu/s_fminf.c new file mode 100644 index 000000000..18b6ac026 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC fminf +#define TYPE float +#define REGS "s" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_frint.c b/libc/ports/sysdeps/aarch64/fpu/s_frint.c new file mode 100644 index 000000000..69d9e2233 --- /dev/null +++ b/libc/ports/sysdeps/aarch64/fpu/s_frint.c @@ -0,0 +1,49 @@ +/* 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 + . */ + +#include + +#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) (TYPE x) +{ + TYPE result; + asm ( INSN "\t%" REGS "0, %" REGS "1" : + "=w" (result) : "w" (x) ); + return result; +} + +weak_alias (__CONCATX(__,FUNC), FUNC) diff --git a/libc/ports/sysdeps/aarch64/fpu/s_frintf.c b/libc/ports/sysdeps/aarch64/fpu/s_frintf.c new file mode 100644 index 000000000..8d24dda83 --- /dev/null +++ b/libc/ports/sysdeps/aarch64/fpu/s_frintf.c @@ -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 + . */ + +#ifndef FUNC +# error FUNC not defined +#endif +#define TYPE float +#define REGS "s" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llrint.c b/libc/ports/sysdeps/aarch64/fpu/s_llrint.c new file mode 100644 index 000000000..e46630381 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC llrint +#define OTYPE long long int +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llrintf.c b/libc/ports/sysdeps/aarch64/fpu/s_llrintf.c new file mode 100644 index 000000000..352dc519d --- /dev/null +++ b/libc/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 + . */ + +#define FUNC llrintf +#define ITYPE float +#define IREGS "s" +#define OTYPE long long int +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llround.c b/libc/ports/sysdeps/aarch64/fpu/s_llround.c new file mode 100644 index 000000000..6aa365b68 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC llround +#define OTYPE long long int +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llroundf.c b/libc/ports/sysdeps/aarch64/fpu/s_llroundf.c new file mode 100644 index 000000000..98cf77e00 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC llroundf +#define ITYPE float +#define IREGS "s" +#define OTYPE long long int +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lrint.c b/libc/ports/sysdeps/aarch64/fpu/s_lrint.c new file mode 100644 index 000000000..ca26e09f9 --- /dev/null +++ b/libc/ports/sysdeps/aarch64/fpu/s_lrint.c @@ -0,0 +1,53 @@ +/* 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 + . */ + +#include + +#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) (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; +} + +weak_alias (__CONCATX(__,FUNC), FUNC) diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lrintf.c b/libc/ports/sysdeps/aarch64/fpu/s_lrintf.c new file mode 100644 index 000000000..ff44650d7 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC lrintf +#define ITYPE float +#define IREGS "s" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lround.c b/libc/ports/sysdeps/aarch64/fpu/s_lround.c new file mode 100644 index 000000000..83748ae39 --- /dev/null +++ b/libc/ports/sysdeps/aarch64/fpu/s_lround.c @@ -0,0 +1,51 @@ +/* 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 + . */ + +#include + +#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) (ITYPE x) +{ + OTYPE result; + asm ( "fcvtas" "\t%" OREGS "0, %" IREGS "1" + : "=r" (result) : "w" (x) ); + return result; +} + +weak_alias (__CONCATX(__,FUNC), FUNC) diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lroundf.c b/libc/ports/sysdeps/aarch64/fpu/s_lroundf.c new file mode 100644 index 000000000..eb553198c --- /dev/null +++ b/libc/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 + . */ + +#define FUNC lroundf +#define ITYPE float +#define IREGS "s" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c b/libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c new file mode 100644 index 000000000..69eeccf30 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC nearbyint +#define INSN "frinti" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c b/libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c new file mode 100644 index 000000000..19b26601a --- /dev/null +++ b/libc/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 + . */ + +#define FUNC nearbyintf +#define INSN "frinti" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_rint.c b/libc/ports/sysdeps/aarch64/fpu/s_rint.c new file mode 100644 index 000000000..fad38d4fb --- /dev/null +++ b/libc/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 + . */ + +#define FUNC rint +#define INSN "frintx" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_rintf.c b/libc/ports/sysdeps/aarch64/fpu/s_rintf.c new file mode 100644 index 000000000..54353b802 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC rintf +#define INSN "frintx" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_round.c b/libc/ports/sysdeps/aarch64/fpu/s_round.c new file mode 100644 index 000000000..a566798ec --- /dev/null +++ b/libc/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 + . */ + +#define FUNC round +#define INSN "frinta" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_roundf.c b/libc/ports/sysdeps/aarch64/fpu/s_roundf.c new file mode 100644 index 000000000..4684206e1 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC roundf +#define INSN "frinta" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_trunc.c b/libc/ports/sysdeps/aarch64/fpu/s_trunc.c new file mode 100644 index 000000000..767cb9fb2 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC trunc +#define INSN "frintz" +#include diff --git a/libc/ports/sysdeps/aarch64/fpu/s_truncf.c b/libc/ports/sysdeps/aarch64/fpu/s_truncf.c new file mode 100644 index 000000000..1c952f7f8 --- /dev/null +++ b/libc/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 + . */ + +#define FUNC truncf +#define INSN "frintz" +#include diff --git a/libc/ports/sysdeps/aarch64/libm-test-ulps b/libc/ports/sysdeps/aarch64/libm-test-ulps index df308e87d..68e705ae1 100644 --- a/libc/ports/sysdeps/aarch64/libm-test-ulps +++ b/libc/ports/sysdeps/aarch64/libm-test-ulps @@ -102,6 +102,9 @@ float: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "atan2 (-max_value, -min_value) == -pi/2": +float: 1 +ifloat: 1 Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025": float: 1 ifloat: 1 @@ -2796,6 +2799,40 @@ double: 1 idouble: 1 ildouble: 1 ldouble: 1 +Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098": +ildouble: 1 +ldouble: 1 +Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160": +double: 1 +idouble: 1 +Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1": +double: 1 +idouble: 1 Test "y0 (1.0) == 0.0882569642156769579829267660235151628": double: 2 float: 1 @@ -2837,6 +2874,14 @@ ldouble: 1 Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16": double: 1 idouble: 1 +Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "y1 (0x1p-30) == -6.8356527557643159612937462812258975438856e+08": +ildouble: 1 +ldouble: 1 Test "y1 (1.5) == -0.412308626973911295952829820633445323": float: 1 ifloat: 1 diff --git a/libc/ports/sysdeps/aarch64/tlsdesc.c b/libc/ports/sysdeps/aarch64/tlsdesc.c index 4190c48df..606ce797c 100644 --- a/libc/ports/sysdeps/aarch64/tlsdesc.c +++ b/libc/ports/sysdeps/aarch64/tlsdesc.c @@ -1,6 +1,6 @@ /* Manage TLS descriptors. AArch64 version. - Copyright (C) 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. -- cgit v1.2.3