diff options
-rw-r--r-- | src/lib/Kconfig | 7 | ||||
-rw-r--r-- | src/lib/lzmadecode.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/Kconfig b/src/lib/Kconfig index 014230012d..ae96fc61ee 100644 --- a/src/lib/Kconfig +++ b/src/lib/Kconfig @@ -114,3 +114,10 @@ config CBFS_PRELOAD in the background before they are actually required. This feature depends on the read-only boot_device having a DMA controller to perform the background transfer. + +config DECOMPRESS_OFAST + bool + depends on COMPILER_GCC + default y + help + Compile the decompressing function in -Ofast instead of standard -Os diff --git a/src/lib/lzmadecode.c b/src/lib/lzmadecode.c index c45e131708..cb868290aa 100644 --- a/src/lib/lzmadecode.c +++ b/src/lib/lzmadecode.c @@ -19,6 +19,12 @@ to this file, however, are subject to the LGPL or CPL terms. */ +#if CONFIG(DECOMPRESS_OFAST) + #define __lzma_attribute_Ofast__ __attribute__((optimize("Ofast"))) +#else + #define __lzma_attribute_Ofast__ +#endif + #include "lzmadecode.h" #include <types.h> @@ -183,6 +189,7 @@ int LzmaDecodeProperties(CLzmaProperties *propsRes, #define kLzmaStreamWasFinishedId (-1) +__lzma_attribute_Ofast__ int LzmaDecode(CLzmaDecoderState *vs, const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed) |