This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [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


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