Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Uncle George <gatgul@voicenet.com>
Subject: Re: Severe errors with fscanf/sscanf (RH 4.2/5.0)
Date: Wed, 11 Feb 1998 12:46:44 -0500	[thread overview]
Message-ID: <3fb5e94bfceb3560c0f6d9cb97adb502.axp-list@archive.invalid> (raw)

it seems that one cannot shift more that 63 bits with a right shift on the
alpha. Anyone trying to shift 64 or more bits will result in a no-op,
rather than clearing out the whole register. The contents of that register
appears to be untouched.

This is a problem for programs like lshift.s (
libc.works/sysdeps/alpha/lshift.s ) or the more generic lshift.c (
libc.works/sysdeps/generic/lshift.c ), which when a shift count ( cnt ) of
zero,  tries first to do a left shift of 0 bits, but then also a right
shift of 64-0 bits ( a no-op on the alpha, other machines would have
shifted out all the bits in the register ). This hardware feature in
essence trashes the premise behind the lshift subroutine.

in the example of stephan illy, the mantissa get fully filled up , and
strtod_internal()  deceides to shift 0 bits. needless to say the mantissa
gets messed up.

FIX:
 i dunno, do all the >> and << have to be checked in GLIB et al, to see if
a zero is wanted out of the shift operation? ouch!

Uncle George wrote:

> yup,

> Stefan Illy wrote:
>
> > I encountered a serious problem on our two Linux-based Alphas:
> >
> > Both fscanf and sscanf produce errors when reading small
> > floating point numbers (type double, exponent approx. -70) from
> > files or strings. It happens only for a fraction of possible
> > numbers (something in the range of 0.1 to 1 %, I don't know exactly).

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1998-02-11 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-11 17:46 Uncle George [this message]
     [not found] <34E23533.2929FAC3@voicenet.com>
1998-02-11 23:52 ` Severe errors with fscanf/sscanf (RH 4.2/5.0) Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
1998-02-11 23:33 Uncle George
     [not found] <34E1E403.8E292D6E@voicenet.com>
1998-02-11 19:26 ` Richard Henderson
1998-02-10 19:22 Richard Henderson
1998-02-10 13:31 Uncle George
1998-02-10  8:38 Stefan Illy
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox