comp.lang.ada
 help / color / mirror / Atom feed
* Re: How to modify Standard types in GNAT-3.11?
  1999-02-18  0:00 How to modify Standard types in GNAT-3.11? Tony R. Ambardar
@ 1999-02-18  0:00 ` Stephen Leake
  1999-02-19  0:00   ` robert_dewar
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Leake @ 1999-02-18  0:00 UTC (permalink / raw)


tonya@aban.ece.ubc.ca (Tony R. Ambardar) writes:

> <snip>

> So the easiest solution I can see is to make Long_Long_Float
> equivalent to Long_Float. It looks like I may only need to modify the
> files stand.ads and a-types.h. Could someone please suggest the right
> way of doing this?

Since you are recompiling the run-time, you can certainly edit any
file you want. However, it would be better to simply delete
Long_long_Float, since you won't support it. Don't lie and make it not
bigger than Long_Float!

-- Stephe




^ permalink raw reply	[flat|nested] 6+ messages in thread

* How to modify Standard types in GNAT-3.11?
@ 1999-02-18  0:00 Tony R. Ambardar
  1999-02-18  0:00 ` Stephen Leake
  0 siblings, 1 reply; 6+ messages in thread
From: Tony R. Ambardar @ 1999-02-18  0:00 UTC (permalink / raw)


Hello all,

I'm using gnat-3.11 to generate code for a i386-based board running
RTEMS-4.0.0. Since I don't have an i387 math coprocessor, I've set up
gnat/gcc to use software floating point emulation. This requires
compiling all my code and libraries -- including gnatlib -- with the
option flags "-msoft-float -mno-fp-ret-in-387".

When compiling gnatlib I get gcc/gnat errors in 6 RTS files which are
related to the use of Long_Long_Float's (i.e. extended floats). The
errors are all of the form "Unable to find register to spill", so I
assume the option flags I use are making registers scarce.

Additionally, the software floating-point library only uses stubs for
the extended float routines, so gnat would not be able to use these
anyway.

So the easiest solution I can see is to make Long_Long_Float
equivalent to Long_Float. It looks like I may only need to modify the
files stand.ads and a-types.h. Could someone please suggest the right
way of doing this?

Thank you,
Tony Ambardar

--
  ____________________________________________________________
 /                                                            \
| Tony R. Ambardar         |   Department of Electrical &      |
| M.Eng. Student           |   Computer Engineering            | 
| Email: tonya&ece.ubc.ca  |   University of British Columbia  |
| Ph: (604) 822-3611       |   2356 Main Mall, Vancouver B.C.  |
| Fax:(604) 822-5949       |   V6T 1Z4  CANADA                 |
 \____________________________________________________________/




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to modify Standard types in GNAT-3.11?
  1999-02-19  0:00   ` robert_dewar
@ 1999-02-19  0:00     ` Tony R. Ambardar
  1999-02-19  0:00       ` robert_dewar
  1999-02-22  0:00     ` Stephen Leake
  1 sibling, 1 reply; 6+ messages in thread
From: Tony R. Ambardar @ 1999-02-19  0:00 UTC (permalink / raw)


robert_dewar@my-dejanews.com wrote:
: Bad idea! Stephen, I guess you are not that familiar with
: the GNAT run-time library. Long_Long_Float is used in many
: many units, and indeed the expected thing is that it be
: equivalent to Long_Float if IEEE extended is not supported.
: Even doing this equivalence is not so easy!

I noticed this pervasive use of Long_Long_Float early on, and ended up
spending a fair bit of time looking through the RTS code for the
Right Way. I've gotten everything to work (so far) by doing the
following:

1. Modifying all the IEEEX_ attributes to be the same as the IEEEL_
attributes in Ttypef.ads.

2. Defining LONG_DOUBLE_TYPE_SIZE to be 64 in my GCC target include file,
config/i386/rtems.h

This finally allows me to use GNAT/RTEMS with software floating-point.

Does this sound right you, Robert? I suspect there's a cleaner way to
do this, or perhaps there's something I've forgotten...

Thanks for your feedback.
--
  ____________________________________________________________
 /                                                            \
| Tony R. Ambardar         |   Department of Electrical &      |
| M.Eng. Student           |   Computer Engineering            | 
| Email: tonya@ece.ubc.ca  |   University of British Columbia  |
| Ph: (604) 822-3611       |   2356 Main Mall, Vancouver B.C.  |
| Fax:(604) 822-5949       |   V6T 1Z4  CANADA                 |
 \____________________________________________________________/




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to modify Standard types in GNAT-3.11?
  1999-02-19  0:00     ` Tony R. Ambardar
@ 1999-02-19  0:00       ` robert_dewar
  0 siblings, 0 replies; 6+ messages in thread
From: robert_dewar @ 1999-02-19  0:00 UTC (permalink / raw)


In article <7ainnj$6ae$1@nntp.ucs.ubc.ca>,
  tonya@aban.ece.ubc.ca (Tony R. Ambardar) wrote:
> robert_dewar@my-dejanews.com wrote:
> Right Way. I've gotten everything to work (so far) by
> doing the following:
>
> 1. Modifying all the IEEEX_ attributes to be the same as
the IEEEL_attributes in Ttypef.ads.

That sounds wrong to me, and should not be necessary. I
would suggest you move your query to the chat@gnat.com
list, which is really more appropriate for this kind of
very GNAT specific discussion, and far more people who
know GNAT follow chat than follow CLA (in my experience,
many, probably most, serious Ada users, including certainly
most of the ACT folks, gave up on following CLA a long time
ago :-(

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to modify Standard types in GNAT-3.11?
  1999-02-18  0:00 ` Stephen Leake
@ 1999-02-19  0:00   ` robert_dewar
  1999-02-19  0:00     ` Tony R. Ambardar
  1999-02-22  0:00     ` Stephen Leake
  0 siblings, 2 replies; 6+ messages in thread
From: robert_dewar @ 1999-02-19  0:00 UTC (permalink / raw)


In article <uiuczpcyy.fsf@gsfc.nasa.gov>,
  Stephen Leake <Stephen.Leake@gsfc.nasa.gov> wrote:
> tonya@aban.ece.ubc.ca (Tony R. Ambardar) writes:
>
> Since you are recompiling the run-time, you can certainly
> edit any file you want. However, it would be better to
> simply delete Long_long_Float, since you won't support
> it. Don't lie and make it not
> bigger than Long_Float!

Bad idea! Stephen, I guess you are not that familiar with
the GNAT run-time library. Long_Long_Float is used in many
many units, and indeed the expected thing is that it be
equivalent to Long_Float if IEEE extended is not supported.
Even doing this equivalence is not so easy!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to modify Standard types in GNAT-3.11?
  1999-02-19  0:00   ` robert_dewar
  1999-02-19  0:00     ` Tony R. Ambardar
@ 1999-02-22  0:00     ` Stephen Leake
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Leake @ 1999-02-22  0:00 UTC (permalink / raw)


robert_dewar@my-dejanews.com writes:

> In article <uiuczpcyy.fsf@gsfc.nasa.gov>,
>   Stephen Leake <Stephen.Leake@gsfc.nasa.gov> wrote:
> > tonya@aban.ece.ubc.ca (Tony R. Ambardar) writes:
> >
> > Since you are recompiling the run-time, you can certainly
> > edit any file you want. However, it would be better to
> > simply delete Long_long_Float, since you won't support
> > it. Don't lie and make it not
> > bigger than Long_Float!
> 
> Bad idea! Stephen, I guess you are not that familiar with
> the GNAT run-time library. Long_Long_Float is used in many
> many units, and indeed the expected thing is that it be
> equivalent to Long_Float if IEEE extended is not supported.
> Even doing this equivalence is not so easy!

Well, I admit to being not familiar with the GNAT run-time library. I
was arguing from the general principle "don't declare garbage (at
least where everyone can see it)". However, on reading LRM 3.5.7 (16),
I see that GNAT's expected usage follows the LRM (precision of
Long_Float should be no greater than Long_Long_Float).

In reality, people should always define their own floating point
types, and not rely on Long_Long_Float having any particular meaning.
It just bugs me that this is one very visible area where Ada 95 turns
out to be so ill-defined.

Wouldn't it be better to define System_Max_Float_Type in a
GNAT-specific package, and use that in the run-time library? 


> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-02-22  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-18  0:00 How to modify Standard types in GNAT-3.11? Tony R. Ambardar
1999-02-18  0:00 ` Stephen Leake
1999-02-19  0:00   ` robert_dewar
1999-02-19  0:00     ` Tony R. Ambardar
1999-02-19  0:00       ` robert_dewar
1999-02-22  0:00     ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox