Download chips/yosys/libs/fst/00_PATCH_strict_alignment.patch from STAR-future/Trinity-SciData: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/libs/fst/00_PATCH_strict_alignment.patch
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SciData/chips/yosys/libs/fst/00_PATCH_strict_alignment.patch
-
curl -L -o 00_PATCH_strict_alignment.patch https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/libs/fst/00_PATCH_strict_alignment.patch
1.3 kB
| diff --git a/fastlz.cc b/fastlz.cc | |
| index 3272ca7a8..41ea27a16 100644 | |
| --- a/fastlz.cc | |
| +++ b/fastlz.cc | |
| #endif | |
| /* | |
| - * Prevent accessing more than 8-bit at once, except on x86 architectures. | |
| + * Yosys patch: do not do unaligned accesses on any platform | |
| */ | |
| -#if !defined(FASTLZ_STRICT_ALIGN) | |
| #define FASTLZ_STRICT_ALIGN | |
| -#if defined(__i386__) || defined(__386) /* GNU C, Sun Studio */ | |
| -#undef FASTLZ_STRICT_ALIGN | |
| -#elif defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__amd64) /* GNU C */ | |
| -#undef FASTLZ_STRICT_ALIGN | |
| -#elif defined(_M_IX86) /* Intel, MSVC */ | |
| -#undef FASTLZ_STRICT_ALIGN | |
| -#elif defined(__386) | |
| -#undef FASTLZ_STRICT_ALIGN | |
| -#elif defined(_X86_) /* MinGW */ | |
| -#undef FASTLZ_STRICT_ALIGN | |
| -#elif defined(__I86__) /* Digital Mars */ | |
| -#undef FASTLZ_STRICT_ALIGN | |
| -#endif | |
| -#endif | |
| /* prototypes */ | |
| int fastlz_compress(const void* input, int length, void* output); | |
| int fastlz_decompress(const void* input, int length, void* output, int maxout); | |
| #define MAX_LEN 264 /* 256 + 8 */ | |
| #define MAX_DISTANCE 8192 | |
| -#if !defined(FASTLZ_STRICT_ALIGN) | |
| -#define FASTLZ_READU16(p) *((const flzuint16*)(p)) | |
| -#else | |
| #define FASTLZ_READU16(p) ((p)[0] | (p)[1]<<8) | |
| -#endif | |
| #define HASH_LOG 13 | |
| #define HASH_SIZE (1<< HASH_LOG) | |