Help getting Watcom 11.0 floating point emulation working in non-DOS environment 
Author Message
 Help getting Watcom 11.0 floating point emulation working in non-DOS environment

http://www.*-*-*.com/
mentions newsgroup

I suspect this will be right up their alley.  Have you given that newsgroup a
try?

--
C-FAQ ftp sites: ftp://ftp.eskimo.com ftp://rtfm.mit.edu
Hypertext C-FAQ: http://www.*-*-*.com/ ~scs/C-faq/top.html
C-FAQ Book: ISBN 0-201-84519-9.
Want Software?  Algorithms?  Pubs? http://www.*-*-*.com/



Wed, 25 Oct 2000 03:00:00 GMT  
 Help getting Watcom 11.0 floating point emulation working in non-DOS environment

I'm having difficulty getting an application built using the Watcom 11.0
'C' compiler and assembler to perform floating point emulation for an
embedded 486SX application.  I'm using CSi-Link for a linker/locator
since we will be loading this stuff into a ROM eventually.  Most of the
Watcom information for their products is targeted at DOS/NT/OS2
applications and embedded applications are only briefly mentioned.
About all their standard documentation says is that the Watcom tools and
libraries can be used in a ROM environment, but doesn't really tell you
how.

When I load my application on a target that has hardware floating point
it runs quite well.  Since my RTOS is targeted for Watcom, I really
don't want to switch to a different compiler/assembler/library at this
stage of our project.  Unfortunately, the product is targeted at low
power applications so using FP hardware is pretty much out of the
question.

I suspect that what's missing is setting up an exception handler to
process the exceptions thrown when floating point intstuction are
executed on a processor without a floating point co-processor.  I've
tried both the -fpi (inline FP instructions) and the -fpc (FP calls)
options with pretty much the same result - works with HW floating point
and doesn't without.  Unfortunately, Watcom's documentation doesn't
detail the initialization requirements except as required for DOS or NT
which really doesn't apply in this case since I'm not using one of
those   as my operating system.

Yes, I have contacted Watcom (now a part of Sybase).  They have been
less than helpful to this point.  Their support analyst has suggested
"just going ahead and linking in the DOS libraries", which tells me that
he doesn't understand my target environment.  The Watcom support folks
seem to be unable to get through to their developers.

Before I start extracting objects from the Watcom libraries and
disassembling them to figure out how they set up to catch FP exceptions,
has anyone had any luck getting floating point emulation working using
Watcom 11.0 for environments other than DOS/NT/OS2?  If so, any
documentation, examples, pointers to sources of information or advise
you might have would be welcome.  Thanks.



Wed, 25 Oct 2000 03:00:00 GMT  
 Help getting Watcom 11.0 floating point emulation working in non-DOS environment

use news server forums.sybase.com
--
C-FAQ ftp sites: ftp://ftp.eskimo.com ftp://rtfm.mit.edu
Hypertext C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-FAQ Book: ISBN 0-201-84519-9.
Want Software?  Algorithms?  Pubs? http://www.infoseek.com



Wed, 25 Oct 2000 03:00:00 GMT  
 Help getting Watcom 11.0 floating point emulation working in non-DOS environment

James,

You left out one very key piece of information in your message -- are
you writing 16-bit or 32-bit code?

For 16-bit DOS, the Watcom C compiler includes a floating point emulator
as part of the C runtime library.  To use it an embedded system, you'll
need to reverse engineer the initialization code for the emulator.  I doubt
this is really documented anywhere.  I am not familiar with the 16-bit
Watcom emulator, but other 16-bit FP emulators are typically not ROMable
because they do code modification.

For 32-bit NT, the Watcom C compiler almost surely uses the floating point
emulator in Windows NT.

BTW, in my experience, floating point emulation is handled by the RTOS,
not by the compiler runtime library.

Richard

Quote:

> I'm having difficulty getting an application built using the Watcom 11.0
> 'C' compiler and assembler to perform floating point emulation for an
> embedded 486SX application.  I'm using CSi-Link for a linker/locator
> since we will be loading this stuff into a ROM eventually.  Most of the
> Watcom information for their products is targeted at DOS/NT/OS2
> applications and embedded applications are only briefly mentioned.
> About all their standard documentation says is that the Watcom tools and
> libraries can be used in a ROM environment, but doesn't really tell you
> how.

> When I load my application on a target that has hardware floating point
> it runs quite well.  Since my RTOS is targeted for Watcom, I really
> don't want to switch to a different compiler/assembler/library at this
> stage of our project.  Unfortunately, the product is targeted at low
> power applications so using FP hardware is pretty much out of the
> question.

> I suspect that what's missing is setting up an exception handler to
> process the exceptions thrown when floating point intstuction are
> executed on a processor without a floating point co-processor.  I've
> tried both the -fpi (inline FP instructions) and the -fpc (FP calls)
> options with pretty much the same result - works with HW floating point
> and doesn't without.  Unfortunately, Watcom's documentation doesn't
> detail the initialization requirements except as required for DOS or NT
> which really doesn't apply in this case since I'm not using one of
> those   as my operating system.

> Yes, I have contacted Watcom (now a part of Sybase).  They have been
> less than helpful to this point.  Their support analyst has suggested
> "just going ahead and linking in the DOS libraries", which tells me that
> he doesn't understand my target environment.  The Watcom support folks
> seem to be unable to get through to their developers.

> Before I start extracting objects from the Watcom libraries and
> disassembling them to figure out how they set up to catch FP exceptions,
> has anyone had any luck getting floating point emulation working using
> Watcom 11.0 for environments other than DOS/NT/OS2?  If so, any
> documentation, examples, pointers to sources of information or advise
> you might have would be welcome.  Thanks.



Wed, 25 Oct 2000 03:00:00 GMT  
 Help getting Watcom 11.0 floating point emulation working in non-DOS environment


Quote:
> I'm having difficulty getting an application built using the Watcom 11.0
> 'C' compiler and assembler to perform floating point emulation for an
> embedded 486SX application.  ...
> When I load my application on a target that has hardware floating point
> it runs quite well.  ...

I don't know about Watcom, but Turbo C/Borland C uses a fix up
strategy that's not compatible with ROMable code.  When the "fpu
missing" exception occurs, the emulator patches the fp instruction into a
call of some sort and continues with the instruction.  The idea seemingly
is this instruction likely will be executed again (as in a loop) so the
detection
of the missing fpu is done only the first time the instruction is executed.
After that, the emulator is apparently called directly.

The behavior you're experiencing might match that.

-- wally at steptech dot com



Sat, 28 Oct 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. bc++ 5.0 <-> watcom 11.0

2. Creating a stub with Watcom C/C++ 11.0

3. BORLAND Floating Point emulation question

4. Watcom 11.0

5. Info on Watcom c/c++ 11.0

6. BC4.5 floating point emulation

7. Floating-point emulation for DSP?

8. Question regarding 80387 floating point emulation for compiled C code

9. ARM and SH3 Floating Point Emulation

10. CE 4.1 Emulator and Floating Point Emulation

11. PDP-11 floating point format query

12. Watcom & floating point

 

 
Powered by phpBB® Forum Software