Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-06

using float emulation

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

I'm trying to force fpc to use emulation code for floating poing calculations on i386 hardware.

$ fpc -al -st -Op1 -CfSOFT floattest.pp

Viewn from the assembler source the file is identical to one compiled without target options and the link script does not show the inclusion of something special.

This should work (me thinks;), but the info screen specifies -Op1 for 386/486. A i486 *does* have a coprocessor.

How can aks fpc to write code for an i386sx without FPU?

TIA,
Marc

Reply by email

Daniël Mantione
to Marc Santhoff

Op Fri, 1 Jun 2007, schreef Marc Santhoff:

Show quoted text 15 lines
Hi, I'm trying to force fpc to use emulation code for floating poing calculations on i386 hardware. $ fpc -al -st -Op1 -CfSOFT floattest.pp Viewn from the assembler source the file is identical to one compiled without target options and the link script does not show the inclusion of something special. This should work (me thinks;), but the info screen specifies -Op1 for 386/486. A i486 *does* have a coprocessor. How can aks fpc to write code for an i386sx without FPU?

Use fpu emulation.

Please see http://www.freepascal.org/faq.var#fp386

I doubt softwarefloat is in working condition on i386, probably several of the assembler routines use the fpu. However, the compiler should be able to generate softfpu calls if -Cfsoft is used on x86.

Daniël

Reply by email

Marc Santhoff
to Daniël Mantione
Daniël Mantione wrote 22 lines
Op Fri, 1 Jun 2007, schreef Marc Santhoff: > Hi, > > I'm trying to force fpc to use emulation code for floating poing > calculations on i386 hardware. > > $ fpc -al -st -Op1 -CfSOFT floattest.pp > > Viewn from the assembler source the file is identical to one compiled > without target options and the link script does not show the inclusion > of something special. > > This should work (me thinks;), but the info screen specifies -Op1 for > 386/486. A i486 *does* have a coprocessor. > > How can aks fpc to write code for an i386sx without FPU? Use fpu emulation. Please see http://www.freepascal.org/faq.var#fp386

Hmm, talking about DOS there.

I doubt softwarefloat is in working condition on i386, probably several of the assembler routines use the fpu. However, the compiler should be able to generate softfpu calls if -Cfsoft is used on x86.

So on Unix'ish FreeBSD I'm pretty lost, I assume ...

Thank you anyways for answering quickly,
Marc

Reply by email

Daniël Mantione
to Marc Santhoff

Op Fri, 1 Jun 2007, schreef Marc Santhoff:

Show quoted text 25 lines
Am Freitag, den 01.06.2007, 20:58 +0200 schrieb Daniël Mantione: > > Op Fri, 1 Jun 2007, schreef Marc Santhoff: > > > Hi, > > > > I'm trying to force fpc to use emulation code for floating poing > > calculations on i386 hardware. > > > > $ fpc -al -st -Op1 -CfSOFT floattest.pp > > > > Viewn from the assembler source the file is identical to one compiled > > without target options and the link script does not show the inclusion > > of something special. > > > > This should work (me thinks;), but the info screen specifies -Op1 for > > 386/486. A i486 *does* have a coprocessor. > > > > How can aks fpc to write code for an i386sx without FPU? > > Use fpu emulation. > > Please see http://www.freepascal.org/faq.var#fp386 Hmm, talking about DOS there.

Yes, few people run anything else on a 386 :)

Show quoted text 5 lines
> I doubt softwarefloat is in working condition on i386, probably several of > the assembler routines use the fpu. However, the compiler should be able > to generate softfpu calls if -Cfsoft is used on x86. So on Unix'ish FreeBSD I'm pretty lost, I assume ...

If it has no fpu emulator...

Well, if you have some simple programmers skills, you might be able to make it work. Recompile the rtl with softfloat, and fix some assembler here and there.

Daniël

Reply by email

Marc Santhoff
to Daniël Mantione
Daniël Mantione wrote 42 lines
Op Fri, 1 Jun 2007, schreef Marc Santhoff: > Am Freitag, den 01.06.2007, 20:58 +0200 schrieb Daniël Mantione: > > > > Op Fri, 1 Jun 2007, schreef Marc Santhoff: > > > > > Hi, > > > > > > I'm trying to force fpc to use emulation code for floating poing > > > calculations on i386 hardware. > > > > > > $ fpc -al -st -Op1 -CfSOFT floattest.pp > > > > > > Viewn from the assembler source the file is identical to one compiled > > > without target options and the link script does not show the inclusion > > > of something special. > > > > > > This should work (me thinks;), but the info screen specifies -Op1 for > > > 386/486. A i486 *does* have a coprocessor. > > > > > > How can aks fpc to write code for an i386sx without FPU? > > > > Use fpu emulation. > > > > Please see http://www.freepascal.org/faq.var#fp386 > > Hmm, talking about DOS there. Yes, few people run anything else on a 386 :) > > I doubt softwarefloat is in working condition on i386, probably several of > > the assembler routines use the fpu. However, the compiler should be able > > to generate softfpu calls if -Cfsoft is used on x86. > > So on Unix'ish FreeBSD I'm pretty lost, I assume ... If it has no fpu emulator... Well, if you have some simple programmers skills, you might be able to make it work. Recompile the rtl with softfloat, and fix some assembler here and there.

Ah, now I understand: the system emulates the fpu if not present and the rtl has to compiled accordingly ... interesting.

Sadly the emulator code in freebsd is not that promising. All this would be much work for doing some test for comparison. Maybe if the weather is getting bad over the weekend I'll try. ;)

Thank you, at least I've learned a lot,
Marc

Reply by email