This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv3 02/11] Refactor type specific macros using regexes
- From: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 27 May 2016 10:09:45 -0500
- Subject: Re: [PATCHv3 02/11] Refactor type specific macros using regexes
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1464297421 dot git dot murphyp at linux dot vnet dot ibm dot com> <c3643bf7efdbda7125e086ff7da4503843fd0851 dot 1464297421 dot git dot murphyp at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1605262256270 dot 6600 at digraph dot polyomino dot org dot uk>
Committed as de62889.
On 05/26/2016 05:56 PM, Joseph Myers wrote:
> On Thu, 26 May 2016, Paul E. Murphy wrote:
>
>> Replace most of the type specific macros with the equivalent
>> type-generic macro using the following sed replacement command below:
>>
>> sed -ri -e 's/defined TEST_FLOAT/TEST_COND_binary32/' \
>> -e 's/ndef TEST_FLOAT/ !TEST_COND_binary32/' \
>> -e 's/def TEST_FLOAT/ TEST_COND_binary32/' \
>> -e 's/defined TEST_DOUBLE/TEST_COND_binary64/'\
>> -e 's/ndef TEST_DOUBLE/ !TEST_COND_binary64/' \
>> -e 's/def TEST_DOUBLE/ TEST_COND_binary64/' \
>> -e 's/defined TEST_LDOUBLE && //' \
>> -e 's/ifdef TEST_LDOUBLE/if MANT_DIG >= 64/' \
>> -e 's/defined TEST_LDOUBLE/MANT_DIG >= 64/' \
>> -e '/nexttoward_test_data\[\]/,/ };/!s/LDBL_(MIN_EXP|MAX_EXP|MANT_DIG)/\1/g' \
>> libm-test.inc
>>
>> With a little extra manual cleanup to simplify the following case:
>>
>> #if MANT_DIG >= 64
>> # if MANT_DIG >= 64
>> ...
>> # endif
>> ...
>>
>> Note, TEST_LDOUBLE checks are replaced by MANT_DIG >= 64 excepting
>> where another property of the type is being tested. And, the final
>> regex is intended to avoid replacing LDBL_ macro usage within the
>> nexttoward tests which explicitly take argument 2 as long double.
>
> OK.
>