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] [powerpc] get_rounding_mode: utilize faster method to get rounding mode


Paul Clarke <pc@us.ibm.com> writes:

> On 6/6/19 9:17 AM, Tulio Magno Quites Machado Filho wrote:
>> "Paul A. Clarke" <pc@us.ibm.com> writes:

>>> diff --git a/sysdeps/powerpc/powerpc64/get-rounding-mode.h b/sysdeps/powerpc/powerpc64/get-rounding-mode.h
>>> new file mode 100644
>>> index 0000000..e2fdbbb
>>> --- /dev/null
>>> +++ b/sysdeps/powerpc/powerpc64/get-rounding-mode.h
>>> @@ -0,0 +1,33 @@
>>> +/* Determine floating-point rounding mode within libc.  powerpc64 version.
> <snip>
>>> +static inline int
>>> +get_rounding_mode (void)
>>> +{
>>> +  return _FPU_GET_RC ();
>>> +}
>>> +
>>> +#endif /* get-rounding-mode.h */
>> 
>> I don't understand why this file/function is needed.
>> Looks like another file that should be removed from this patch.
>
> Without this file, the generic file is used, which calls _FPU_GETCW(), which is used generically to get the entire floating point status control register (FPSCR) and must resolve to using the slower "mffs".  get_rounding_mode() only needs the rounding mode, and the new-in-this-patch _FPU_GET_RC() used by this new file resolves to the faster "mffsl" (if compiled for POWER9).

Very good point.  I had missed this.

In that case, I think you should move this file to
sysdeps/powerpc/fpu/get-rounding-mode.h allowing 32-bits builds to use it
and restricting its usage to fpu.

-- 
Tulio Magno


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