diff options
| author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2026-02-12 00:00:00 +0000 |
|---|---|---|
| committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2026-02-12 17:38:49 +0500 |
| commit | 839151eaaad24771892afaae6bac690e31e58384 (patch) | |
| tree | e292449d621f7a1d503b975984a2aca240dd2d8f /C/CpuArch.h | |
| parent | 5e96a8279489832924056b1fa82f29d5837c9469 (diff) | |
| download | 7zip-26.00.tar.gz 7zip-26.00.tar.bz2 7zip-26.00.zip | |
Diffstat (limited to 'C/CpuArch.h')
| -rw-r--r-- | C/CpuArch.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/C/CpuArch.h b/C/CpuArch.h index 1690a5b..c682720 100644 --- a/C/CpuArch.h +++ b/C/CpuArch.h | |||
| @@ -31,7 +31,12 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. | |||
| 31 | #define MY_CPU_NAME "x32" | 31 | #define MY_CPU_NAME "x32" |
| 32 | #define MY_CPU_SIZEOF_POINTER 4 | 32 | #define MY_CPU_SIZEOF_POINTER 4 |
| 33 | #else | 33 | #else |
| 34 | #define MY_CPU_NAME "x64" | 34 | #if defined(__APX_EGPR__) || defined(__EGPR__) |
| 35 | #define MY_CPU_NAME "x64-apx" | ||
| 36 | #define MY_CPU_AMD64_APX | ||
| 37 | #else | ||
| 38 | #define MY_CPU_NAME "x64" | ||
| 39 | #endif | ||
| 35 | #define MY_CPU_SIZEOF_POINTER 8 | 40 | #define MY_CPU_SIZEOF_POINTER 8 |
| 36 | #endif | 41 | #endif |
| 37 | #define MY_CPU_64BIT | 42 | #define MY_CPU_64BIT |
| @@ -596,8 +601,20 @@ problem-4 : performace: | |||
| 596 | #define SetBe32a(p, v) { *(UInt32 *)(void *)(p) = (v); } | 601 | #define SetBe32a(p, v) { *(UInt32 *)(void *)(p) = (v); } |
| 597 | #define SetBe16a(p, v) { *(UInt16 *)(void *)(p) = (v); } | 602 | #define SetBe16a(p, v) { *(UInt16 *)(void *)(p) = (v); } |
| 598 | 603 | ||
| 604 | // gcc and clang for powerpc can transform load byte access to load reverse word access. | ||
| 605 | // sp we can use byte access instead of word access. Z7_BSWAP64 cab be slow | ||
| 606 | #if 1 && defined(Z7_CPU_FAST_BSWAP_SUPPORTED) && defined(MY_CPU_64BIT) | ||
| 607 | #define GetUi64a(p) Z7_BSWAP64 (*(const UInt64 *)(const void *)(p)) | ||
| 608 | #else | ||
| 599 | #define GetUi64a(p) GetUi64(p) | 609 | #define GetUi64a(p) GetUi64(p) |
| 610 | #endif | ||
| 611 | |||
| 612 | #if 1 && defined(Z7_CPU_FAST_BSWAP_SUPPORTED) | ||
| 613 | #define GetUi32a(p) Z7_BSWAP32 (*(const UInt32 *)(const void *)(p)) | ||
| 614 | #else | ||
| 600 | #define GetUi32a(p) GetUi32(p) | 615 | #define GetUi32a(p) GetUi32(p) |
| 616 | #endif | ||
| 617 | |||
| 601 | #define GetUi16a(p) GetUi16(p) | 618 | #define GetUi16a(p) GetUi16(p) |
| 602 | #define SetUi32a(p, v) SetUi32(p, v) | 619 | #define SetUi32a(p, v) SetUi32(p, v) |
| 603 | #define SetUi16a(p, v) SetUi16(p, v) | 620 | #define SetUi16a(p, v) SetUi16(p, v) |
