 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
| View previous topic :: View next topic |
| Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 858 Location: Lanarkshire, Scotland.
|
Posted: Thu Jan 02, 2025 3:39 pm Post subject: shiftr and shiftl |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8290 Location: Salford, UK
|
Posted: Fri Jan 03, 2025 9:12 am Post subject: |
|
|
| Thanks Ken. I will add these to the task list. |
|
| Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8290 Location: Salford, UK
|
Posted: Tue Jan 07, 2025 4:00 pm Post subject: |
|
|
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 |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1923
|
Posted: Sun Nov 16, 2025 12:12 pm Post subject: new intrinsics SHIFTL and SHIFTR |
|
|
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 |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1923
|
Posted: Sun Nov 16, 2025 12:29 pm Post subject: Missing entry point JSHIFTL# |
|
|
| 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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8290 Location: Salford, UK
|
|
| Back to top |
|
 |
|
|
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
|