This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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, libgfortran] PR48552/48925 Invalid spaces in complex/code cleanup


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


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