1
0
mirror of https://github.com/golang/go synced 2024-11-19 04:24:39 -07:00

[dev.power64] runtime: match argument/return type signedness in power64x assembly

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
This commit is contained in:
Austin Clements 2014-10-30 10:45:41 -04:00
parent 599199fd9f
commit 097362fd2e

View File

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