[Bug libfortran/28452] __gfortran_random_r10 not found

2006-08-26 Thread tkoenig at gcc dot gnu dot org


--- Comment #9 from tkoenig at gcc dot gnu dot org  2006-08-26 19:17 ---
Subject: Bug 28452

Author: tkoenig
Date: Sat Aug 26 19:17:35 2006
New Revision: 116476

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=116476
Log:
2006-08-26  Thomas Koenig  [EMAIL PROTECTED]

PR libfortran/28542
* Makefile.am:  Remove normalize.c.
* aclocal.m4:  Regenerate.
* Makefile.in:  Regenerate.
* libgfortran.h:  #include float.h.
Define GFC_REAL_*_DIGITS and GFC_REAL_*_RADIX.
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-08-28  Thomas Koenig  [EMAIL PROTECTED]

PR libfortran/28452
* gfortran.dg/random_3.f90:  New test.


Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/random_3.f90
Removed:
branches/gcc-4_1-branch/libgfortran/runtime/normalize.c
Modified:
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
branches/gcc-4_1-branch/libgfortran/ChangeLog
branches/gcc-4_1-branch/libgfortran/Makefile.am
branches/gcc-4_1-branch/libgfortran/Makefile.in
branches/gcc-4_1-branch/libgfortran/intrinsics/rand.c
branches/gcc-4_1-branch/libgfortran/intrinsics/random.c
branches/gcc-4_1-branch/libgfortran/libgfortran.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-08-26 Thread tkoenig at gcc dot gnu dot org


--- Comment #10 from tkoenig at gcc dot gnu dot org  2006-08-26 19:18 
---
Fixed on 4.1 as well.

Closing.


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-08-01 Thread tkoenig at gcc dot gnu dot org


--- Comment #8 from tkoenig at gcc dot gnu dot org  2006-08-01 17:30 ---
Subject: Bug 28452

Author: tkoenig
Date: Tue Aug  1 17:29:50 2006
New Revision: 115859

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=115859
Log:
2006-08-01  Thomas Koenig  [EMAIL PROTECTED]

PR libfortran/28452
* libgfortran/ChangeLog:  Correct PR number.
* gcc/testsuite/ChangeLog:  Likewise.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/libgfortran/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-07-26 Thread tkoenig at gcc dot gnu dot org


--- Comment #7 from tkoenig at gcc dot gnu dot org  2006-07-26 19:49 ---
Created an attachment (id=11951)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11951action=view)
Current status of patch

Here's the current patch.  It regtests fine, and
seems to do the Right Thing.

I haven't been able to test it on a system with REAL(16), nor on
an S/360 where FLT_RADIX == 16.


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

  Attachment #11929|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-07-24 Thread tkoenig at gcc dot gnu dot org


--- Comment #5 from tkoenig at gcc dot gnu dot org  2006-07-24 20:12 ---
(In reply to comment #4)

 Don't you need a HAVE_GFC_REAL_16 section or is random_r10 used
 for random_r16?

Oops, I uploaded the wrong patch.  Sorry 'bout that.

However, I still need to think a bit about what constant to multiply
with.  What I currently have could also return 1.


 
 Also, I noticed that you've eliminated the normalize_* calls.
 I think may actually be able to remove these functions and
 the file that contains them.

Correct.  I would also have to remove the call to normalize_* from
rand.c.

Looks like a bit more work to be done.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-07-24 Thread tkoenig at gcc dot gnu dot org


--- Comment #6 from tkoenig at gcc dot gnu dot org  2006-07-24 20:23 ---
Created an attachment (id=11929)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11929action=view)
current status of patch

This is the current status of the patch.  As I wrote,
this isn't yet complete.

Thomas


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

  Attachment #11926|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-07-23 Thread tkoenig at gcc dot gnu dot org


--- Comment #1 from tkoenig at gcc dot gnu dot org  2006-07-23 17:14 ---
I'll take a look at this.

See http://gcc.gnu.org/ml/fortran/2006-07/msg00311.html and
follow-ups for the discussion of this bug.


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu dot
   ||org
   Keywords||wrong-code
  Known to fail||4.2.0 4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-07-23 Thread tkoenig at gcc dot gnu dot org


--- Comment #2 from tkoenig at gcc dot gnu dot org  2006-07-23 17:23 ---
While I work on this, I might as well tackle some other issues.

Before I start work, some timings with a vanilla tree as of today.
The timing isn't terrible (within a factor of two with Intel 8.1),
but of course, I don't know Intel's quality of RNG.

$ cat random-single.f90
program main
  real, dimension(10**7) :: a
  call random_number(a)
end program main
$ gfortran random-single.f90
$ ./a.out  time ./a.out

real0m0.765s
user0m0.730s
sys 0m0.036s
$ ifort random-single.f90
$ ./a.out  time ./a.out

real0m0.362s
user0m0.313s
sys 0m0.049s

$ cat random-double.f90
program main
  real(kind=8), dimension(10**7) :: a
  call random_number(a)
end program main
$ gfortran random-double.f90
$ ./a.out  time ./a.out

real0m0.886s
user0m0.804s
sys 0m0.077s
$ ifort random-double.f90
$ ./a.out  time ./a.out

real0m0.402s
user0m0.328s
sys 0m0.074s


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |tkoenig at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-07-23 Thread tkoenig at gcc dot gnu dot org


--- Comment #3 from tkoenig at gcc dot gnu dot org  2006-07-23 21:14 ---
Created an attachment (id=11926)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11926action=view)
patch

This implements random for KIND=10 and KIND=16 REALs.  It
is regression-tested on i686-pc-linux-gnu, but not on a system
with KIND=16 REALs.

It also speeds up the random numbers for the real case:

$ gfortran random-single.f90
$ ./a.out  time ./a.out

real0m0.300s
user0m0.266s
sys 0m0.034s

(same program as before).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452



[Bug libfortran/28452] __gfortran_random_r10 not found

2006-07-23 Thread kargl at gcc dot gnu dot org


--- Comment #4 from kargl at gcc dot gnu dot org  2006-07-23 23:32 ---
Thomas,

Don't you need a HAVE_GFC_REAL_16 section or is random_r10 used
for random_r16?

Also, I noticed that you've eliminated the normalize_* calls.
I think may actually be able to remove these functions and
the file that contains them.


-- 

kargl at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28452