This is the mail archive of the
mailing list for the newlib project.
Re: [PATCH] Reduce RAM usage of floating point conversion functions
- From: Freddie Chopin <freddie_chopin at op dot pl>
- To: newlib at sourceware dot org
- Date: Mon, 10 Jun 2013 11:29:19 +0200
- Subject: Re: [PATCH] Reduce RAM usage of floating point conversion functions
- References: <BLU0-SMTP19283F8FCD7F4905FE47D85F99B0 at phx dot gbl> <51B5838F dot 5050404 at op dot pl> <BLU0-SMTP348F3478D506A1E201F25D8F9840 at phx dot gbl>
W dniu 2013-06-10 11:12, Federico Terraneo pisze:
I did think about that, but this moves 256 bytes of .bss to 256 bytes
of .rodata, i.e. it would take up that amount of FLASH on a
microcontroller, and the table is mostly filled with zeros, which
still seems a waste.
Here is a patch that goes in that direction:
if PREFER_SIZE_OVER_SPEED, __OPTIMIZE_SIZE__ or _SMALL_HEXDIG are
defined, the table is still replaced with a function, otherwise the
table is made const (but not static, since it's used also in another
file). In this way in both cases 256 bytes of RAM are saved, and in
the former also 256 bytes of FLASH.
But one thing - is the patch correct? You define a macro
__check_hexdig(), and in the code you use __get_hexdig(), which I cannot
BTW - could you check what's the size of the new function you introduced
(__hexdig_fun())? If it's not smaller than this 256B array than this is
not a size optimization (;