From 42747c841a2a4c6c269f59c6c7d688a82a64a4b4 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 9 Apr 2013 14:23:36 -0500 Subject: PowerPC: llround/llroundf multilib for PowerPC32 --- sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile | 6 +- .../powerpc/powerpc32/fpu/multiarch/s_llround-c.c | 3 + .../powerpc32/fpu/multiarch/s_llround-power4.S | 96 ++++++++++++++++++ .../powerpc32/fpu/multiarch/s_llround-power5+.S | 46 +++++++++ .../powerpc32/fpu/multiarch/s_llround-power6.S | 46 +++++++++ .../powerpc/powerpc32/fpu/multiarch/s_llround.c | 58 +++++++++++ .../powerpc32/fpu/multiarch/s_llroundf-power4.S | 1 + .../powerpc32/fpu/multiarch/s_llroundf-power5+.S | 1 + .../powerpc32/fpu/multiarch/s_llroundf-power6.S | 1 + .../powerpc/powerpc32/fpu/multiarch/s_llroundf.c | 1 + sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S | 108 --------------------- sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S | 1 - sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S | 59 ----------- sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S | 1 - sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S | 59 ----------- sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S | 1 - 16 files changed, 258 insertions(+), 230 deletions(-) create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-c.c create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power4.S create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power5+.S create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power6.S create mode 100644 sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S delete mode 100644 sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S delete mode 100644 sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S delete mode 100644 sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S delete mode 100644 sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile index 4c63e5d..b877357 100644 --- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile @@ -1,4 +1,8 @@ ifeq ($(subdir),math) libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \ - s_llrint-power6 s_llrint-power4 s_llrint-c + s_llrint-power6 s_llrint-power4 s_llrint-c \ + s_llround-power6 s_llround-power5+ s_llround-power4 \ + s_llround-c + +CFLAGS-s_llround.c = -fno-builtin-llroundf endif diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-c.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-c.c new file mode 100644 index 0000000..a3acf44 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-c.c @@ -0,0 +1,3 @@ +#undef __llround +#define __llround __llround_ppc32 +#include diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S new file mode 100644 index 0000000..d99a7e2 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S @@ -0,0 +1,96 @@ +/* llround function. PowerPC32 on PowerPC64 version. + Copyright (C) 2004-2013 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 +#include + + .section .rodata.cst12,"aM",@progbits,12 + .align 3 + .LC0: /* 0x1.0000000000000p+52 == 2^52 */ + .long 0x43300000 + .long 0x00000000 + .long 0x3f000000 /* Use this for 0.5 */ + + .section ".text" + +/* long [r3] lround (float x [fp1]) + IEEE 1003.1 lround function. IEEE specifies "round to the nearest + integer value, rounding halfway cases away from zero, regardless of + the current rounding mode." However PowerPC Architecture defines + "round to Nearest" as "Choose the best approximation. In case of a + tie, choose the one that is even (least significant bit o).". + So we can't use the PowerPC "round to Nearest" mode. Instead we set + "round toward Zero" mode and round by adding +-0.5 before rounding + to the integer value. + + It is necessary to detect when x is (+-)0x1.fffffffffffffp-2 + because adding +-0.5 in this case will cause an erroneous shift, + carry and round. We simply return 0 if 0.5 > x > -0.5. Likewise + if x is and odd number between +-(2^52 and 2^53-1) a shift and + carry will erroneously round if biased with +-0.5. Therefore if x + is greater/less than +-2^52 we don't need to bias the number with + +-0.5. */ + + .machine power4 +ENTRY (__llround_power4) + stwu r1,-16(r1) + cfi_adjust_cfa_offset (16) +#ifdef SHARED + mflr r11 + cfi_register(lr,r11) + SETUP_GOT_ACCESS(r9,got_label) + addis r9,r9,.LC0-got_label@ha + addi r9,r9,.LC0-got_label@l + mtlr r11 + cfi_same_value (lr) + lfd fp9,0(r9) + lfs fp10,8(r9) +#else + lis r9,.LC0@ha + lfd fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */ + lfs fp10,.LC0@l+8(r9) /* Load 0.5 into fpr10. */ +#endif + fabs fp2,fp1 /* Get the absolute value of x. */ + fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */ + fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */ + fcmpu cr7,fp2,fp9 /* if |x| >= 2^52 */ + fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */ + blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */ + bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */ + fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */ + bge cr1,.Lconvert /* x is positive so don't negate x. */ + fnabs fp3,fp3 /* -(|x|+=0.5) */ +.Lconvert: + fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */ + stfd fp4,8(r1) + nop + nop + nop + lwz r4,12(r1) /* Load return as integer. */ + lwz r3,8(r1) +.Lout: + addi r1,r1,16 + blr +.Lretzero: /* 0.5 > x > -0.5 */ + li r3,0 /* return 0. */ + li r4,0 + b .Lout +.Lnobias: + fmr fp3,fp1 + b .Lconvert +END (__llround_power4) diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S new file mode 100644 index 0000000..6c45ed2 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S @@ -0,0 +1,46 @@ +/* lround function. POWER5+, PowerPC32 version. + Copyright (C) 2006-2013 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 +#include + +/* long [r3] llround (float x [fp1]) + IEEE 1003.1 lround function. IEEE specifies "round to the nearest + integer value, rounding halfway cases away from zero, regardless of + the current rounding mode." However PowerPC Architecture defines + "round to Nearest" as "Choose the best approximation. In case of a + tie, choose the one that is even (least significant bit o).". + So we pre-round using the V2.02 Floating Round to Integer Nearest + instruction before we use the Floating Convert to Integer Word with + round to zero instruction. */ + + .machine "power5" +ENTRY (__llround_power5) + stwu r1,-16(r1) + cfi_adjust_cfa_offset (16) + frin fp2,fp1 + fctidz fp3,fp2 /* Convert To Integer Word lround toward 0. */ + stfd fp3,8(r1) + nop /* Ensure the following load is in a different dispatch */ + nop /* group to avoid pipe stall on POWER4&5. */ + nop + lwz r4,12(r1) + lwz r3,8(r1) + addi r1,r1,16 + blr +END (__llround_power5) diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S new file mode 100644 index 0000000..da3fc14 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S @@ -0,0 +1,46 @@ +/* lround function. POWER5+, PowerPC32 version. + Copyright (C) 2006-2013 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 +#include + +/* long [r3] llround (float x [fp1]) + IEEE 1003.1 lround function. IEEE specifies "round to the nearest + integer value, rounding halfway cases away from zero, regardless of + the current rounding mode." However PowerPC Architecture defines + "round to Nearest" as "Choose the best approximation. In case of a + tie, choose the one that is even (least significant bit o).". + So we pre-round using the V2.02 Floating Round to Integer Nearest + instruction before we use the Floating Convert to Integer Word with + round to zero instruction. */ + + .machine "power6" +ENTRY (__llround_power6) + stwu r1,-16(r1) + cfi_adjust_cfa_offset (16) + frin fp2,fp1 + fctidz fp3,fp2 /* Convert To Integer Word lround toward 0. */ + stfd fp3,8(r1) +/* Insure the following load is in a different dispatch group by + inserting "group ending nop". */ + ori r1,r1,0 + lwz r4,12(r1) + lwz r3,8(r1) + addi r1,r1,16 + blr +END (__llround_power6) diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c new file mode 100644 index 0000000..6d23aab --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c @@ -0,0 +1,58 @@ +/* Multiple versions of s_llround. + Copyright (C) 2013 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 + . */ + +/* Redefine llroundf/__llroundf so that compiler won't complain abouti + the type mismatch with the IFUNC selector in strong_alias/weak_alias + below. */ +#undef llroundf +#define llroundf __redirect_llroundf +#undef __llroundf +#define __llroundf __redirec___llroundf +#include +#undef llroundf +#undef __llroundf +#include +#include +#include "init-arch.h" + +extern __typeof (__llround) __llround_ppc32 attribute_hidden; +extern __typeof (__llround) __llround_power4 attribute_hidden; +extern __typeof (__llround) __llround_power5 attribute_hidden; +extern __typeof (__llround) __llround_power6 attribute_hidden; + +libc_ifunc (__llround, + (hwcap & PPC_FEATURE_ARCH_2_05) + ? __llround_power6 : + (hwcap & PPC_FEATURE_POWER5_PLUS) + ? __llround_power5 : + (hwcap & PPC_FEATURE_POWER4) + ? __llround_power4 + : __llround_ppc32); + +weak_alias (__llround, llround) + +strong_alias (__llround, __llroundf) +weak_alias (__llround, llroundf) + +#ifdef NO_LONG_DOUBLE +strong_alias (__llround, __llroundl) +weak_alias (__llround, llroundl) +#endif +#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) +compat_symbol (libm, __llround, llroundl, GLIBC_2_1); +#endif diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power4.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power4.S new file mode 100644 index 0000000..9967130 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power4.S @@ -0,0 +1 @@ +/* __llroundf_power4 is in s_llround-power4.S */ diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power5+.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power5+.S new file mode 100644 index 0000000..51d760c --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power5+.S @@ -0,0 +1 @@ +/* __llroundf_power5+ is in s_llround-power5+.S */ diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power6.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power6.S new file mode 100644 index 0000000..adc0699 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf-power6.S @@ -0,0 +1 @@ +/* __llroundf_power6 is in s_llround-power6.S */ diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c new file mode 100644 index 0000000..3ca6e17 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c @@ -0,0 +1 @@ +/* s__llroundf.c is implemented at s_llround.c */ diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S deleted file mode 100644 index 07beb0a..0000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S +++ /dev/null @@ -1,108 +0,0 @@ -/* llround function. PowerPC32 on PowerPC64 version. - Copyright (C) 2004-2013 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 -#include - - .section .rodata.cst12,"aM",@progbits,12 - .align 3 - .LC0: /* 0x1.0000000000000p+52 == 2^52 */ - .long 0x43300000 - .long 0x00000000 - .long 0x3f000000 /* Use this for 0.5 */ - - .section ".text" - -/* long [r3] lround (float x [fp1]) - IEEE 1003.1 lround function. IEEE specifies "round to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "round to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we can't use the PowerPC "round to Nearest" mode. Instead we set - "round toward Zero" mode and round by adding +-0.5 before rounding - to the integer value. - - It is necessary to detect when x is (+-)0x1.fffffffffffffp-2 - because adding +-0.5 in this case will cause an erroneous shift, - carry and round. We simply return 0 if 0.5 > x > -0.5. Likewise - if x is and odd number between +-(2^52 and 2^53-1) a shift and - carry will erroneously round if biased with +-0.5. Therefore if x - is greater/less than +-2^52 we don't need to bias the number with - +-0.5. */ - -ENTRY (__llround) - stwu r1,-16(r1) - cfi_adjust_cfa_offset (16) -#ifdef SHARED - mflr r11 - cfi_register(lr,r11) - SETUP_GOT_ACCESS(r9,got_label) - addis r9,r9,.LC0-got_label@ha - addi r9,r9,.LC0-got_label@l - mtlr r11 - cfi_same_value (lr) - lfd fp9,0(r9) - lfs fp10,8(r9) -#else - lis r9,.LC0@ha - lfd fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */ - lfs fp10,.LC0@l+8(r9) /* Load 0.5 into fpr10. */ -#endif - fabs fp2,fp1 /* Get the absolute value of x. */ - fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */ - fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */ - fcmpu cr7,fp2,fp9 /* if |x| >= 2^52 */ - fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */ - blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */ - bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */ - fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */ - bge cr1,.Lconvert /* x is positive so don't negate x. */ - fnabs fp3,fp3 /* -(|x|+=0.5) */ -.Lconvert: - fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */ - stfd fp4,8(r1) - nop - nop - nop - lwz r4,12(r1) /* Load return as integer. */ - lwz r3,8(r1) -.Lout: - addi r1,r1,16 - blr -.Lretzero: /* 0.5 > x > -0.5 */ - li r3,0 /* return 0. */ - li r4,0 - b .Lout -.Lnobias: - fmr fp3,fp1 - b .Lconvert - END (__llround) - -weak_alias (__llround, llround) - -strong_alias (__llround, __llroundf) -weak_alias (__llround, llroundf) - -#ifdef NO_LONG_DOUBLE -weak_alias (__llround, llroundl) -strong_alias (__llround, __llroundl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __llround, llroundl, GLIBC_2_1) -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S deleted file mode 100644 index 72d6181..0000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S +++ /dev/null @@ -1 +0,0 @@ -/* __llroundf is in s_llround.S */ diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S deleted file mode 100644 index 558bd2a..0000000 --- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S +++ /dev/null @@ -1,59 +0,0 @@ -/* lround function. POWER5+, PowerPC32 version. - Copyright (C) 2006-2013 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 -#include - -/* long [r3] llround (float x [fp1]) - IEEE 1003.1 lround function. IEEE specifies "round to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "round to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we pre-round using the V2.02 Floating Round to Integer Nearest - instruction before we use the Floating Convert to Integer Word with - round to zero instruction. */ - - .machine "power5" -ENTRY (__llround) - stwu r1,-16(r1) - cfi_adjust_cfa_offset (16) - frin fp2,fp1 - fctidz fp3,fp2 /* Convert To Integer Word lround toward 0. */ - stfd fp3,8(r1) - nop /* Ensure the following load is in a different dispatch */ - nop /* group to avoid pipe stall on POWER4&5. */ - nop - lwz r4,12(r1) - lwz r3,8(r1) - addi r1,r1,16 - blr - END (__llround) - -weak_alias (__llround, llround) - -strong_alias (__llround, __llroundf) -weak_alias (__llround, llroundf) - -#ifdef NO_LONG_DOUBLE -weak_alias (__llround, llroundl) -strong_alias (__llround, __llroundl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __llround, llroundl, GLIBC_2_1) -#endif diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S deleted file mode 100644 index 030d2fd..0000000 --- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S +++ /dev/null @@ -1 +0,0 @@ -/* __llroundf is in s_llround.S */ diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S deleted file mode 100644 index bfc5efb..0000000 --- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S +++ /dev/null @@ -1,59 +0,0 @@ -/* lround function. POWER5+, PowerPC32 version. - Copyright (C) 2006-2013 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 -#include - -/* long [r3] llround (float x [fp1]) - IEEE 1003.1 lround function. IEEE specifies "round to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "round to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we pre-round using the V2.02 Floating Round to Integer Nearest - instruction before we use the Floating Convert to Integer Word with - round to zero instruction. */ - - .machine "power5" -ENTRY (__llround) - stwu r1,-16(r1) - cfi_adjust_cfa_offset (16) - frin fp2,fp1 - fctidz fp3,fp2 /* Convert To Integer Word lround toward 0. */ - stfd fp3,8(r1) -/* Insure the following load is in a different dispatch group by - inserting "group ending nop". */ - ori r1,r1,0 - lwz r4,12(r1) - lwz r3,8(r1) - addi r1,r1,16 - blr - END (__llround) - -weak_alias (__llround, llround) - -strong_alias (__llround, __llroundf) -weak_alias (__llround, llroundf) - -#ifdef NO_LONG_DOUBLE -weak_alias (__llround, llroundl) -strong_alias (__llround, __llroundl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __llround, llroundl, GLIBC_2_1) -#endif diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S deleted file mode 100644 index 030d2fd..0000000 --- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S +++ /dev/null @@ -1 +0,0 @@ -/* __llroundf is in s_llround.S */ -- cgit v1.1