| 1 |
//go:build arm64 && !appengine && !noasm && gc |
| 2 |
|
| 3 |
package zstd |
| 4 |
|
| 5 |
// The shared decode/decodeSync/executeSimple wrappers and context structs live |
| 6 |
// in seqdec_asm.go; this file only declares the arm64 asm routines (generated |
| 7 |
// by the avo arm64 lowering printer) and the dispatch helpers. arm64 has no |
| 8 |
// BMI2, so each helper selects only between the 56-bit / safe variants. |
| 9 |
|
| 10 |
// sequenceDecs_decode_arm64 implements the main loop of sequenceDecs in arm64 asm. |
| 11 |
// |
| 12 |
// Please refer to seqdec_generic.go for the reference implementation. |
| 13 |
// |
| 14 |
//go:noescape |
| 15 |
func sequenceDecs_decode_arm64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int |
| 16 |
|
| 17 |
// sequenceDecs_decode_56_arm64 implements the main loop of sequenceDecs in arm64 asm. |
| 18 |
// |
| 19 |
//go:noescape |
| 20 |
func sequenceDecs_decode_56_arm64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int |
| 21 |
|
| 22 |
// decodeAsm runs the sequenceDecs decode loop, choosing the 56-bit variant. |
| 23 |
func decodeAsm(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext, lte56bits bool) int { |
| 24 |
if lte56bits { |
| 25 |
return sequenceDecs_decode_56_arm64(s, br, ctx) |
| 26 |
} |
| 27 |
return sequenceDecs_decode_arm64(s, br, ctx) |
| 28 |
} |
| 29 |
|
| 30 |
// sequenceDecs_decodeSync_arm64 implements the main loop of sequenceDecs.decodeSync in arm64 asm. |
| 31 |
// |
| 32 |
// Please refer to seqdec_generic.go for the reference implementation. |
| 33 |
// |
| 34 |
//go:noescape |
| 35 |
func sequenceDecs_decodeSync_arm64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int |
| 36 |
|
| 37 |
// sequenceDecs_decodeSync_safe_arm64 does the same as above, but does not write more than output buffer. |
| 38 |
// |
| 39 |
//go:noescape |
| 40 |
func sequenceDecs_decodeSync_safe_arm64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int |
| 41 |
|
| 42 |
// decodeSyncAsm runs the decodeSync loop, choosing the safe variant. |
| 43 |
func decodeSyncAsm(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext, safe bool) int { |
| 44 |
if safe { |
| 45 |
return sequenceDecs_decodeSync_safe_arm64(s, br, ctx) |
| 46 |
} |
| 47 |
return sequenceDecs_decodeSync_arm64(s, br, ctx) |
| 48 |
} |
| 49 |
|
| 50 |
// sequenceDecs_executeSimple_arm64 implements the main loop of sequenceDecs.executeSimple in arm64 asm. |
| 51 |
// |
| 52 |
// Returns false if a match offset is too big. |
| 53 |
// |
| 54 |
// Please refer to seqdec_generic.go for the reference implementation. |
| 55 |
// |
| 56 |
//go:noescape |
| 57 |
func sequenceDecs_executeSimple_arm64(ctx *executeAsmContext) bool |
| 58 |
|
| 59 |
// Same as above, but with safe memcopies |
| 60 |
// |
| 61 |
//go:noescape |
| 62 |
func sequenceDecs_executeSimple_safe_arm64(ctx *executeAsmContext) bool |
| 63 |
|
| 64 |
// executeSimpleAsm runs the executeSimple loop, choosing the safe variant. |
| 65 |
func executeSimpleAsm(ctx *executeAsmContext, safe bool) bool { |
| 66 |
if safe { |
| 67 |
return sequenceDecs_executeSimple_safe_arm64(ctx) |
| 68 |
} |
| 69 |
return sequenceDecs_executeSimple_arm64(ctx) |
| 70 |
} |