forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RT, LT, etc

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
clint



Joined: 14 Jun 2006
Posts: 37

PostPosted: Fri Jun 23, 2006 7:39 am    Post subject: RT, LT, etc Reply with quote

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

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

Code:
RT(I,10)
gives upper 22 bits (10-31 inclusive)

thanks
Clint
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Fri Jun 23, 2006 9:39 am    Post subject: RT, LT, etc Reply with quote

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
View user's profile Send private message AIM Address
clint



Joined: 14 Jun 2006
Posts: 37

PostPosted: Mon Jun 26, 2006 5:07 am    Post subject: RT, LT, etc Reply with quote

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(Cool,bit) + 7 + IBITS(bit,3,BIT_SIZE(bit)-3)


?

thanks
Clint
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Mon Jun 26, 2006 6:21 am    Post subject: RT, LT, etc Reply with quote

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
View user's profile Send private message AIM Address
clint



Joined: 14 Jun 2006
Posts: 37

PostPosted: Mon Jun 26, 2006 6:52 am    Post subject: RT, LT, etc Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Mon Jun 26, 2006 9:57 am    Post subject: RT, LT, etc Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group