mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
std/xz: implement apply_filter_05_powerpc
This commit is contained in:
1 parent
d2a63a7e34
commit
30133ad4b2
8 files changed
+91
No files matched your search
@@ -55,6 +55,7 @@ OK. 15a2a343 test/3pdata/xzsuite/good-1-check-crc64.xz
|
||||
OK. 15a2a343 test/3pdata/xzsuite/good-1-check-none.xz
|
||||
OK. 15a2a343 test/3pdata/xzsuite/good-1-check-sha256.xz
|
||||
OK. f7c66eb5 test/3pdata/xzsuite/good-1-delta-lzma2.tiff.xz
|
||||
OK. 00000000 test/3pdata/xzsuite/good-1-empty-bcj-lzma2.xz
|
||||
OK. db4847fb test/3pdata/xzsuite/good-1-lzma2-1.xz
|
||||
OK. db4847fb test/3pdata/xzsuite/good-1-lzma2-2.xz
|
||||
OK. db4847fb test/3pdata/xzsuite/good-1-lzma2-3.xz
|
||||
|
||||
@@ -38,6 +38,7 @@ func main1() error {
|
||||
// No test case generated for 04/x86, as the x86 CPU bytecode format is
|
||||
// complicated (variable length instructions). Test coverage is instead
|
||||
// provided by xz-tests-files's good-1-x86-lzma2.xz file.
|
||||
{"05", "powerpc", genPowerpc},
|
||||
{"07", "arm", genArm},
|
||||
{"08", "armthumb", genArmthumb},
|
||||
{"09", "sparc", genSparc},
|
||||
@@ -72,6 +73,21 @@ const pi = "3.141592653589793238462643383279502884197169399375105820974944592307
|
||||
// Call, Jump) filters. See xz-embedded's linux/lib/xz/xz_dec_bcj.c for C code
|
||||
// implementations.
|
||||
|
||||
func genPowerpc() []byte {
|
||||
b := make256Bytes()
|
||||
for i := 0; (i + 4) <= len(b); i += 4 {
|
||||
x := peekU32BE(b[i:])
|
||||
switch pi[i>>2] & 1 {
|
||||
case 0:
|
||||
x = (x & 0x03FF_FFFC) | 0x4800_0001
|
||||
default:
|
||||
continue
|
||||
}
|
||||
pokeU32BE(b[i:], x)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func genArm() []byte {
|
||||
b := make256Bytes()
|
||||
for i := range b {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -7,6 +7,7 @@ OK. b19df306 test/data/archive.tar.bz2
|
||||
OK. b19df306 test/data/archive.tar.gz
|
||||
OK. 6ddef9db test/data/artificial-bzip2/abraca.txt.bz2
|
||||
OK. 6ddef9db test/data/artificial-bzip2/huffman-258.bz2
|
||||
OK. fa3907fb test/data/artificial-xz-filter/xz-filter-05-fa3907fb-powerpc.dat.xz
|
||||
OK. 9a3fb8ae test/data/artificial-xz-filter/xz-filter-07-9a3fb8ae-arm.dat.xz
|
||||
OK. 84e8999d test/data/artificial-xz-filter/xz-filter-08-84e8999d-armthumb.dat.xz
|
||||
OK. 0353bd24 test/data/artificial-xz-filter/xz-filter-09-0353bd24-sparc.dat.xz
|
||||
|
||||
Reference in new issue
Block a user