Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

LOCFAR function equivalent

Jonas_T_2
Débutant
1 632 Visites

It seems that the Powerstation 4.0 Compiler had a builtin function named integer*4 LOCFAR. It is defined as the "segmented address function" opposed to integer*2 LOCNEAR the "unsegmented address function". Is there an equivalent in Intel Visual Fortran?

0 Compliments
1 Solution
Steven_L_Intel1
Employé
1 632 Visites

There is no "segmented addressing" anymore Maybe just use LOC.

Voir la solution dans l'envoi d'origine

0 Compliments
6 Réponses
Steven_L_Intel1
Employé
1 633 Visites

There is no "segmented addressing" anymore Maybe just use LOC.

0 Compliments
jimdempseyatthecove
Contributeur émérite III
1 632 Visites

Also be mindful that LOC returns an integer who's width is that of the memory model (4 for 32-bit, 8 for 64-bit).

INTEGER (KIND=INT_PTR_KIND()) :: YOUR_POINTER_AS_INTEGER

Also consult the language reference under POINTER.

Jim Dempsey

 

0 Compliments
Steven_L_Intel1
Employé
1 632 Visites

LOCNEAR and LOCFAR are holdovers from 16-bit Windows. I don't know what you'd even do with a 16-bit address on a 32-bit system!

0 Compliments
Jonas_T_2
Débutant
1 632 Visites

Thank you both for the clarification and the pointer to the pointers.

That's probably why there are just uses of LOCFAR an none of LOCNEAR in the code. I'll just try LOC and will have to be mindful when a swithc to 64bit will occur. But hopefully most of that codebase will be reworked by then.

0 Compliments
mecej4
Contributeur émérite III
1 632 Visites

You could take things a step further and note/fix any instances of 2-byte integers in the old code. For example, GETTIM() took 2-byte integer arguments in 16-bit Fortran and, with USE IFPORT, in Intel Fortran. However, the default arguments to GETTIM are 4-byte integers.

0 Compliments
Jonas_T_2
Débutant
1 632 Visites

Thanks, but there was a rework for INTEGER*4 instead of INTEGER*2 a few years ago. This rework will focus on dynamic allocation of memory or object oriented data structures... well as soon as i have it working with the new compiler. There are still a few pitfalls (multiple definitions, type checking shows wrong dimensions on arrays, etc.). But it compiled.

0 Compliments
Répondre