This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, libgfortran] PR48552/48925 Invalid spaces in complex/code cleanup
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>
- Date: Thu, 23 Jun 2016 09:00:05 -0700
- Subject: Re: [patch, libgfortran] PR48552/48925 Invalid spaces in complex/code cleanup
- Authentication-results: sourceware.org; auth=none
- References: <fbca2d40-cc90-7d65-f44c-6c95ba292c31 at charter dot net> <47383743-d720-e83d-1c8a-7755a13e47ab at charter dot net> <CAO9iq9E0Cu0FYMr=goO4Z8gZ4y38YQPyPFyUtyG5ZG5Gw2ehkw at mail dot gmail dot com>
On 06/22/2016 11:31 PM, Janne Blomqvist wrote:
> On Tue, Jun 21, 2016 at 10:32 PM, Jerry DeLisle <jvdelisle@charter.net> wrote:
>> Ping
>>
>> On 06/18/2016 12:23 PM, Jerry DeLisle wrote:
>>> Greetings all,
>>>
>>> This is a major rework of floating point write routines. Most of the existing
>>> critical code is retained. Much of the code is reorganized.
>>>
>>> The problem with complex is that it is writing two floats with formatting.
>>> Previously write_block, which does the actual output, was buried at the bottom
>>> of all the functions. We do not know how wide the significant result is until
>>> that point. These means we had no way to calculate how many blanks to transmit
>>> first to right justify until we already sent the digits.
>>>
>>> This patch modifies this by 1) moving the buffer creations up to the higher
>>> routines, 2) formatting a string, 3) getting the final lengths, and 4)
>>> calculating the leading blanks needed. Once this is determined, the complex
>>> value can sent out correctly.
>>>
>>> Several helper functions are created. The most significant is probably
>>> write_float_string. It takes a simple string from all the other lower level
>>> routines, and uses write_block. All the previous kind=4 character internal unit
>>> code spread throughout the previous output_float routines is now done with about
>>> 5 lines of code.
>>>
>>> Regression tested on x86_64. Test cases modified for the new format of default
>>> complex.
>>> (changelog for test cases will be done of course)
>>>
>>> OK for trunk?
>
> Ok. Good job!
>
Thanks much for review!
Committed r237735
Best regards,
Jerry