View previous topic :: View next topic |
Author |
Message |
clint
Joined: 14 Jun 2006 Posts: 37
|
Posted: Fri Jun 23, 2006 7:39 am Post subject: RT, LT, etc |
|
|
given (I) a 32 bit integer (with 0 being least significant and 31 being most significant) - is this the convention in FTN95?
gives the lower 5 bits of I (i.e. bits 0-4 inclusive) and
gives upper 22 bits (10-31 inclusive)
thanks
Clint |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Fri Jun 23, 2006 9:39 am Post subject: RT, LT, etc |
|
|
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. |
|
Back to top |
|
|
clint
Joined: 14 Jun 2006 Posts: 37
|
Posted: Mon Jun 26, 2006 5:07 am Post subject: RT, LT, etc |
|
|
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
Code: | bit = LS(RS(bit,3),3) + 7 - RT(bit,3) |
Is it the same as
Code: | bit = IAND(NOT(,bit) + 7 + IBITS(bit,3,BIT_SIZE(bit)-3) |
?
thanks
Clint |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Jun 26, 2006 6:21 am Post subject: RT, LT, etc |
|
|
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. |
|
Back to top |
|
|
clint
Joined: 14 Jun 2006 Posts: 37
|
Posted: Mon Jun 26, 2006 6:52 am Post subject: RT, LT, etc |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Jun 26, 2006 9:57 am Post subject: RT, LT, etc |
|
|
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. |
|
Back to top |
|
|
|