From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3fb5e94bfceb3560c0f6d9cb97adb502.axp-list@archive.invalid> X-Archive-Original-Message-ID: <980211154552.ZM17254@dixtat.hmi.de> Date: Wed, 11 Feb 1998 12:46:44 -0500 From: Uncle George Subject: Re: Severe errors with fscanf/sscanf (RH 4.2/5.0) 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