Skip to content

Commit

Permalink
fix: add missed subr
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Jan 16, 2025
1 parent 4524250 commit c30537f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions base64x_subr_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@


package base64x

import (
"github.com/cloudwego/base64x/internal/native"
)

// HACK: maintain these only to prevent breakchange, because sonic-go linkname these
var (
_subr__b64decode uintptr
_subr__b64encode uintptr
)

func init() {
_subr__b64decode = native.S_b64decode
_subr__b64encode = native.S_b64encode
}
2 changes: 1 addition & 1 deletion native/native.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static always_inline void do_b64encode(struct slice_t *out, const struct slice_t

/* SIMD 24 bytes loop, but the SIMD instruction will load 4 bytes
* past the end, so it's safe only if there are 28 bytes or more left */
#ifdef USE_AVX2
#ifdef __AVX2__
while (ip <= ie - 28) {
__m128i v0 = _mm_loadu_si128 (as_m128c(ip));
__m128i v1 = _mm_loadu_si128 (as_m128c(ip + 12));
Expand Down

0 comments on commit c30537f

Please sign in to comment.