]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: fix callback on big-endian MIPS64
authorCherry Zhang <cherryyz@google.com>
Thu, 8 Sep 2016 12:33:19 +0000 (08:33 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 9 Sep 2016 00:30:28 +0000 (00:30 +0000)
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 <minux@golang.org>
src/runtime/cgo/asm_mips64x.s

index 06439cf36a8c96422411bedf092698dd39486a93..e2042f6f401f20840086658acac3151c996b301b 100644 (file)
@@ -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