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 

shiftr and shiftl

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



Joined: 18 May 2012
Posts: 858
Location: Lanarkshire, Scotland.

PostPosted: Thu Jan 02, 2025 3:39 pm    Post subject: shiftr and shiftl Reply with quote

Please consider adding shiftr and shiftl to the wish list.

I had to resort to adding a ftn95 specific module in order to compile and run a much larger program with ftn95

Thanks

Ken

Code:
winapp

module shift_ftn95_mod
implicit none
contains

  integer function shiftr(i,n)
  integer, intent(in) :: i, n
    shiftr = ishft(i,-n)   
  end function shiftr

  integer function shiftl(i,n)
  integer, intent(in) :: i, n
    shiftl = ishft(i,n)
  end function shiftl
 
end module shift_ftn95_mod

program int_div_mult_by_2
use iso_fortran_env
use shift_ftn95_mod    ! Required with FTN95
implicit none
integer i, j
write(*,'(a,/)') compiler_version()
i = 3                       ! i = 3, j = 2
j = 2
print*, i/j                 ! i/j   = 1
print*, ishft(i,-1)         ! i / 2 = 1
print*, shiftr(i,1)         ! i / 2 = 1
print*, i*j                 ! i x j = 6
print*, shiftl(i,1)         ! i x 2 = 6
i = 4
print*                      ! i = 4, j = 2
print*, i/j                 ! i/j   = 2
print*, ishft(i,-1)         ! i / 2 = 2
print*, shiftr(i,1)         ! i / 2 = 2
print*, i*j                 ! i x j = 8
print*, shiftl(i,1)         ! i x 2 = 8
end program int_div_mult_by_2


Code:
FTN95 v9.04.0

            1
            1
            1
            6
            6

            2
            2
            2
            8
            8
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jan 03, 2025 9:12 am    Post subject: Reply with quote

Thanks Ken. I will add these to the task list.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Tue Jan 07, 2025 4:00 pm    Post subject: Reply with quote

shiftl,shiftr and shifta have now been added for Win32 and x64.

These will be in the next release of FTN95 and the associated DLLs.
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1923

PostPosted: Sun Nov 16, 2025 12:12 pm    Post subject: new intrinsics SHIFTL and SHIFTR Reply with quote

Paul, the new intrinsics SHIFTL and SHIFTR in Version 9.10 work with /x64, but fail in 32-bit EXEs.

Code:

   program tst
   implicit none
   print *,shiftr(16,2),shiftl(4,3)
   end program tst


The 32-bit EXE causes a pop up saying that the entry point SHIFTR# could not be found in the EXE.

Your post http://forums.silverfrost.com/viewtopic.php?t=5020 said that it would be part of the current release:
Version: 9.10.0.0
Built: Sat Feb 8 11:13:50 2025
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1923

PostPosted: Sun Nov 16, 2025 12:29 pm    Post subject: Missing entry point JSHIFTL# Reply with quote

Paul, I took Bill's source code and removed the lines for the module, leaving me a small source file, with invocations of SHIFTR and SHIFTL, which should be available in the current version of FTN95. The code compiles and links. The 64 bit EXE works, but the 32-bit EXE pops up a message that the entry point JSHIFTL# is missing (from the Silverfrost support DLLS where they are expected to be available).
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Nov 16, 2025 2:02 pm    Post subject: Reply with quote

mecej4

This might be a fault at our end or you might be accessing an old salflibc.dll.

The latest DLLs are available here ...http://forums.silverfrost.com/viewtopic.php?t=4245
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 -> Suggestions 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