From 1adf0d08b8a5fd8fc04491d77efab72eee343b7c Mon Sep 17 00:00:00 2001 From: "duanyi.aster" Date: Thu, 1 Feb 2024 01:23:39 +0800 Subject: [PATCH] reserve x28 --- internal/native/neon/f32toa_arm64.s | 10 +-- internal/native/neon/f32toa_subr_arm64.go | 2 +- internal/native/neon/f64toa_arm64.s | 10 +-- internal/native/neon/f64toa_subr_arm64.go | 2 +- ...tfloat_arm64_test.go => fastfloat_test.go} | 0 ...{fastint_arm64_test.go => fastint_test.go} | 0 internal/native/neon/get_by_path_arm64.s | 8 +- .../native/neon/get_by_path_subr_arm64.go | 2 +- internal/native/neon/html_escape_arm64.s | 8 +- .../native/neon/html_escape_subr_arm64.go | 2 +- internal/native/neon/i64toa_arm64.s | 8 +- internal/native/neon/i64toa_subr_arm64.go | 2 +- internal/native/neon/lspace_arm64.s | 8 +- internal/native/neon/lspace_subr_arm64.go | 2 +- internal/native/neon/native_arm64_test.go | 36 ++++---- internal/native/neon/quote_arm64.s | 8 +- internal/native/neon/quote_subr_arm64.go | 2 +- internal/native/neon/recover_arm64_test.go | 10 +-- internal/native/neon/skip_array_arm64.s | 8 +- internal/native/neon/skip_array_subr_arm64.go | 2 +- internal/native/neon/skip_number_arm64.s | 8 +- .../native/neon/skip_number_subr_arm64.go | 2 +- internal/native/neon/skip_object_arm64.s | 8 +- .../native/neon/skip_object_subr_arm64.go | 2 +- internal/native/neon/skip_one_arm64.s | 8 +- internal/native/neon/skip_one_fast_arm64.s | 8 +- .../native/neon/skip_one_fast_subr_arm64.go | 2 +- internal/native/neon/skip_one_subr_arm64.go | 2 +- internal/native/neon/u64toa_arm64.s | 8 +- internal/native/neon/u64toa_subr_arm64.go | 2 +- internal/native/neon/unquote_arm64.s | 8 +- internal/native/neon/unquote_subr_arm64.go | 2 +- internal/native/neon/validate_one_arm64.s | 8 +- .../native/neon/validate_one_subr_arm64.go | 2 +- internal/native/neon/validate_utf8_arm64.s | 8 +- .../native/neon/validate_utf8_fast_arm64.s | 8 +- .../neon/validate_utf8_fast_subr_arm64.go | 2 +- .../native/neon/validate_utf8_subr_arm64.go | 2 +- internal/native/neon/value_arm64.s | 8 +- internal/native/neon/value_subr_arm64.go | 2 +- internal/native/neon/vnumber_arm64.s | 8 +- internal/native/neon/vnumber_subr_arm64.go | 2 +- internal/native/neon/vsigned_arm64.s | 8 +- internal/native/neon/vsigned_subr_arm64.go | 2 +- internal/native/neon/vstring_arm64.s | 8 +- internal/native/neon/vstring_subr_arm64.go | 2 +- internal/native/neon/vunsigned_arm64.s | 8 +- internal/native/neon/vunsigned_subr_arm64.go | 2 +- tools/asm2arm/arm.py | 85 +++++++++---------- 49 files changed, 177 insertions(+), 178 deletions(-) rename internal/native/neon/{fastfloat_arm64_test.go => fastfloat_test.go} (100%) rename internal/native/neon/{fastint_arm64_test.go => fastint_test.go} (100%) diff --git a/internal/native/neon/f32toa_arm64.s b/internal/native/neon/f32toa_arm64.s index fff239bb5..035b0f8ea 100644 --- a/internal/native/neon/f32toa_arm64.s +++ b/internal/native/neon/f32toa_arm64.s @@ -7,9 +7,7 @@ TEXT ·__f32toa_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _f32toa: WORD $0x1e260009 // fmov w9, s0 @@ -902,7 +900,7 @@ _Digits: WORD $0x37393639 // .ascii 4, '96979899' WORD $0x39393839 // .ascii 4, '9899' WORD $0x00000000 // .p2align 3, 0x00 -_LB_412ab4da: // _pow10_ceil_sig_f32.g +_LB_9ffba3ae: // _pow10_ceil_sig_f32.g WORD $0x4b43fcf5; WORD $0x81ceb32c // .quad -9093133594791772939 WORD $0x5e14fc32; WORD $0xa2425ff7 // .quad -6754730975062328270 WORD $0x359a3b3f; WORD $0xcad2f7f5 // .quad -3831727700400522433 @@ -981,7 +979,7 @@ _LB_412ab4da: // _pow10_ceil_sig_f32.g WORD $0x7bea5c70; WORD $0x8f7e32ce // .quad -8106986416796705680 WORD $0x1ae4f38c; WORD $0xb35dbf82 // .quad -5522047002568494196 -TEXT ·__f32toa(SB), $0-24 +TEXT ·__f32toa(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -993,7 +991,9 @@ _entry: _f32toa: MOVD out+0(FP), R0 FMOVD val+8(FP), F0 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__f32toa_entry__+16(SB) // _f32toa + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+16(FP) RET diff --git a/internal/native/neon/f32toa_subr_arm64.go b/internal/native/neon/f32toa_subr_arm64.go index a30a7ce02..df71102ac 100644 --- a/internal/native/neon/f32toa_subr_arm64.go +++ b/internal/native/neon/f32toa_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __f32toa_entry__() uintptr var ( - _subr__f32toa uintptr = 16 + _subr__f32toa uintptr = 0 ) const ( diff --git a/internal/native/neon/f64toa_arm64.s b/internal/native/neon/f64toa_arm64.s index 2a554fa47..5112840c0 100644 --- a/internal/native/neon/f64toa_arm64.s +++ b/internal/native/neon/f64toa_arm64.s @@ -7,9 +7,7 @@ TEXT ·__f64toa_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _f64toa: WORD $0x9e660009 // fmov x9, d0 @@ -1220,7 +1218,7 @@ _Digits: WORD $0x37393639 // .ascii 4, '96979899' WORD $0x39393839 // .ascii 4, '9899' // .p2align 3, 0x00 -_LB_9b3e13db: // _pow10_ceil_sig.g +_LB_03fda5ca: // _pow10_ceil_sig.g WORD $0xbebcdc4f; WORD $0xff77b1fc // .quad -38366372719436721 WORD $0x13bb0f7b; WORD $0x25e8e89c // .quad 2731688931043774331 WORD $0xf73609b1; WORD $0x9faacf3d // .quad -6941508010590729807 @@ -2456,7 +2454,7 @@ _LB_9b3e13db: // _pow10_ceil_sig.g WORD $0xb4e31ba9; WORD $0x9e19db92 // .quad -7054365918152680535 WORD $0x6a8346d2; WORD $0x6c07a2c2 // .quad 7784369436827535058 -TEXT ·__f64toa(SB), $0-24 +TEXT ·__f64toa(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -2468,7 +2466,9 @@ _entry: _f64toa: MOVD out+0(FP), R0 FMOVD val+8(FP), F0 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__f64toa_entry__+16(SB) // _f64toa + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+16(FP) RET diff --git a/internal/native/neon/f64toa_subr_arm64.go b/internal/native/neon/f64toa_subr_arm64.go index 841d0424e..f0c980647 100644 --- a/internal/native/neon/f64toa_subr_arm64.go +++ b/internal/native/neon/f64toa_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __f64toa_entry__() uintptr var ( - _subr__f64toa uintptr = 16 + _subr__f64toa uintptr = 0 ) const ( diff --git a/internal/native/neon/fastfloat_arm64_test.go b/internal/native/neon/fastfloat_test.go similarity index 100% rename from internal/native/neon/fastfloat_arm64_test.go rename to internal/native/neon/fastfloat_test.go diff --git a/internal/native/neon/fastint_arm64_test.go b/internal/native/neon/fastint_test.go similarity index 100% rename from internal/native/neon/fastint_arm64_test.go rename to internal/native/neon/fastint_test.go diff --git a/internal/native/neon/get_by_path_arm64.s b/internal/native/neon/get_by_path_arm64.s index e3609fc47..9f5c49c30 100644 --- a/internal/native/neon/get_by_path_arm64.s +++ b/internal/native/neon/get_by_path_arm64.s @@ -7,9 +7,7 @@ TEXT ·__get_by_path_entry__(SB), NOSPLIT, $192 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -4553,7 +4551,7 @@ __UnquoteTab: WORD $0x00000000 // .space 4, '\x00\x00\x00\x00\x00\x00\x00\x00' WORD $0x00000000 // .space 4, '\x00\x00\x00\x00' -TEXT ·__get_by_path(SB), $0-40 +TEXT ·__get_by_path(SB), NOSPLIT, $0-40 NO_LOCAL_POINTERS _entry: @@ -4567,7 +4565,9 @@ _get_by_path: MOVD p+8(FP), R1 MOVD path+16(FP), R2 MOVD m+24(FP), R3 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__get_by_path_entry__+64(SB) // _get_by_path + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+32(FP) RET diff --git a/internal/native/neon/get_by_path_subr_arm64.go b/internal/native/neon/get_by_path_subr_arm64.go index bf9945ab2..c2aca952e 100644 --- a/internal/native/neon/get_by_path_subr_arm64.go +++ b/internal/native/neon/get_by_path_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __get_by_path_entry__() uintptr var ( - _subr__get_by_path uintptr = 64 + _subr__get_by_path uintptr = 48 ) const ( diff --git a/internal/native/neon/html_escape_arm64.s b/internal/native/neon/html_escape_arm64.s index e609a7333..2227891fc 100644 --- a/internal/native/neon/html_escape_arm64.s +++ b/internal/native/neon/html_escape_arm64.s @@ -7,9 +7,7 @@ TEXT ·__html_escape_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -1376,7 +1374,7 @@ __HtmlQuoteTab: WORD $0x00000000 // .space 4, '\x00\x00\x00\x00\x00\x00\x00\x00' WORD $0x00000000 // .space 4, '\x00\x00\x00\x00' -TEXT ·__html_escape(SB), $0-40 +TEXT ·__html_escape(SB), NOSPLIT, $0-40 NO_LOCAL_POINTERS _entry: @@ -1390,7 +1388,9 @@ _html_escape: MOVD nb+8(FP), R1 MOVD dp+16(FP), R2 MOVD dn+24(FP), R3 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__html_escape_entry__+48(SB) // _html_escape + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+32(FP) RET diff --git a/internal/native/neon/html_escape_subr_arm64.go b/internal/native/neon/html_escape_subr_arm64.go index d98fc4ff8..9882fb6ad 100644 --- a/internal/native/neon/html_escape_subr_arm64.go +++ b/internal/native/neon/html_escape_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __html_escape_entry__() uintptr var ( - _subr__html_escape uintptr = 48 + _subr__html_escape uintptr = 32 ) const ( diff --git a/internal/native/neon/i64toa_arm64.s b/internal/native/neon/i64toa_arm64.s index e72f676a9..9260bca9d 100644 --- a/internal/native/neon/i64toa_arm64.s +++ b/internal/native/neon/i64toa_arm64.s @@ -7,9 +7,7 @@ TEXT ·__i64toa_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 3, 0x00 lCPI0_0: WORD $0x147b20c5 @@ -952,7 +950,7 @@ _VecShiftShuffles: WORD $0xffffffff // .ascii 4, '\xff\xff\xff\xff\xff\xff\xff\xff' WORD $0xffffffff // .ascii 4, '\xff\xff\xff\xff' -TEXT ·__i64toa(SB), $0-24 +TEXT ·__i64toa(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -964,7 +962,9 @@ _entry: _i64toa: MOVD out+0(FP), R0 MOVD val+8(FP), R1 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__i64toa_entry__+64(SB) // _i64toa + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+16(FP) RET diff --git a/internal/native/neon/i64toa_subr_arm64.go b/internal/native/neon/i64toa_subr_arm64.go index e6970363f..442305e36 100644 --- a/internal/native/neon/i64toa_subr_arm64.go +++ b/internal/native/neon/i64toa_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __i64toa_entry__() uintptr var ( - _subr__i64toa uintptr = 64 + _subr__i64toa uintptr = 48 ) const ( diff --git a/internal/native/neon/lspace_arm64.s b/internal/native/neon/lspace_arm64.s index d48ba901b..a8d688e98 100644 --- a/internal/native/neon/lspace_arm64.s +++ b/internal/native/neon/lspace_arm64.s @@ -7,9 +7,7 @@ TEXT ·__lspace_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _lspace: WORD $0xa9be7bfd // stp fp, lr, [sp, #-32]! @@ -41,7 +39,7 @@ LBB0_6: WORD $0xa8c27bfd // ldp fp, lr, [sp], #32 WORD $0xd65f03c0 // ret -TEXT ·__lspace(SB), $0-32 +TEXT ·__lspace(SB), NOSPLIT, $0-32 NO_LOCAL_POINTERS _entry: @@ -54,7 +52,9 @@ _lspace: MOVD sp+0(FP), R0 MOVD nb+8(FP), R1 MOVD off+16(FP), R2 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__lspace_entry__+16(SB) // _lspace + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+24(FP) RET diff --git a/internal/native/neon/lspace_subr_arm64.go b/internal/native/neon/lspace_subr_arm64.go index 8ce268321..89fbf2d7c 100644 --- a/internal/native/neon/lspace_subr_arm64.go +++ b/internal/native/neon/lspace_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __lspace_entry__() uintptr var ( - _subr__lspace uintptr = 16 + _subr__lspace uintptr = 0 ) const ( diff --git a/internal/native/neon/native_arm64_test.go b/internal/native/neon/native_arm64_test.go index df1246214..bd377f93f 100644 --- a/internal/native/neon/native_arm64_test.go +++ b/internal/native/neon/native_arm64_test.go @@ -35,10 +35,16 @@ import ( `github.com/stretchr/testify/require` ) +//go:noinline +func BREAK() bool { + return true +} + func TestNative_Value(t *testing.T) { var v types.JsonState s := ` -12345` p := (*rt.GoString)(unsafe.Pointer(&s)) + BREAK() x := value(p.Ptr, p.Len, 0, &v, 0) assert.Equal(t, 9, x) assert.Equal(t, types.V_INTEGER, v.Vt) @@ -236,20 +242,6 @@ func TestNative_HTMLEscapeNoMem(t *testing.T) { assert.Equal(t, `hello`, string(d)) } -func TestNative_Vstring(t *testing.T) { - var v types.JsonState - i := 0 - s := `test"test\n2"` - vstring(&s, &i, &v, 0) - assert.Equal(t, 5, i) - assert.Equal(t, -1, v.Ep) - assert.Equal(t, int64(0), v.Iv) - vstring(&s, &i, &v, 0) - assert.Equal(t, 13, i) - assert.Equal(t, 9, v.Ep) - assert.Equal(t, int64(5), v.Iv) -} - func TestNative_Vstring_ValidUnescapedChars(t *testing.T) { var v types.JsonState valid := uint64(types.F_VALIDATE_STRING) @@ -632,4 +624,18 @@ func BenchmarkNative_GetByPath(b *testing.B) { _ = get_by_path(&s, &p, &path, sm) types.FreeStateMachine(sm) } -} \ No newline at end of file +} + +func TestNative_Vstring(t *testing.T) { + var v types.JsonState + i := 0 + s := `test"test\n2"` + vstring(&s, &i, &v, 0) + assert.Equal(t, 5, i) + assert.Equal(t, -1, v.Ep) + assert.Equal(t, int64(0), v.Iv) + vstring(&s, &i, &v, 0) + assert.Equal(t, 13, i) + assert.Equal(t, 9, v.Ep) + assert.Equal(t, int64(5), v.Iv) +} diff --git a/internal/native/neon/quote_arm64.s b/internal/native/neon/quote_arm64.s index a96bd24f1..8f1f5d545 100644 --- a/internal/native/neon/quote_arm64.s +++ b/internal/native/neon/quote_arm64.s @@ -7,9 +7,7 @@ TEXT ·__quote_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -2531,7 +2529,7 @@ __EscTab: WORD $0x00000000 // .space 4, '\x00\x00\x00\x00\x00\x00\x00\x00' WORD $0x00000000 // .space 4, '\x00\x00\x00\x00' -TEXT ·__quote(SB), $0-48 +TEXT ·__quote(SB), NOSPLIT, $0-48 NO_LOCAL_POINTERS _entry: @@ -2546,7 +2544,9 @@ _quote: MOVD dp+16(FP), R2 MOVD dn+24(FP), R3 MOVD flags+32(FP), R4 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__quote_entry__+48(SB) // _quote + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+40(FP) RET diff --git a/internal/native/neon/quote_subr_arm64.go b/internal/native/neon/quote_subr_arm64.go index a13d7fcba..6f7a8162d 100644 --- a/internal/native/neon/quote_subr_arm64.go +++ b/internal/native/neon/quote_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __quote_entry__() uintptr var ( - _subr__quote uintptr = 48 + _subr__quote uintptr = 32 ) const ( diff --git a/internal/native/neon/recover_arm64_test.go b/internal/native/neon/recover_arm64_test.go index 5a8f9e1ec..970665597 100644 --- a/internal/native/neon/recover_arm64_test.go +++ b/internal/native/neon/recover_arm64_test.go @@ -20,10 +20,10 @@ package neon import ( `os` + `time` `runtime` `runtime/debug` `testing` - `time` `unsafe` `github.com/bytedance/sonic/internal/native/types` @@ -49,7 +49,7 @@ func TestMain(m *testing.M) { m.Run() } -func TestRecover_f64toa(t *testing.T) { +func TestRecover_f32toa(t *testing.T) { defer func() { if r := recover(); r!= nil { t.Log("recover: ", r) @@ -57,10 +57,10 @@ func TestRecover_f64toa(t *testing.T) { t.Fatal("no panic") } }() - _ = f64toa(nil, 123) + _ = f32toa(nil, 123) } -func TestRecover_f32toa(t *testing.T) { +func TestRecover_f64toa(t *testing.T) { defer func() { if r := recover(); r!= nil { t.Log("recover: ", r) @@ -68,7 +68,7 @@ func TestRecover_f32toa(t *testing.T) { t.Fatal("no panic") } }() - _ = f32toa(nil, 123) + _ = f64toa(nil, 123) } func TestRecover_i64toa(t *testing.T) { diff --git a/internal/native/neon/skip_array_arm64.s b/internal/native/neon/skip_array_arm64.s index 69ae8772e..9986d49a5 100644 --- a/internal/native/neon/skip_array_arm64.s +++ b/internal/native/neon/skip_array_arm64.s @@ -7,9 +7,7 @@ TEXT ·__skip_array_entry__(SB), NOSPLIT, $96 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x00000001; WORD $0x00000000 // .quad 1 @@ -2356,7 +2354,7 @@ LBB0_430: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__skip_array(SB), $0-40 +TEXT ·__skip_array(SB), NOSPLIT, $0-40 NO_LOCAL_POINTERS _entry: @@ -2370,7 +2368,9 @@ _skip_array: MOVD p+8(FP), R1 MOVD m+16(FP), R2 MOVD flags+24(FP), R3 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__skip_array_entry__+64(SB) // _skip_array + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+32(FP) RET diff --git a/internal/native/neon/skip_array_subr_arm64.go b/internal/native/neon/skip_array_subr_arm64.go index 4622043d6..96ce7fdfc 100644 --- a/internal/native/neon/skip_array_subr_arm64.go +++ b/internal/native/neon/skip_array_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __skip_array_entry__() uintptr var ( - _subr__skip_array uintptr = 64 + _subr__skip_array uintptr = 48 ) const ( diff --git a/internal/native/neon/skip_number_arm64.s b/internal/native/neon/skip_number_arm64.s index 816a95f8e..232bb8072 100644 --- a/internal/native/neon/skip_number_arm64.s +++ b/internal/native/neon/skip_number_arm64.s @@ -7,9 +7,7 @@ TEXT ·__skip_number_entry__(SB), NOSPLIT, $32 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -349,7 +347,7 @@ LBB0_60: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__skip_number(SB), $0-24 +TEXT ·__skip_number(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -361,7 +359,9 @@ _entry: _skip_number: MOVD s+0(FP), R0 MOVD p+8(FP), R1 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__skip_number_entry__+48(SB) // _skip_number + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+16(FP) RET diff --git a/internal/native/neon/skip_number_subr_arm64.go b/internal/native/neon/skip_number_subr_arm64.go index 074ea8356..e0ff6f5b1 100644 --- a/internal/native/neon/skip_number_subr_arm64.go +++ b/internal/native/neon/skip_number_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __skip_number_entry__() uintptr var ( - _subr__skip_number uintptr = 48 + _subr__skip_number uintptr = 32 ) const ( diff --git a/internal/native/neon/skip_object_arm64.s b/internal/native/neon/skip_object_arm64.s index 8264d0660..7ff58bdd8 100644 --- a/internal/native/neon/skip_object_arm64.s +++ b/internal/native/neon/skip_object_arm64.s @@ -7,9 +7,7 @@ TEXT ·__skip_object_entry__(SB), NOSPLIT, $96 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x00000001; WORD $0x00000000 // .quad 1 @@ -2356,7 +2354,7 @@ LBB0_430: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__skip_object(SB), $0-40 +TEXT ·__skip_object(SB), NOSPLIT, $0-40 NO_LOCAL_POINTERS _entry: @@ -2370,7 +2368,9 @@ _skip_object: MOVD p+8(FP), R1 MOVD m+16(FP), R2 MOVD flags+24(FP), R3 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__skip_object_entry__+64(SB) // _skip_object + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+32(FP) RET diff --git a/internal/native/neon/skip_object_subr_arm64.go b/internal/native/neon/skip_object_subr_arm64.go index 0f20e72bc..e526aeb93 100644 --- a/internal/native/neon/skip_object_subr_arm64.go +++ b/internal/native/neon/skip_object_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __skip_object_entry__() uintptr var ( - _subr__skip_object uintptr = 64 + _subr__skip_object uintptr = 48 ) const ( diff --git a/internal/native/neon/skip_one_arm64.s b/internal/native/neon/skip_one_arm64.s index 1de8f4ebd..e45105c10 100644 --- a/internal/native/neon/skip_one_arm64.s +++ b/internal/native/neon/skip_one_arm64.s @@ -7,9 +7,7 @@ TEXT ·__skip_one_entry__(SB), NOSPLIT, $96 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x00000001; WORD $0x00000000 // .quad 1 @@ -2356,7 +2354,7 @@ LBB0_430: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__skip_one(SB), $0-40 +TEXT ·__skip_one(SB), NOSPLIT, $0-40 NO_LOCAL_POINTERS _entry: @@ -2370,7 +2368,9 @@ _skip_one: MOVD p+8(FP), R1 MOVD m+16(FP), R2 MOVD flags+24(FP), R3 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__skip_one_entry__+64(SB) // _skip_one + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+32(FP) RET diff --git a/internal/native/neon/skip_one_fast_arm64.s b/internal/native/neon/skip_one_fast_arm64.s index 652b71b51..98dc26c4f 100644 --- a/internal/native/neon/skip_one_fast_arm64.s +++ b/internal/native/neon/skip_one_fast_arm64.s @@ -7,9 +7,7 @@ TEXT ·__skip_one_fast_entry__(SB), NOSPLIT, $176 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -974,7 +972,7 @@ LBB0_124: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__skip_one_fast(SB), $0-24 +TEXT ·__skip_one_fast(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -986,7 +984,9 @@ _entry: _skip_one_fast: MOVD s+0(FP), R0 MOVD p+8(FP), R1 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__skip_one_fast_entry__+48(SB) // _skip_one_fast + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+16(FP) RET diff --git a/internal/native/neon/skip_one_fast_subr_arm64.go b/internal/native/neon/skip_one_fast_subr_arm64.go index 78403de09..b4c2f5d07 100644 --- a/internal/native/neon/skip_one_fast_subr_arm64.go +++ b/internal/native/neon/skip_one_fast_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __skip_one_fast_entry__() uintptr var ( - _subr__skip_one_fast uintptr = 48 + _subr__skip_one_fast uintptr = 32 ) const ( diff --git a/internal/native/neon/skip_one_subr_arm64.go b/internal/native/neon/skip_one_subr_arm64.go index 9a91cbf3c..87c40c784 100644 --- a/internal/native/neon/skip_one_subr_arm64.go +++ b/internal/native/neon/skip_one_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __skip_one_entry__() uintptr var ( - _subr__skip_one uintptr = 64 + _subr__skip_one uintptr = 48 ) const ( diff --git a/internal/native/neon/u64toa_arm64.s b/internal/native/neon/u64toa_arm64.s index 6df9837ce..8b025665e 100644 --- a/internal/native/neon/u64toa_arm64.s +++ b/internal/native/neon/u64toa_arm64.s @@ -7,9 +7,7 @@ TEXT ·__u64toa_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 3, 0x00 lCPI0_0: WORD $0x147b20c5 @@ -566,7 +564,7 @@ _VecShiftShuffles: WORD $0xffffffff // .ascii 4, '\xff\xff\xff\xff\xff\xff\xff\xff' WORD $0xffffffff // .ascii 4, '\xff\xff\xff\xff' -TEXT ·__u64toa(SB), $0-24 +TEXT ·__u64toa(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -578,7 +576,9 @@ _entry: _u64toa: MOVD out+0(FP), R0 MOVD val+8(FP), R1 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__u64toa_entry__+64(SB) // _u64toa + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+16(FP) RET diff --git a/internal/native/neon/u64toa_subr_arm64.go b/internal/native/neon/u64toa_subr_arm64.go index 84c5fff98..3cd0f3d7d 100644 --- a/internal/native/neon/u64toa_subr_arm64.go +++ b/internal/native/neon/u64toa_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __u64toa_entry__() uintptr var ( - _subr__u64toa uintptr = 64 + _subr__u64toa uintptr = 48 ) const ( diff --git a/internal/native/neon/unquote_arm64.s b/internal/native/neon/unquote_arm64.s index bdc7f503f..a799bb673 100644 --- a/internal/native/neon/unquote_arm64.s +++ b/internal/native/neon/unquote_arm64.s @@ -7,9 +7,7 @@ TEXT ·__unquote_entry__(SB), NOSPLIT, $96 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -586,7 +584,7 @@ __UnquoteTab: WORD $0x00000000 // .space 4, '\x00\x00\x00\x00\x00\x00\x00\x00' WORD $0x00000000 // .space 4, '\x00\x00\x00\x00' -TEXT ·__unquote(SB), $0-48 +TEXT ·__unquote(SB), NOSPLIT, $0-48 NO_LOCAL_POINTERS _entry: @@ -601,7 +599,9 @@ _unquote: MOVD dp+16(FP), R2 MOVD ep+24(FP), R3 MOVD flags+32(FP), R4 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__unquote_entry__+48(SB) // _unquote + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+40(FP) RET diff --git a/internal/native/neon/unquote_subr_arm64.go b/internal/native/neon/unquote_subr_arm64.go index 7adb5ca46..7f5c3e37b 100644 --- a/internal/native/neon/unquote_subr_arm64.go +++ b/internal/native/neon/unquote_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __unquote_entry__() uintptr var ( - _subr__unquote uintptr = 48 + _subr__unquote uintptr = 32 ) const ( diff --git a/internal/native/neon/validate_one_arm64.s b/internal/native/neon/validate_one_arm64.s index 4ec6d254f..58c57ea4e 100644 --- a/internal/native/neon/validate_one_arm64.s +++ b/internal/native/neon/validate_one_arm64.s @@ -7,9 +7,7 @@ TEXT ·__validate_one_entry__(SB), NOSPLIT, $96 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x00000001; WORD $0x00000000 // .quad 1 @@ -1833,7 +1831,7 @@ LBB0_337: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__validate_one(SB), $0-32 +TEXT ·__validate_one(SB), NOSPLIT, $0-32 NO_LOCAL_POINTERS _entry: @@ -1846,7 +1844,9 @@ _validate_one: MOVD s+0(FP), R0 MOVD p+8(FP), R1 MOVD m+16(FP), R2 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__validate_one_entry__+64(SB) // _validate_one + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+24(FP) RET diff --git a/internal/native/neon/validate_one_subr_arm64.go b/internal/native/neon/validate_one_subr_arm64.go index 0b195c1d7..2fa1a5215 100644 --- a/internal/native/neon/validate_one_subr_arm64.go +++ b/internal/native/neon/validate_one_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __validate_one_entry__() uintptr var ( - _subr__validate_one uintptr = 64 + _subr__validate_one uintptr = 48 ) const ( diff --git a/internal/native/neon/validate_utf8_arm64.s b/internal/native/neon/validate_utf8_arm64.s index feabfc9eb..ca87d00b3 100644 --- a/internal/native/neon/validate_utf8_arm64.s +++ b/internal/native/neon/validate_utf8_arm64.s @@ -7,9 +7,7 @@ TEXT ·__validate_utf8_entry__(SB), NOSPLIT, $48 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _validate_utf8: WORD $0xd10103ff // sub sp, sp, #64 @@ -197,7 +195,7 @@ LBB0_33: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__validate_utf8(SB), $0-32 +TEXT ·__validate_utf8(SB), NOSPLIT, $0-32 NO_LOCAL_POINTERS _entry: @@ -210,7 +208,9 @@ _validate_utf8: MOVD s+0(FP), R0 MOVD p+8(FP), R1 MOVD m+16(FP), R2 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__validate_utf8_entry__+16(SB) // _validate_utf8 + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+24(FP) RET diff --git a/internal/native/neon/validate_utf8_fast_arm64.s b/internal/native/neon/validate_utf8_fast_arm64.s index aafde624f..4296b6a4f 100644 --- a/internal/native/neon/validate_utf8_fast_arm64.s +++ b/internal/native/neon/validate_utf8_fast_arm64.s @@ -7,9 +7,7 @@ TEXT ·__validate_utf8_fast_entry__(SB), NOSPLIT, $32 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _validate_utf8_fast: WORD $0xd100c3ff // sub sp, sp, #48 @@ -159,7 +157,7 @@ LBB0_30: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__validate_utf8_fast(SB), $0-16 +TEXT ·__validate_utf8_fast(SB), NOSPLIT, $0-16 NO_LOCAL_POINTERS _entry: @@ -170,7 +168,9 @@ _entry: _validate_utf8_fast: MOVD s+0(FP), R0 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__validate_utf8_fast_entry__+16(SB) // _validate_utf8_fast + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+8(FP) RET diff --git a/internal/native/neon/validate_utf8_fast_subr_arm64.go b/internal/native/neon/validate_utf8_fast_subr_arm64.go index e72eceb46..a127e874a 100644 --- a/internal/native/neon/validate_utf8_fast_subr_arm64.go +++ b/internal/native/neon/validate_utf8_fast_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __validate_utf8_fast_entry__() uintptr var ( - _subr__validate_utf8_fast uintptr = 16 + _subr__validate_utf8_fast uintptr = 0 ) const ( diff --git a/internal/native/neon/validate_utf8_subr_arm64.go b/internal/native/neon/validate_utf8_subr_arm64.go index 8878908a5..ac8a68285 100644 --- a/internal/native/neon/validate_utf8_subr_arm64.go +++ b/internal/native/neon/validate_utf8_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __validate_utf8_entry__() uintptr var ( - _subr__validate_utf8 uintptr = 16 + _subr__validate_utf8 uintptr = 0 ) const ( diff --git a/internal/native/neon/value_arm64.s b/internal/native/neon/value_arm64.s index bc6fe7388..a3c79debd 100644 --- a/internal/native/neon/value_arm64.s +++ b/internal/native/neon/value_arm64.s @@ -7,9 +7,7 @@ TEXT ·__value_entry__(SB), NOSPLIT, $96 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -5939,7 +5937,7 @@ _LSHIFT_TAB: WORD $0x00000000 // .asciz 4, '\x00\x00\x00\x00\x00\x00\x00\x00' WORD $0x00000000 // .asciz 4, '\x00\x00\x00\x00' -TEXT ·__value(SB), $0-48 +TEXT ·__value(SB), NOSPLIT, $0-48 NO_LOCAL_POINTERS _entry: @@ -5954,7 +5952,9 @@ _value: MOVD p+16(FP), R2 MOVD v+24(FP), R3 MOVD flags+32(FP), R4 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__value_entry__+48(SB) // _value + WORD $0xf94007fc // ldr x28, [sp, #8] MOVD R0, ret+40(FP) RET diff --git a/internal/native/neon/value_subr_arm64.go b/internal/native/neon/value_subr_arm64.go index c8e82e2e0..238bcf742 100644 --- a/internal/native/neon/value_subr_arm64.go +++ b/internal/native/neon/value_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __value_entry__() uintptr var ( - _subr__value uintptr = 48 + _subr__value uintptr = 32 ) const ( diff --git a/internal/native/neon/vnumber_arm64.s b/internal/native/neon/vnumber_arm64.s index b79e177fa..ecaefae50 100644 --- a/internal/native/neon/vnumber_arm64.s +++ b/internal/native/neon/vnumber_arm64.s @@ -7,9 +7,7 @@ TEXT ·__vnumber_entry__(SB), NOSPLIT, $96 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _vnumber: WORD $0xf9400031 // ldr x17, [x1] @@ -4669,7 +4667,7 @@ _LSHIFT_TAB: WORD $0x00000000 // .asciz 4, '\x00\x00\x00\x00\x00\x00\x00\x00' WORD $0x00000000 // .asciz 4, '\x00\x00\x00\x00' -TEXT ·__vnumber(SB), $0-24 +TEXT ·__vnumber(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -4682,7 +4680,9 @@ _vnumber: MOVD s+0(FP), R0 MOVD p+8(FP), R1 MOVD v+16(FP), R2 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__vnumber_entry__+16(SB) // _vnumber + WORD $0xf94007fc // ldr x28, [sp, #8] RET _stack_grow: diff --git a/internal/native/neon/vnumber_subr_arm64.go b/internal/native/neon/vnumber_subr_arm64.go index 242a7a544..2f8086dc1 100644 --- a/internal/native/neon/vnumber_subr_arm64.go +++ b/internal/native/neon/vnumber_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __vnumber_entry__() uintptr var ( - _subr__vnumber uintptr = 16 + _subr__vnumber uintptr = 0 ) const ( diff --git a/internal/native/neon/vsigned_arm64.s b/internal/native/neon/vsigned_arm64.s index f17d147ca..8963eb869 100644 --- a/internal/native/neon/vsigned_arm64.s +++ b/internal/native/neon/vsigned_arm64.s @@ -7,9 +7,7 @@ TEXT ·__vsigned_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _vsigned: WORD $0xf9400028 // ldr x8, [x1] @@ -130,7 +128,7 @@ LBB0_23: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__vsigned(SB), $0-24 +TEXT ·__vsigned(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -143,7 +141,9 @@ _vsigned: MOVD s+0(FP), R0 MOVD p+8(FP), R1 MOVD v+16(FP), R2 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__vsigned_entry__+16(SB) // _vsigned + WORD $0xf94007fc // ldr x28, [sp, #8] RET _stack_grow: diff --git a/internal/native/neon/vsigned_subr_arm64.go b/internal/native/neon/vsigned_subr_arm64.go index 611be3f3a..b436af3da 100644 --- a/internal/native/neon/vsigned_subr_arm64.go +++ b/internal/native/neon/vsigned_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __vsigned_entry__() uintptr var ( - _subr__vsigned uintptr = 16 + _subr__vsigned uintptr = 0 ) const ( diff --git a/internal/native/neon/vstring_arm64.s b/internal/native/neon/vstring_arm64.s index 77bd91682..e47fa4b32 100644 --- a/internal/native/neon/vstring_arm64.s +++ b/internal/native/neon/vstring_arm64.s @@ -7,9 +7,7 @@ TEXT ·__vstring_entry__(SB), NOSPLIT, $32 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 4, 0x00 lCPI0_0: WORD $0x08040201 @@ -618,7 +616,7 @@ LBB0_77: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__vstring(SB), $0-32 +TEXT ·__vstring(SB), NOSPLIT, $0-32 NO_LOCAL_POINTERS _entry: @@ -632,7 +630,9 @@ _vstring: MOVD p+8(FP), R1 MOVD v+16(FP), R2 MOVD flags+24(FP), R3 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__vstring_entry__+48(SB) // _vstring + WORD $0xf94007fc // ldr x28, [sp, #8] RET _stack_grow: diff --git a/internal/native/neon/vstring_subr_arm64.go b/internal/native/neon/vstring_subr_arm64.go index d0c984d87..aa3e88709 100644 --- a/internal/native/neon/vstring_subr_arm64.go +++ b/internal/native/neon/vstring_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __vstring_entry__() uintptr var ( - _subr__vstring uintptr = 48 + _subr__vstring uintptr = 32 ) const ( diff --git a/internal/native/neon/vunsigned_arm64.s b/internal/native/neon/vunsigned_arm64.s index e0cb44193..ec3149e07 100644 --- a/internal/native/neon/vunsigned_arm64.s +++ b/internal/native/neon/vunsigned_arm64.s @@ -7,9 +7,7 @@ TEXT ·__vunsigned_entry__(SB), NOSPLIT, $16 NO_LOCAL_POINTERS - WORD $0x10000000 // adr x0, . $0(%rip) - WORD $0xd65f03c0 // ret - WORD $0x00000000; WORD $0x00000000 // .p2align 4, 0x00 + PCALIGN $16 // .p2align 2, 0x00 _vunsigned: WORD $0xf9400028 // ldr x8, [x1] @@ -118,7 +116,7 @@ LBB0_21: _MASK_USE_NUMBER: WORD $0x00000002 // .long 2 -TEXT ·__vunsigned(SB), $0-24 +TEXT ·__vunsigned(SB), NOSPLIT, $0-24 NO_LOCAL_POINTERS _entry: @@ -131,7 +129,9 @@ _vunsigned: MOVD s+0(FP), R0 MOVD p+8(FP), R1 MOVD v+16(FP), R2 + WORD $0xf90007fc // str x28, [sp, #8] CALL ·__vunsigned_entry__+16(SB) // _vunsigned + WORD $0xf94007fc // ldr x28, [sp, #8] RET _stack_grow: diff --git a/internal/native/neon/vunsigned_subr_arm64.go b/internal/native/neon/vunsigned_subr_arm64.go index 6c16b762f..f32d6af5a 100644 --- a/internal/native/neon/vunsigned_subr_arm64.go +++ b/internal/native/neon/vunsigned_subr_arm64.go @@ -9,7 +9,7 @@ package neon func __vunsigned_entry__() uintptr var ( - _subr__vunsigned uintptr = 16 + _subr__vunsigned uintptr = 0 ) const ( diff --git a/tools/asm2arm/arm.py b/tools/asm2arm/arm.py index 9118a207a..50a5a8faf 100644 --- a/tools/asm2arm/arm.py +++ b/tools/asm2arm/arm.py @@ -2018,6 +2018,7 @@ def _declare_body(self, name: str): size = 0 if size < 0 else size self.out.append('TEXT ·_%s_entry__(SB), NOSPLIT, $%d' % (name, size)) self.out.append('\tNO_LOCAL_POINTERS') + self.out.append('\tPCALIGN $16') self._LE_4bytes_IntIntr_2_RawIntr() self._reloc() @@ -2047,6 +2048,12 @@ def _declare_function(self, name: str, proto: Prototype): addr = self.code.get(subr) self.subr[subr] = addr size = self.code.stacksize(subr) + + # Notice: golang will insert 3 instructions when stacksize > 0. + # And since we use PCALIGN 16, thus we add 16 bytes PC + if size > 0: + addr += 16 + m_size = size + 64 # rsp_sub_size = size + 16 @@ -2057,7 +2064,7 @@ def _declare_function(self, name: str, proto: Prototype): self.out.append('') # frame size is 16 to store x29 and x30 # self.out.append('TEXT ·%s(SB), NOSPLIT | NOFRAME, $0-%d' % (name, proto.argspace)) - self.out.append('TEXT ·%s(SB), $%d-%d' % (name, 0, proto.argspace)) + self.out.append('TEXT ·%s(SB), NOSPLIT, $%d-%d' % (name, 0, proto.argspace)) self.out.append('\tNO_LOCAL_POINTERS') # add stack check if needed @@ -2099,47 +2106,35 @@ def _declare_function(self, name: str, proto: Prototype): # Go ASM completely ignores the offset of the JMP instruction, # so we need to use indirect jumps instead for tail-call elimination - elif proto.retv is None: - # raise RuntimeError("UNIMPLEMENT FUNC: %s" % name) - print("%s return void." % name) - # self.out.append('\tLEAQ ·%s+%d(SB), AX // %s' % (STUB_NAME, addr, subr)) - # self.out.append('\tJMP AX') - - # save LR(x30) and Frame Pointer(x29) - - # self.out.append('\tADD $%d, RSP, RSP' % size) - # self.out.append('\tSTP.W (R29, R30), -16(RSP)') - # self.out.append('\tMOVD RSP, R29') - # self.out.append('\tSUB $16, RSP') - # self.out.append('\tADD $%d, RSP' % (size + 32)) - self.out.append('\tCALL ·_%s_entry__+%d(SB) // %s' % (subr, addr, subr)) - # self.out.append('\tSUB $%d, RSP' % (size + 32)) - # self.out.append('\tADD $16, RSP') - # self.out.append('\tLDP -8(RSP), (R29, R30)') - # self.out.append('\tADD $16, RSP') - # self.out.append('\tLDP.P 16(RSP), (R29, R30)') - # self.out.append('\tSUB $%d, RSP, RSP' % size) - - # Restore LR and Frame Pointer + # raise RuntimeError("UNIMPLEMENT FUNC: %s" % name) + # self.out.append('\tLEAQ ·%s+%d(SB), AX // %s' % (STUB_NAME, addr, subr)) + # self.out.append('\tJMP AX') + + # save LR(x30) and Frame Pointer(x29) + + # self.out.append('\tADD $%d, RSP, RSP' % size) + # self.out.append('\tSTP.W (R29, R30), -16(RSP)') + # self.out.append('\tMOVD RSP, R29') + # self.out.append('\tSUB $16, RSP') + # self.out.append('\tADD $%d, RSP' % (size + 32)) + self.out.append('\tWORD $0xf90007fc // str x28, [sp, #8]') + self.out.append('\tCALL ·_%s_entry__+%d(SB) // %s' % (subr, addr, subr)) + self.out.append('\tWORD $0xf94007fc // ldr x28, [sp, #8]') + # self.out.append('\tSUB $%d, RSP' % (size + 32)) + # self.out.append('\tADD $16, RSP') + # self.out.append('\tLDP -8(RSP), (R29, R30)') + # self.out.append('\tADD $16, RSP') + # self.out.append('\tLDP.P 16(RSP), (R29, R30)') + # self.out.append('\tSUB $%d, RSP, RSP' % size) + + # Restore LR and Frame Pointer # normal functions, call the real function, and return the result - else: - # save LR(x30) and Frame Pointer(x29) - - # We need store return address manual in ARM - # self.out.append('\tSUB $16, RSP') - # self.out.append('\tADD $%d, RSP' % (size + 32)) - self.out.append('\tCALL ·_%s_entry__+%d(SB) // %s' % (subr, addr, subr)) - # self.out.append('\tSUB $%d, RSP' % (size + 32)) - # self.out.append('\tADD $16, RSP') - # self.out.append('\tSUB $%d, RSP, RSP' % size) - + if proto.retv is not None: self.out.append('\t%s, %s+%d(FP)' % (' '.join(REG_MAP[proto.retv.creg.reg]), proto.retv.name, offs)) - - # Restore LR and Frame Pointer - # self.out.append('\tLDP -8(RSP), (R29, R30)') - # self.out.append('\tADD $16, RSP') - + # Restore LR and Frame Pointer + # self.out.append('\tLDP -8(RSP), (R29, R30)') + # self.out.append('\tADD $16, RSP') self.out.append('\tRET') @@ -2159,14 +2154,12 @@ def _declare_functions(self, protos: PrototypeMap): raise SyntaxError('function prototype must have a "_" prefix: ' + repr(name)) def parse(self, src: List[str], proto: PrototypeMap): - self.code.instr(Instruction('adr x0, .')) + # self.code.instr(Instruction('adr x0, .')) # self.code.instr(Instruction('add sp, sp, #%d'%self.code.stacksize(name))) - self.code.instr(Instruction('ret')) - - # align 16 bytes - cmd = Command.parse(".p2align 4") - func = self._commands.get(cmd.cmd) - func(cmd.args) + # self.code.instr(Instruction('ret')) + # cmd = Command.parse(".p2align 4") + # func = self._commands.get(cmd.cmd) + # func(cmd.args) self._parse(src) self._declare(proto)