[fpc-devel] MIPS big-endian program starts but does nothing

Michael Ring mail at michael-ring.org
Thu Sep 11 13:16:14 CEST 2014


I checked the compile of system.pp for mipsel-embedded with the compile 
option -vc to see the status of the defines in order to find out the 
correct way to get SysResetFPU and SysInitFPU called.

As mips.inc is parsed before generic.inc fpc_cpuunit must get defined 
out because if not compilation breaks as the correct versions are 
defined later in generic.inc.

I also saw a second call for initialization in rtl/embedded/system.pp:

{$ifdef FPC_HAS_FEATURE_FPU}
   { Beware: The same code is executed from fpc_cpuinit, which is included
     per-cpu unconditionally }
   SysResetFPU;
   if not(IsLibrary) then
     SysInitFPU;
{$endif FPC_HAS_FEATURE_FPU}

This place looks perfect, only thing is that I do not know the meaning 
of FPC_HAS_FEATURE_FPU.

If this means "System has FPU, do not care if it is hard ord soft fpu" 
then I guess the way to do things would be to define FPC_HAS_FEATURE_FPU 
together with FPC_HAS_FEATURE_SOFTFPU

But what makes me struggle is that I also see a lot of occurences of the 
define FPUNONE, so I guess my interpretation above is wrong.

I also did a complete grep for FPC_HAS_FEATURE_FPU

find fpc-mipsel -type f -exec grep -H "FPC_HAS_FEATURE_FPU" {} \;

./rtl/embedded/system.pp:{$ifdef FPC_HAS_FEATURE_FPU}
./rtl/embedded/system.pp:{$endif FPC_HAS_FEATURE_FPU}

and it is only used in ./rtl/embedded/system.pp,

could the solution be as simple as to *replace FPC_HAS_FEATURE_FPU with 
FPC_HAS_FEATURE_SOFTFPU* ?

puzzled,

Michael


Am 09.09.14 um 13:32 schrieb Sergei Gorelkin:
> 09.09.2014 14:33, Michael Ring пишет:
>> Sergei, I have reworked the patch based on your comment:
>>
>> http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=28634 
>>
>>
>> Do you think this is solved better now?
>>
> No, my point was that routines SysInitFPU and SysResetFPU from 
> inc/generic.inc must be called instead of ones in mips/mips.inc. 
> Therefore changes to fpc_cpuinit aren't necessary.
>
> Regards,
> Sergei
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140911/0c88c055/attachment.html>


More information about the fpc-devel mailing list