public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: exception handling poll
@ 1997-10-17 11:46 meissner
  1997-10-17 14:36 ` Joel Sherrill
  0 siblings, 1 reply; 36+ messages in thread
From: meissner @ 1997-10-17 11:46 UTC (permalink / raw)
  To: Robin.Kirkham, joel; +Cc: egcs

| The PPC problem is probably more difficult to address.  The code generate
| for vfprintf saves an FP regsiter in the prolog because of the path for FP
| numbers.  So even if you do not print an FP number, you still end up
| touching the FPU.

No, it is not a problem on the PPC at all.  The PPC ships different versions of
the libraries, based on endianess, whether floating point is done in hardware
or emulated, and whether you use the old sort-of AIX based calling sequence or
the newer eabi.  So, if you use the gcc driver, and add the -msoft-float option
when linking, you will get libraries that do not use the floating point
instructions.  This is true of many of our ports.

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re: exception handling poll
@ 1997-10-20  0:24 Christian Iseli
  0 siblings, 0 replies; 36+ messages in thread
From: Christian Iseli @ 1997-10-20  0:24 UTC (permalink / raw)
  To: jbuck, rth, meissner; +Cc: egcs

> Some of the GCC ports I've done, even 2% is unacceptable (when you only have
> 32k or whatever, it does become critical not to have extra overhead).

My feeling, exactly.
					Christian

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re: exception handling poll
@ 1997-10-19  8:27 meissner
  0 siblings, 0 replies; 36+ messages in thread
From: meissner @ 1997-10-19  8:27 UTC (permalink / raw)
  To: joel; +Cc: egcs, rth

| On Sat, 18 Oct 1997 meissner@cygnus.com wrote:
| 
| > Also, if you are using a newlib based printf, note there are the functions:
| > 
| > 	iprintf
| > 	fiprintf
| > 	siprintf
| > 	viprintf
| > 	vfiprintf
| > 	vsiprintf
| > 
| > that do not include any floating point support (which also cuts down on the
| > size).
| 
| I have resisted using the integer versions since they are non-standard.  I
| suppose that there is actually justification for using them in this case
| though.  RTEMS is pretty much in bed with newlib these days. :)

You could always do it via #defines (#define printf iprintf), either via the
Makefile, or in a header file.  You should make sure they get definitions,
including the format attribute, since some ABI's use a different calling
sequence for ... functions.

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re: exception handling poll
@ 1997-10-18  7:37 meissner
  1997-10-18  8:53 ` Joel Sherrill
  0 siblings, 1 reply; 36+ messages in thread
From: meissner @ 1997-10-18  7:37 UTC (permalink / raw)
  To: joel, rth; +Cc: egcs

| On Fri, Oct 17, 1997 at 12:43:32PM -0500, Joel Sherrill wrote:
| > > | The PPC problem is probably more difficult to address.  The code generate
| > > | for vfprintf saves an FP regsiter in the prolog because of the path for FP
| > > | numbers.  So even if you do not print an FP number, you still end up
| > > | touching the FPU.
| 
| Seems to me the way to handle this is to call out to another function
| to do the actual fp i/o.  Since we're talking about vfprintf, an interface
| as simple as
| 
|   void do_fp_printf(FILE *f, int width, int prec, char fmt, va_list *arg)
| 
| should cover all the cases.  It is also now easy to ifdef it out, which
| could be nice for the embedded folks.

Also, if you are using a newlib based printf, note there are the functions:

	iprintf
	fiprintf
	siprintf
	viprintf
	vfiprintf
	vsiprintf

that do not include any floating point support (which also cuts down on the
size).

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re: exception handling poll
@ 1997-10-16 20:28 meissner
  1997-10-17  2:51 ` Robin Kirkham
  1997-10-17 15:05 ` Joe Buck
  0 siblings, 2 replies; 36+ messages in thread
From: meissner @ 1997-10-16 20:28 UTC (permalink / raw)
  To: jbuck, rth; +Cc: egcs

| If the .eh_frame section does not get paged into memory, then I think 10% is
| acceptable (remember that the in-memory penalty is essentially zero).  For
| kernels or embedded code where there is no paging, the acceptable figure
| is smaller, and I suspect that folks would use -fno-exceptions no matter
| how small the penalty is (unless it is 2% or less).

Some of the GCC ports I've done, even 2% is unacceptable (when you only have
32k or whatever, it does become critical not to have extra overhead).

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re:  exception handling poll
@ 1997-10-16 15:19 meissner
  1997-10-16 15:19 ` Richard Henderson
  1997-10-17  7:08 ` Horst von Brand
  0 siblings, 2 replies; 36+ messages in thread
From: meissner @ 1997-10-16 15:19 UTC (permalink / raw)
  To: egcs, rth

| A little poll for those that have been complaining about 
| exception handling frame unwind info being included for C:
| 
|   Assuming the .eh_frame section is completely read-only, at what
|   eh/text ratio would you find it acceptible that that information
|   is always there?
| 
| Can you live with 10%?  8?  5?  3?

For many embedded users, the answer is 0.

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re: exception handling poll
@ 1997-10-16 15:19 meissner
  0 siblings, 0 replies; 36+ messages in thread
From: meissner @ 1997-10-16 15:19 UTC (permalink / raw)
  To: meissner, rth; +Cc: egcs

| That's begging the question.  Embedded users and the kernel live in
| a completely separate world than paged user-mode applications.

I'm trying to point out that they are a class of users and shouldn't be
ignored.

^ permalink raw reply	[flat|nested] 36+ messages in thread
* exception handling poll
@ 1997-10-16  8:31 Richard Henderson
  1997-10-16 15:19 ` Joe Buck
                   ` (3 more replies)
  0 siblings, 4 replies; 36+ messages in thread
From: Richard Henderson @ 1997-10-16  8:31 UTC (permalink / raw)
  To: egcs

A little poll for those that have been complaining about 
exception handling frame unwind info being included for C:

  Assuming the .eh_frame section is completely read-only, at what
  eh/text ratio would you find it acceptible that that information
  is always there?

Can you live with 10%?  8?  5?  3?


----------------------------

I was having a look at a "random" nice large program this evening,
f771, and trying to work out how big the frame info would be
assuming ideal generation.

Some basic numbers: 1533276 bytes text, 4210 functions.

The dwarf2 frame info requires 16 bytes/function static overhead for
eh info length, cie address, function address, and function length. 
For f771, that brings us up to a few more than 67k, or 4.4% even before
adding any actual information.

Depending on how the initial_information insn bits in the CIE is
interpreted, this could potentially encode all the information for 
all x86 with 3 CIEs.  Which means about 60 more bytes.  It would 
seem then, that somewhere around 4.5% is the best we could possibly
do on f771 with dwarf2 frame info. 

(I suppose some more large program data points would be good.  Anyone
have x86 glibc handy compiled with eh info?)

Now, with the current adv4/cfa_ofs/adv4/cfa_reg sequence on x86 to set
up the frame pointer, this eats up another 60204 bytes, 43366 of which
is in the adv4's.  Assuming we knew we could reduce these to adv, we'd
reduce that 43k to 8673 for a total of 25511.  Relaxing rigour for a
moment, changing to def_cfa would total 12630.  Adding these to our
base totals, we get 6.0% and 5.2% respectively.

Recording one saved register is adv/ofs for 1+2 bytes; recording two
or three (there are only 3 saved regs not including bp), takes 4.  Add
this in to our running total and we get 6.04% min and 7.16% max.

This 7.2% number is interesting because I think it is about as good as
can theoretically be done without linker help; assistance from within
the assembler doesn't help.  What would be required to get here is exact
length attributes on the insns in the i386.md file.  

With an inexact but bounding length attribute, we could minimize the
current lossage above this number from 4*3 to 1*3 bytes/FDE.  This would
make for about 8.0% on the running total.

So.  Given the number I posted last night at 12.5%, a patch I put 
together this evening that yields about 11% on x86, a rock-bottom
minimum somewhere between 4.5 and 6% (depending on other constraints)
and the fact that the sparc port is already down at 5.4%:

  Is it worth spending the effort required to get that last 5%,
  possibly by requiring a new version of gnu ld?  Or would I just
  be wasting my time since the overhead would still be considered 
  unacceptible?
  


r~

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

end of thread, other threads:[~1997-10-26 19:34 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-17 11:46 exception handling poll meissner
1997-10-17 14:36 ` Joel Sherrill
1997-10-17 20:51   ` David Edelsohn
1997-10-18  8:53     ` Joel Sherrill
1997-10-17 20:51   ` Richard Henderson
1997-10-18  8:53     ` Joel Sherrill
  -- strict thread matches above, loose matches on Subject: below --
1997-10-20  0:24 Christian Iseli
1997-10-19  8:27 meissner
1997-10-18  7:37 meissner
1997-10-18  8:53 ` Joel Sherrill
1997-10-16 20:28 meissner
1997-10-17  2:51 ` Robin Kirkham
1997-10-17  5:58   ` Joel Sherrill
1997-10-17 15:05 ` Joe Buck
1997-10-26 19:34   ` Robin Kirkham
1997-10-16 15:19 meissner
1997-10-16 15:19 ` Richard Henderson
1997-10-17  7:08 ` Horst von Brand
1997-10-17 12:50   ` Joe Buck
1997-10-17 13:22   ` Richard Henderson
1997-10-20  6:46     ` Horst von Brand
1997-10-16 15:19 meissner
1997-10-16  8:31 Richard Henderson
1997-10-16 15:19 ` Joe Buck
1997-10-16 15:19 ` Joern Rennecke
1997-10-16 15:19   ` Richard Henderson
1997-10-16 23:09 ` Oleg Krivosheev
1997-10-17 14:36   ` Stephen Williams
1997-10-17 20:51     ` Oleg Krivosheev
1997-10-17  6:41 ` John Carr
1997-10-17 15:05   ` Joe Buck
1997-10-17 14:36     ` Richard Henderson
1997-10-17 19:44     ` John Carr
1997-10-19 19:40       ` Per Bothner
1997-10-20  5:45         ` John Carr
1997-10-17 15:05   ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).