[fpc-devel] ARM-Linux, ARMv5 runtime detection fails

Florian Klaempfl florian at freepascal.org
Thu Mar 6 19:23:12 CET 2008


Bernd Mueller schrieb:
> Florian Klaempfl wrote:
>> Bernd Mueller schrieb:
>>> Hello,
>>>
>>> the ARMv5 runtime detection in rtl/arm/arm.inc fails, because the used
>>> pld instruction does not raise SIGILL on ARM architectures ARMv4 and
>>> below. If you would use an instruction which raises a SIGILL, it would
>>> still fail, because SignalToRunerror in rtl/linux/arm/sighnd.inc does
>>> not recover correct from the SIGILL.
>>>
>>> The problem is now, that the wrong move procedure Move_pld is used
>>> instead of Move_blended for ARMv4 which leads to a huge speed penalty
>>> (about 25 %) for this architecture.
>>
>> Not using pld gives a speed penalty of 500-1000% (!) for ARMv5 :)
> no question.
> 
>>> I would suggest to use conditional compilation to separate between the
>>> different ARM architectures.
>>
>> At least this is no good solution because it would require that we build
>> two completly different releases.
> 
> I attached a patch, which solves the problem. To be honest: I am not
> totally sure if this is the right way. I am a newbie concerning Linux
> and ARM. At least the patch should not break ARMv5 ;-)

CPUs supporting CLZ might not support PLD. Can you test if using ldrd works?

> 
> Regards, Bernd.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list