mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/69121 (IEEE_SCALB is not generic)
2018-12-21 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/69121 * ieee/ieee_arithmetic.F90: Provide missing interfaces for IEEE_SCALB. 2018-12-21 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/69121 * gfortran.dg/ieee/ieee_9.f90: New test. From-SVN: r267343
This commit is contained in:
parent
4cd3e7df0b
commit
8ab8b08a13
|
|
@ -1,3 +1,8 @@
|
||||||
|
2018-12-21 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/69121
|
||||||
|
* gfortran.dg/ieee/ieee_9.f90: New test.
|
||||||
|
|
||||||
2018-12-21 Jakub Jelinek <jakub@redhat.com>
|
2018-12-21 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR c++/86524
|
PR c++/86524
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
! { dg-do run }
|
||||||
|
program foo
|
||||||
|
use ieee_arithmetic
|
||||||
|
use iso_fortran_env
|
||||||
|
integer i, p
|
||||||
|
real x
|
||||||
|
x = 4
|
||||||
|
i = 4
|
||||||
|
|
||||||
|
if (int8 > 0) then
|
||||||
|
if (real32 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real32), int(i, int8)))
|
||||||
|
if (p /= 64) stop 1
|
||||||
|
endif
|
||||||
|
if (real64 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real64), int(i, int8)))
|
||||||
|
if (p /= 64) stop 2
|
||||||
|
endif
|
||||||
|
if (real128 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real128), int(i, int8)))
|
||||||
|
if (p /= 64) stop 3
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
if (int16 > 0) then
|
||||||
|
if (real32 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real32), int(i, int16)))
|
||||||
|
if (p /= 64) stop 4
|
||||||
|
endif
|
||||||
|
if (real64 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real64), int(i, int16)))
|
||||||
|
if (p /= 64) stop 5
|
||||||
|
endif
|
||||||
|
if (real128 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real128), int(i, int16)))
|
||||||
|
if (p /= 64) stop 6
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
if (int32 > 0) then
|
||||||
|
if (real32 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real32), int(i, int32)))
|
||||||
|
if (p /= 64) stop 7
|
||||||
|
endif
|
||||||
|
if (real64 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real64), int(i, int32)))
|
||||||
|
if (p /= 64) stop 8
|
||||||
|
endif
|
||||||
|
if (real128 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real128), int(i, int32)))
|
||||||
|
if (p /= 64) stop 9
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
if (int64 > 0) then
|
||||||
|
if (real32 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real32), int(i, int64)))
|
||||||
|
if (p /= 64) stop 10
|
||||||
|
endif
|
||||||
|
if (real64 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real64), int(i, int64)))
|
||||||
|
if (p /= 64) stop 11
|
||||||
|
endif
|
||||||
|
if (real128 > 0) then
|
||||||
|
p = int(ieee_scalb(real(x, real128), int(i, int64)))
|
||||||
|
if (p /= 64) stop 12
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
end program foo
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
|
2018-12-21 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/69121
|
||||||
|
* ieee/ieee_arithmetic.F90: Provide missing interfaces for IEEE_SCALB.
|
||||||
|
|
||||||
2018-12-20 Steven G. Kargl <kargl@gcc.gnu.org>
|
2018-12-20 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||||
|
|
||||||
* libgfortran/ieee/ieee_arithmetic.F90: Re-organize file to
|
* ieee/ieee_arithmetic.F90: Re-organize file to
|
||||||
eliminate #ifdef ... #endif. No functional change.
|
eliminate #ifdef ... #endif. No functional change.
|
||||||
|
|
||||||
2018-12-09 Thomas Koenig <tkoenig@gcc.gnu.org>
|
2018-12-09 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||||
|
|
|
||||||
|
|
@ -532,37 +532,170 @@ REM_MACRO(4,4,4)
|
||||||
! IEEE_SCALB
|
! IEEE_SCALB
|
||||||
|
|
||||||
interface
|
interface
|
||||||
elemental real(kind=4) function _gfortran_ieee_scalb_4 (X, I)
|
#ifdef HAVE_GFC_INTEGER_16
|
||||||
real(kind=4), intent(in) :: X
|
#ifdef HAVE_GFC_REAL_16
|
||||||
integer, intent(in) :: I
|
elemental real(kind=16) function _gfortran_ieee_scalb_16_16 (X, I)
|
||||||
end function
|
real(kind=16), intent(in) :: X
|
||||||
elemental real(kind=8) function _gfortran_ieee_scalb_8 (X, I)
|
integer(kind=16), intent(in) :: I
|
||||||
real(kind=8), intent(in) :: X
|
|
||||||
integer, intent(in) :: I
|
|
||||||
end function
|
|
||||||
#ifdef HAVE_GFC_REAL_10
|
|
||||||
elemental real(kind=10) function _gfortran_ieee_scalb_10 (X, I)
|
|
||||||
real(kind=10), intent(in) :: X
|
|
||||||
integer, intent(in) :: I
|
|
||||||
end function
|
end function
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
elemental real(kind=10) function _gfortran_ieee_scalb_10_16 (X, I)
|
||||||
|
real(kind=10), intent(in) :: X
|
||||||
|
integer(kind=16), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
elemental real(kind=8) function _gfortran_ieee_scalb_8_16 (X, I)
|
||||||
|
real(kind=8), intent(in) :: X
|
||||||
|
integer(kind=16), intent(in) :: I
|
||||||
|
end function
|
||||||
|
elemental real(kind=4) function _gfortran_ieee_scalb_4_16 (X, I)
|
||||||
|
real(kind=4), intent(in) :: X
|
||||||
|
integer(kind=16), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GFC_INTEGER_8
|
||||||
#ifdef HAVE_GFC_REAL_16
|
#ifdef HAVE_GFC_REAL_16
|
||||||
elemental real(kind=16) function _gfortran_ieee_scalb_16 (X, I)
|
elemental real(kind=16) function _gfortran_ieee_scalb_16_8 (X, I)
|
||||||
|
real(kind=16), intent(in) :: X
|
||||||
|
integer(kind=8), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
elemental real(kind=10) function _gfortran_ieee_scalb_10_8 (X, I)
|
||||||
|
real(kind=10), intent(in) :: X
|
||||||
|
integer(kind=8), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
elemental real(kind=8) function _gfortran_ieee_scalb_8_8 (X, I)
|
||||||
|
real(kind=8), intent(in) :: X
|
||||||
|
integer(kind=8), intent(in) :: I
|
||||||
|
end function
|
||||||
|
elemental real(kind=4) function _gfortran_ieee_scalb_4_8 (X, I)
|
||||||
|
real(kind=4), intent(in) :: X
|
||||||
|
integer(kind=8), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GFC_INTEGER_2
|
||||||
|
#ifdef HAVE_GFC_REAL_16
|
||||||
|
elemental real(kind=16) function _gfortran_ieee_scalb_16_2 (X, I)
|
||||||
|
real(kind=16), intent(in) :: X
|
||||||
|
integer(kind=2), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
elemental real(kind=10) function _gfortran_ieee_scalb_10_2 (X, I)
|
||||||
|
real(kind=10), intent(in) :: X
|
||||||
|
integer(kind=2), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
elemental real(kind=8) function _gfortran_ieee_scalb_8_2 (X, I)
|
||||||
|
real(kind=8), intent(in) :: X
|
||||||
|
integer(kind=2), intent(in) :: I
|
||||||
|
end function
|
||||||
|
elemental real(kind=4) function _gfortran_ieee_scalb_4_2 (X, I)
|
||||||
|
real(kind=4), intent(in) :: X
|
||||||
|
integer(kind=2), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GFC_INTEGER_1
|
||||||
|
#ifdef HAVE_GFC_REAL_16
|
||||||
|
elemental real(kind=16) function _gfortran_ieee_scalb_16_1 (X, I)
|
||||||
|
real(kind=16), intent(in) :: X
|
||||||
|
integer(kind=1), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
elemental real(kind=10) function _gfortran_ieee_scalb_10_1 (X, I)
|
||||||
|
real(kind=10), intent(in) :: X
|
||||||
|
integer(kind=1), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
elemental real(kind=8) function _gfortran_ieee_scalb_8_1 (X, I)
|
||||||
|
real(kind=8), intent(in) :: X
|
||||||
|
integer(kind=1), intent(in) :: I
|
||||||
|
end function
|
||||||
|
elemental real(kind=4) function _gfortran_ieee_scalb_4_1 (X, I)
|
||||||
|
real(kind=4), intent(in) :: X
|
||||||
|
integer(kind=1), intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GFC_REAL_16
|
||||||
|
elemental real(kind=16) function _gfortran_ieee_scalb_16_4 (X, I)
|
||||||
real(kind=16), intent(in) :: X
|
real(kind=16), intent(in) :: X
|
||||||
integer, intent(in) :: I
|
integer, intent(in) :: I
|
||||||
end function
|
end function
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
elemental real(kind=10) function _gfortran_ieee_scalb_10_4 (X, I)
|
||||||
|
real(kind=10), intent(in) :: X
|
||||||
|
integer, intent(in) :: I
|
||||||
|
end function
|
||||||
|
#endif
|
||||||
|
elemental real(kind=8) function _gfortran_ieee_scalb_8_4 (X, I)
|
||||||
|
real(kind=8), intent(in) :: X
|
||||||
|
integer, intent(in) :: I
|
||||||
|
end function
|
||||||
|
elemental real(kind=4) function _gfortran_ieee_scalb_4_4 (X, I)
|
||||||
|
real(kind=4), intent(in) :: X
|
||||||
|
integer, intent(in) :: I
|
||||||
|
end function
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface IEEE_SCALB
|
interface IEEE_SCALB
|
||||||
procedure &
|
procedure &
|
||||||
|
#ifdef HAVE_GFC_INTEGER_16
|
||||||
#ifdef HAVE_GFC_REAL_16
|
#ifdef HAVE_GFC_REAL_16
|
||||||
_gfortran_ieee_scalb_16, &
|
_gfortran_ieee_scalb_16_16, &
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_GFC_REAL_10
|
#ifdef HAVE_GFC_REAL_10
|
||||||
_gfortran_ieee_scalb_10, &
|
_gfortran_ieee_scalb_10_16, &
|
||||||
#endif
|
#endif
|
||||||
_gfortran_ieee_scalb_8, _gfortran_ieee_scalb_4
|
_gfortran_ieee_scalb_8_16, &
|
||||||
|
_gfortran_ieee_scalb_4_16, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_INTEGER_8
|
||||||
|
#ifdef HAVE_GFC_REAL_16
|
||||||
|
_gfortran_ieee_scalb_16_8, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
_gfortran_ieee_scalb_10_8, &
|
||||||
|
#endif
|
||||||
|
_gfortran_ieee_scalb_8_8, &
|
||||||
|
_gfortran_ieee_scalb_4_8, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_INTEGER_2
|
||||||
|
#ifdef HAVE_GFC_REAL_16
|
||||||
|
_gfortran_ieee_scalb_16_2, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
_gfortran_ieee_scalb_10_2, &
|
||||||
|
#endif
|
||||||
|
_gfortran_ieee_scalb_8_2, &
|
||||||
|
_gfortran_ieee_scalb_4_2, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_INTEGER_1
|
||||||
|
#ifdef HAVE_GFC_REAL_16
|
||||||
|
_gfortran_ieee_scalb_16_1, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
_gfortran_ieee_scalb_10_1, &
|
||||||
|
#endif
|
||||||
|
_gfortran_ieee_scalb_8_1, &
|
||||||
|
_gfortran_ieee_scalb_4_1, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_16
|
||||||
|
_gfortran_ieee_scalb_16_4, &
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GFC_REAL_10
|
||||||
|
_gfortran_ieee_scalb_10_4, &
|
||||||
|
#endif
|
||||||
|
_gfortran_ieee_scalb_8_4, &
|
||||||
|
_gfortran_ieee_scalb_4_4
|
||||||
end interface
|
end interface
|
||||||
public :: IEEE_SCALB
|
public :: IEEE_SCALB
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue