Author: neel
Date: Sat Mar 20 05:21:14 2010
New Revision: 205363
URL: http://svn.freebsd.org/changeset/base/205363

Log:
  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.

Modified:
  head/sys/mips/sibyte/sb_asm.S

Modified: head/sys/mips/sibyte/sb_asm.S
==============================================================================
--- head/sys/mips/sibyte/sb_asm.S       Sat Mar 20 05:11:56 2010        
(r205362)
+++ head/sys/mips/sibyte/sb_asm.S       Sat Mar 20 05:21:14 2010        
(r205363)
@@ -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)
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to