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 v2 6/6] [powerpc] Rename fegetenv_status to fegetenv_control


On 9/23/19 11:21 AM, Paul E Murphy wrote:
> On 9/19/19 1:46 PM, Paul A. Clarke wrote:
>> fegetenv_status is used variously to retrieve the FPSCR exception enable
>> bits, rounding mode bits, or both.  These are referred to as the control
>> bits in the POWER ISA.  FPSCR status bits are also returned by the
>> 'mffs' and 'mffsl' instructions, but they are uniformly ignored by all
>> uses of fegetenv_status.  Change the name to be reflective of its
>> current and expected use.
>>
>> 2019-09-19  Paul A. Clarke  <pc@us.ibm.com>
>>
>>     * sysdeps/powerpc/fpu/fenv_libc.h (fegetenv_status): Rename to
>>     fegetenv_control.
>>     * sysdeps/powerpc/fpu/fedisblxcpt.c (fedisableexcept): Accommodate
>>     rename of fegetenv_status to fegetenv_control.
>>     * sysdeps/powerpc/fpu/feenablxcpt.c (feenableexcept): Likewise.
>>     * sysdeps/powerpc/fpu/fegetexcept.c (__fegetexcept): Likewise.
>>     * sysdeps/powerpc/fpu/fegetmode.c (fegetmode): Likewise.
>>     * sysdeps/powerpc/fpu/fesetenv.c (__fesetenv): Likewise.
>>     * sysdeps/powerpc/fpu/fesetmode.c (fesetmode): Likewise.
>> ---
>> v2: This is a new patch in the series.
> 
> OK.

Thanks!

> Reviewed-By: Paul E Murphy <murphyp@linux.ibm.com>
> 
>> diff --git a/sysdeps/powerpc/fpu/fegetmode.c b/sysdeps/powerpc/fpu/fegetmode.c
>> index 0e0a01c..65c5ebe 100644
>> --- a/sysdeps/powerpc/fpu/fegetmode.c
>> +++ b/sysdeps/powerpc/fpu/fegetmode.c
>> @@ -21,6 +21,6 @@
>>   int
>>   fegetmode (femode_t *modep)
>>   {
>> -  *modep = fegetenv_status ();
>> +  *modep = fegetenv_control ();
>>     return 0;
>>   }
> 
> Slightly off-topic, is fegetmode documented?

Again, not an expert here, but "git blame math/fegetmode.c" shows this:
--
commit ec94343f592df68ba1ba49bb2c558f7d2629387c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Sep 7 16:40:09 2016 +0000

    Add femode_t functions.
    
    TS 18661-1 defines a type femode_t to represent the set of dynamic
    floating-point control modes (such as the rounding mode and trap
    enablement modes), and functions fegetmode and fesetmode to manipulate
    those modes (without affecting other state such as the raised
    exception flags) and a corresponding macro FE_DFL_MODE.
[...]
--

PC


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