diff options
author | neel <neel@FreeBSD.org> | 2010-03-20 05:21:14 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2010-03-20 05:21:14 +0000 |
commit | acca987bde60a7b3b11dabcb24b9870f71e22546 (patch) | |
tree | 1afc1163036557b7e2fa879ad010d1200698c299 /sys/mips/sibyte | |
parent | 7d29901d9ad295ed1d5c58afd08c3fb9e8d5d986 (diff) | |
download | FreeBSD-src-acca987bde60a7b3b11dabcb24b9870f71e22546.zip FreeBSD-src-acca987bde60a7b3b11dabcb24b9870f71e22546.tar.gz |
Make sure that the registers 'v0' and 'v1' are properly sign-extended
when sb_load64() returns.
Some 32-bit arithmetic operations (e.g. subu) have unpredicatable results
when operating on 64-bit registers that are not properly sign-extended.
Diffstat (limited to 'sys/mips/sibyte')
-rw-r--r-- | sys/mips/sibyte/sb_asm.S | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/mips/sibyte/sb_asm.S b/sys/mips/sibyte/sb_asm.S index a822d79..4baa5f3 100644 --- a/sys/mips/sibyte/sb_asm.S +++ b/sys/mips/sibyte/sb_asm.S @@ -53,14 +53,14 @@ LEAF(sb_load64) move v0, v1 #if _BYTE_ORDER == _BIG_ENDIAN dsll32 v1, v1, 0 - dsrl32 v1, v1, 0 /* v1 = lower_uint32(result) */ + dsra32 v1, v1, 0 /* v1 = lower_uint32(result) */ jr ra - dsrl32 v0, v0, 0 /* v0 = upper_uint32(result) */ + dsra32 v0, v0, 0 /* v0 = upper_uint32(result) */ #else dsll32 v0, v0, 0 - dsrl32 v0, v0, 0 /* v0 = lower_uint32(result) */ + dsra32 v0, v0, 0 /* v0 = lower_uint32(result) */ jr ra - dsrl32 v1, v1, 0 /* v1 = upper_uint32(result) */ + dsra32 v1, v1, 0 /* v1 = upper_uint32(result) */ #endif END(sb_load64) |