This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 04/28] powerpc: ceil/ceilf refactor


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]