From 14ff7cc94c4e167dbd80c96996b43f96bb9c17fb Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Thu, 8 Sep 2016 08:33:19 -0400 Subject: [PATCH] runtime/cgo: fix callback on big-endian MIPS64 Use MOVW, instead of MOVV, to pass an int32 arg. Also no need to restore arg registers. Fix big-endian MIPS64 build. Change-Id: Ib43c71075c988153e5e5c5c6e7297b3fee28652a Reviewed-on: https://go-review.googlesource.com/28830 Reviewed-by: Minux Ma --- src/runtime/cgo/asm_mips64x.s | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/runtime/cgo/asm_mips64x.s b/src/runtime/cgo/asm_mips64x.s index 06439cf36a8..e2042f6f401 100644 --- a/src/runtime/cgo/asm_mips64x.s +++ b/src/runtime/cgo/asm_mips64x.s @@ -18,9 +18,9 @@ TEXT crosscall2(SB),NOSPLIT,$-8 * first arg. */ ADDV $(-8*23), R29 - MOVV R5, (8*1)(R29) - MOVV R6, (8*2)(R29) - MOVV R7, (8*3)(R29) + MOVV R5, (8*1)(R29) // void* + MOVW R6, (8*2)(R29) // int32 + MOVV R7, (8*3)(R29) // uintptr MOVV R16, (8*4)(R29) MOVV R17, (8*5)(R29) MOVV R18, (8*6)(R29) @@ -49,9 +49,6 @@ TEXT crosscall2(SB),NOSPLIT,$-8 JAL runtimeĀ·load_g(SB) JAL (R4) - MOVV (8*1)(R29), R5 - MOVV (8*2)(R29), R6 - MOVV (8*3)(R29), R7 MOVV (8*4)(R29), R16 MOVV (8*5)(R29), R17 MOVV (8*6)(R29), R18