This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 04/28] powerpc: ceil/ceilf refactor
- From: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Sat, 4 May 2019 18:46:26 -0300
- Subject: Re: [PATCH 04/28] powerpc: ceil/ceilf refactor
- References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> <20190329133529.22523-5-adhemerval.zanella@linaro.org> <20190425015655.c2wckfwowa4xboc4@tereshkova> <83c7cdd1-0042-fa33-36f4-93d732fedba0@linaro.org> <20190502184136.2d7xcc44zvcn5imo@tereshkova.br.ibm.com>
Hi, Adhemerval,
During the review of the patch for trunc{,f}, I noticed something that
affects this patch, as well as the patches for floor and round.
Before the changes, the POWER5+ version of the float functions perform a
round to float (via a frsp instruction), because this is explicit in the
assembly code, for instance:
> -ENTRY_TOCLESS (__ceilf, 4)
> - CALL_MCOUNT 0
> - frip fp1, fp1 /* The rounding instructions are double. */
> - frsp fp1, fp1 /* But we need to set ooverflow for float. */
> - blr
> - END (__ceilf)
When this assembly function gets replaced with the builtin, the
generated code does not perform the round to float and will not set
ooverflow (as mentioned in the comment above).
$ objdump -d math/libm.so.6 | grep -E "<ceilf>:" -A 3
0000000000060690 <ceilf>:
60690: 90 0b 20 fc frip f1,f1
60694: 20 00 80 4e blr
...
I still don't know it that is actually a problem. Do you know? I'm
sorry that I didn't notice this before.