:ADDPATCH fortran:
Hello world,
the attached patch fixes PR 28452. It also speeds up random number
generation for REAL(kind=4) quite nicely (by about a factor of 2.5).
I have regression-tested this on i686-pc-linux-gnu. I don't have
a system with REAL(16), nor do I have a system where FLT_RADIX is
16 (IBM/360), so I would appreciate if this was tested before
committing.
K?
Thomas
2006-07-27 Thomas Koenig <Thomas.Koenig (AT) online (DOT) de>
PR libfortran/28542
* Makefile.am: Remove normalize.c.
* aclocal.m4: Regenerate using aclocal 1.9.3.
* Makefile.in: Regenerate using automake 1.9.3.
* libgfortran.h: #include <float.h>.
Define GFC_REALDIGITS and GFC_REALRADIX.
Remove prototypes for normalize_r4_i4 and normalize_r8_i8.
* intrinsics/random.c (top level): Add prototypes for
random_r10, arandom_r10, random_r16 and arandom_r16.
(rnumber_4): New static function.
(rnumber_8): New static function.
(rnumber_10): New static function.
(rnumber_16): New static function.
(top level): Set to kiss_size to 12 if we have
REAL(KIND=16), to 8 otherwise.
Define KISS_DEFAULT_SEED_1, KISS_DEFAULT_SEED_2 and
KISS_DEFAULT_SEED_3.
(kiss_random_kernel): Take argument to differentiate
between different random number generators.
(random_r4): Add argument to call to kiss_random_kernel,
use rnumber
(random_r8): Likewise.
(random_r10): New function.
(random_r16): New function.
(arandom_r4): Add argument to call to kiss_random_kernel,
use_rnumber
(arandom_r8): Likewise.
(arandom_r10): New function.
(arandom_r16): New function.
* intrinsics/rand.c (rand): Use shift and mask.
* runtime/normalize.c: Remove.
2006-07-27 Thomas Koenig <Thomas.Koenig (AT) online (DOT) de>
PR libfortran/28542
* gfortran.dg/random_3.f90: New test.