Silverfrost Forums

Welcome to our forums

RT, LT, etc

23 Jun 2006 6:39 #782

given (I) a 32 bit integer (with 0 being least significant and 31 being most significant) - is this the convention in FTN95?

LT(I,5)

gives the lower 5 bits of I (i.e. bits 0-4 inclusive) and

RT(I,10)

gives upper 22 bits (10-31 inclusive)

thanks Clint

23 Jun 2006 8:39 #785

Clint

Bitwise operations were included in the Fortran 90 standard and it is better to use these standard conforming intrinsics.

See the help file under FTN95 library → Standard intrinsics (classified) → Bitwise operations.

The old Salford bitwise intrinsics are mentioned in 'Optimisation and efficient use of FTN95' → 'Intrinsic funcitons', but they are not documented in the help file.

26 Jun 2006 4:07 #789

I'm working on old FTN77 code where these functions are used, and am replacing them with F95 code.

I require the same the behaviour and so need exact descriptions of thes eold functions.

Here is an example of the code

bit = LS(RS(bit,3),3) + 7 - RT(bit,3)

Is it the same as

bit = IAND(NOT(8),bit) + 7 + IBITS(bit,3,BIT_SIZE(bit)-3)

?

thanks Clint

26 Jun 2006 5:21 #790

Clint

Running the code under FTN77 and FTN95 respectively indicates that they are not the same.

Do you have access to FTN77? If not I assume that you can download a copy from the Silverfrost website.

26 Jun 2006 5:52 #792

The objective is to modernise some old code and run it under F95 or later (adopting the new standard) I need to know the behaviour of the old functions so that I can replace them.

cheers Clint

26 Jun 2006 8:57 #796

Clint

I assume that you do not have the FTN77 manual. As far as I know they are now out of print but you could check with Silverfrost.

If you are a licenced user of FTN95 then I can send you a Word document for the relevant chapter. Please email me via this forum with your email address.

Please login to reply.