[patch,fortran] Support type real for count_rate in system_clock (PR28484)

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sat Oct 28 15:51:00 GMT 2006


Tobias Burnus <burnus@net-b.de> wrote on Sat, 28 Oct 2006:
> Brooks Moses wrote:
>> Steve Kargl wrote:
>>> On Sat, Oct 28, 2006 at 12:38:42AM +0200, Tobias Burnus wrote:
>>> You'll need to implement the real(10), real(16), and integer(16)
>>> versions.  If gfortran (on some target) provides any or all of
>>> these types, then we need intrinsic procedures.
>>
>> Indeed.  To clarify that, the Fortran Standard says that the
>> intrinsics can be called with any real or integer kind, and so not
>> supplying all intrinsics for all supported kinds would mean that the
>> compiler isn't standard-conforming.
>
> Should one also implement
>    system_clock(int4, int8, int16)
> that is: Mixing all different integer kinds for system_clock? Currently,
> the integer have to be all of the same kind.
> Doing so gives then in total 3*3*3 = 27 integer and 4*3*3 = 36
> real/integer combinations, i.e. 63 combinations!

One could emit the necessary type conversions, i.e. only implement
  system_clock (int4, int4, int4)
in the library and then convert the parameters appropriately for all  
other combinations, e.g. translating
  system_clock (int4, int8, int16)
as
  int4 t1 = int8
  int4 t2 = int16
  system_clock (int4, t1, t2)
  int8 = t1
  int16 = t2
(I don't know the semantics of system_clock off the top of my head,  
the sensible sequence and choice of types depends on the INTENTs and  
the possible values of the arguments)

Cheers,
- Tobi


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the Gcc-patches mailing list