diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2022-09-19 19:34:56 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2022-09-19 20:23:46 +0300 |
commit | ecb966de308c255bb4735a7307ef9901c643a9de (patch) | |
tree | 2f590bc34e34fdc8388cbe106fff4d281d88f409 /src/liblzma/api/lzma/bcj.h | |
parent | liblzma: Simple/BCJ filters: Allow disabling generic BCJ options. (diff) | |
download | xz-ecb966de308c255bb4735a7307ef9901c643a9de.tar.xz |
liblzma: Add experimental ARM64 BCJ filter with a temporary Filter ID.
That is, the Filter ID will be changed once the design is final.
The current version will be removed. So files created with the
tempoary Filter ID won't be supported in the future.
Diffstat (limited to 'src/liblzma/api/lzma/bcj.h')
-rw-r--r-- | src/liblzma/api/lzma/bcj.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/liblzma/api/lzma/bcj.h b/src/liblzma/api/lzma/bcj.h index 8e37538a..ba6cacb9 100644 --- a/src/liblzma/api/lzma/bcj.h +++ b/src/liblzma/api/lzma/bcj.h @@ -49,9 +49,16 @@ * Filter for SPARC binaries. */ +#define LZMA_FILTER_ARM64 LZMA_VLI_C(0x3FDB87B33B27000B) + /**< + * Filter for ARM64 binaries. + * + * \note Unlike the older filters above, this doesn't + * support any options (must be NULL). + */ /** - * \brief Options for BCJ filters + * \brief Options for BCJ filters (except ARM64) * * The BCJ filters never change the size of the data. Specifying options * for them is optional: if pointer to options is NULL, default value is @@ -88,3 +95,29 @@ typedef struct { uint32_t start_offset; } lzma_options_bcj; + +/** + * \brief Options for the ARM64 filter + * + * This filter never changes the size of the data. + * Specifying options is mandatory. + */ +typedef struct { + /** + * \brief How wide range of relative addresses are converted + * + * The ARM64 BL instruction has 26-bit immediate field that encodes + * a relative address as a multiple of four bytes, so the effective + * range is 2^28 bytes (+/-128 MiB). + * + * If width is 28 bits (LZMA_ARM64_WIDTH_MAX), then all BL + * instructions will be converted. This has a downside of some + * false matches that make compression worse. The best value + * depends on the input file and the differences can be significant; + * with large executables the maximum value is sometimes the best. + */ + uint32_t width; +# define LZMA_ARM64_WIDTH_MIN 18 +# define LZMA_ARM64_WIDTH_MAX 28 +# define LZMA_ARM64_WIDTH_DEFAULT 26 +} lzma_options_arm64; |