From: glen herrmannsfeldt on
steve <kargls(a)comcast.net> wrote:
> On Feb 9, 10:13?pm, glen herrmannsfeldt <g...(a)ugcs.caltech.edu> wrote:

>> In one check, it seems that gfortran generates IOR, IAND, IEOR,
>> and ISHFT inline, but ISHFTC with a subroutine call. ?Two calls
>> to ISHFT, in that case, is likely faster than ISHFTC.

> Source code?

! test the generated code for some simple functions
integer i,j
read(*,*) i,j
write(*,*) iand(i,j),ior(i,j),ieor(i,j),ishft(i,-4),ishftc(i,4,32)
end

> Given the right source gfortran won't produce anything except
> the answer (hint, constant folding).

Yes, to avoid that I read in i and j. I used constants for
the second and third argument of ishftc(), as that is a common use.

The problem of benchmarks and constant folding is an old one.

-- glen
First  |  Prev  | 
Pages: 1 2
Prev: Thanks
Next: Bitwise functions with more arguments?