This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC patch] Add support for snan/qnan/nan/inf for VAX
- From: Nick Clifton <nickc at redhat dot com>
- To: matt at 3am-software dot com
- Cc: binutils at sourceware dot org
- Date: Thu, 09 Apr 2009 15:11:17 +0100
- Subject: Re: [RFC patch] Add support for snan/qnan/nan/inf for VAX
Hi Matt,
> properly dealt with. Anyone have a problem with the atof-generic.c
> changes?
Nope, although...
> switch (first_digit[0])
> {
> + case 's':
> + case 'S':
> + if (!strncasecmp ("snan", first_digit, 4))
> + {
> + address_of_generic_floating_point_number->sign = 0;
> + address_of_generic_floating_point_number->exponent = 0;
> + address_of_generic_floating_point_number->leader =
> + address_of_generic_floating_point_number->low;
> + *address_of_string_pointer = first_digit + 4;
> + return 0;
> + }
> + break;
> +
> + case 'q':
> + case 'Q':
> + if (!strncasecmp ("qnan", first_digit, 4))
> + {
> + address_of_generic_floating_point_number->sign = 0;
> + address_of_generic_floating_point_number->exponent = 0;
> + address_of_generic_floating_point_number->leader =
> + address_of_generic_floating_point_number->low;
> + *address_of_string_pointer = first_digit + 4;
> + return 0;
> + }
> + break;
Could be more efficiently coded as:
> switch (first_digit[0])
> {
> + case 's':
> + case 'S':
> + case 'q':
> + case 'Q':
> + if (!strncasecmp ("nan", first_digit + 1, 3))
> + {
> + address_of_generic_floating_point_number->sign = 0;
> + address_of_generic_floating_point_number->exponent = 0;
> + address_of_generic_floating_point_number->leader =
> + address_of_generic_floating_point_number->low;
> + *address_of_string_pointer = first_digit + 4;
> + return 0;
> + }
> + break;
> 2009-04-01 Matt Thomas <matt@netbsd.org>
>
> * atof-generic.c (atof_generic): recognize snan and qnan in
> addition to nan and inf.
> * atof-vax.c (flonum_gen2vax): deal properly with nan, snan, qnan,
> and +Inf and -Inf codes.
Approved - please apply.
Cheers
Nick