diff options
author | Roland McGrath <roland@gnu.org> | 2003-04-11 22:11:44 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2003-04-11 22:11:44 +0000 |
commit | 9fb0cae85c1266abff645b831b7070113c89d0aa (patch) | |
tree | 7d1f1220534f31e7bb854f3c2a46e7122a377928 /sysdeps/powerpc/powerpc64/strcmp.S | |
parent | b35fce97f8d4a2963af866cb4801245d0f47d3ac (diff) | |
download | glibc-9fb0cae85c1266abff645b831b7070113c89d0aa.tar.gz glibc-9fb0cae85c1266abff645b831b7070113c89d0aa.tar.xz glibc-9fb0cae85c1266abff645b831b7070113c89d0aa.zip |
* string/test-strcmp.c (do_random_tests): Test whether return value
has been promoted to wordsize if the ABI requires caller to do so. * string/test-strncmp.c (do_random_tests): Likewise. * string/test-memcmp.c (do_random_tests): Likewise. * sysdeps/powerpc/powerpc64/strcmp.S (strcmp): Sign extend rRTN before returning.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/strcmp.S')
-rw-r--r-- | sysdeps/powerpc/powerpc64/strcmp.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/strcmp.S b/sysdeps/powerpc/powerpc64/strcmp.S index 71c6d867b7..4fb31931c6 100644 --- a/sysdeps/powerpc/powerpc64/strcmp.S +++ b/sysdeps/powerpc/powerpc64/strcmp.S @@ -85,6 +85,7 @@ L(endstring): addi rNEG, rNEG, 7 cmpw cr1, rNEG, rBITDIF sub rRTN, rWORD1, rWORD2 + extsw rRTN, rRTN bgelr+ cr1 L(equal): li rRTN, 0 @@ -97,9 +98,11 @@ L(different): extsw. rBITDIF,rBITDIF /* propagate sign for bgelr */ sub rRTN, rWORD1, rWORD2 + extsw rRTN, rRTN bgelr+ L(highbit): ori rRTN, rWORD2, 1 + extsw rRTN, rRTN /* GKM FIXME: check high bounds. */ blr @@ -124,10 +127,12 @@ L(u1): cmpwi cr1, rWORD1, 0 cmpw rWORD1, rWORD2 bne+ cr1, L(u0) L(u3): sub rRTN, rWORD1, rWORD2 + extsw rRTN, rRTN /* GKM FIXME: check high bounds. */ blr L(u4): lbz rWORD1, -1(rSTR1) sub rRTN, rWORD1, rWORD2 + extsw rRTN, rRTN /* GKM FIXME: check high bounds. */ blr END (BP_SYM (strcmp)) |