]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] runtime: match argument/return type signedness in power64x assembly
authorAustin Clements <austin@google.com>
Thu, 30 Oct 2014 14:45:41 +0000 (10:45 -0400)
committerAustin Clements <austin@google.com>
Thu, 30 Oct 2014 14:45:41 +0000 (10:45 -0400)
Previously, the power64x runtime assembly was sloppy about
using sign-extending versus zero-extending moves of arguments
and return values.  I think all of the cases that actually
mattered have been fixed in recent CLs; this CL fixes up the
few remaining mismatches.

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/162480043

src/runtime/asm_power64x.s

index f77658032e35eaa73c772c452c0c76bb7307d82b..b6eac9611009bfc206e940f482b28c66d61a2ca1 100644 (file)
@@ -299,7 +299,7 @@ TEXT runtime·morestack_noctxt(SB),NOSPLIT,$-8-0
 // Note: can't just "BR NAME(SB)" - bad inlining results.
 
 TEXT ·reflectcall(SB), NOSPLIT, $-8-24
-       MOVW argsize+16(FP), R3
+       MOVWZ argsize+16(FP), R3
        DISPATCH(runtime·call16, 16)
        DISPATCH(runtime·call32, 32)
        DISPATCH(runtime·call64, 64)
@@ -336,7 +336,7 @@ TEXT NAME(SB), WRAPPER, $MAXSIZE-24;                \
        NO_LOCAL_POINTERS;                      \
        /* copy arguments to stack */           \
        MOVD    argptr+8(FP), R3;               \
-       MOVW    argsize+16(FP), R4;             \
+       MOVWZ   argsize+16(FP), R4;             \
        MOVD    R1, R5;                         \
        ADD     $(8-1), R5;                     \
        SUB     $1, R3;                         \
@@ -354,8 +354,8 @@ TEXT NAME(SB), WRAPPER, $MAXSIZE-24;                \
        BL      (CTR);                          \
        /* copy return values back */           \
        MOVD    argptr+8(FP), R3;               \
-       MOVW    argsize+16(FP), R4;             \
-       MOVW    retoffset+20(FP), R6;           \
+       MOVWZ   argsize+16(FP), R4;             \
+       MOVWZ   retoffset+20(FP), R6;           \
        MOVD    R1, R5;                         \
        ADD     R6, R5;                         \
        ADD     R6, R3;                         \
@@ -398,7 +398,7 @@ CALLFN(·call268435456, 268435456)
 CALLFN(·call536870912, 536870912)
 CALLFN(·call1073741824, 1073741824)
 
-// bool cas(int32 *val, int32 old, int32 new)
+// bool cas(uint32 *val, uint32 old, uint32 new)
 // Atomically:
 //     if(*val == old){
 //             *val = new;
@@ -407,8 +407,8 @@ CALLFN(·call1073741824, 1073741824)
 //             return 0;
 TEXT runtime·cas(SB), NOSPLIT, $0-17
        MOVD    p+0(FP), R3
-       MOVW    old+8(FP), R4
-       MOVW    new+12(FP), R5
+       MOVWZ   old+8(FP), R4
+       MOVWZ   new+12(FP), R5
 cas_again:
        SYNC
        LWAR    (R3), R6