This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
re: ARGH. Who wrote intrinsic_set_exponent.f90?
- From: Feng Wang <wf_cs at yahoo dot com>
- To: fortran at gcc dot gnu dot org, Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Date: Mon, 28 Aug 2006 22:33:29 +0800 (CST)
- Subject: re: ARGH. Who wrote intrinsic_set_exponent.f90?
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=6CF6NbUXMKWqFSlcBRUx1U4KLi7PzLiilStqDAHnirlQyxv6fY6ACFySU0fm1xGpKsIfms1vWIrhvrFGnoNteFcoiotwnAni6CVSIc6xCOFZmI3vsudVoJ9BSCIPizHdIP8J9fe0agm9MdEW0ChSdjxYhizfEZ143JeE6aJzSQI= ;
Steve,
> Who wrote this test?
One member of our group (CCRG) wrote this.
> It is using nonconforming code, and
> gfortran's handling of BOZ constants does not do what
> you think.
Could you explain more about "nonconforming"? I tested it on i686, ia64
platform and gfortran works well with it. And from
http://gcc.gnu.org/ml/gcc-testresults/2006-08/msg01238.html I don't see it
failed on ppc.
> Here's a excerpt of the brokeness.
> subroutine test_real4()
> real x,y
> integer i,n
> equivalence(x,i)
> n = 128
> i = o'00037777777' ! <-- This doesn't do what you think.
> y = set_exponent (x, n) ! <-- This is nonconforming.
> if (exponent (y) .ne. n) call abort()
> end subroutine
In the test, we want to build an IEEE-754 denormalized floating-point number
with its exponent -127. i shared the same memory with x. We assign
o'00037777777' to i. Then x's sign field is 0 (bit 31), exponent bits are all 0
(bit 30-23) and significand bits are all 1 (bit 22-0).
It tests if set_exponent handles denormalized floating-point correctly.
Feng Wang
___________________________________________________________
Mp3疯狂搜-新歌热歌高速下
http://music.yahoo.com.cn/?source=mail_mailbox_footer