]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips: replace use of (d)addi with (d)addiu
authorPetar Jovanovic <mips32r2@gmail.com>
Wed, 5 Oct 2016 14:16:25 +0000 (14:16 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Wed, 5 Oct 2016 14:16:25 +0000 (14:16 +0000)
Replace use of daddi/addi with daddiu/addiu.
This is more R6-friendly and we actually want to use the instructions
that do not cause integer overflow exception.

Patch by Vicente Olivert Riera.

Related issue - BZ#356112.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16018

coregrind/m_dispatch/dispatch-mips32-linux.S
coregrind/m_dispatch/dispatch-mips64-linux.S
coregrind/m_libcsetjmp.c
coregrind/m_syswrap/syswrap-mips64-linux.c
coregrind/m_trampoline.S
helgrind/tests/tc08_hbl2.c

index 22b6b382aa84476a3dc89cb737b08831419ca48b..0ff5f485a7d59bb9df92344c875820240a72207b 100644 (file)
@@ -196,7 +196,7 @@ VG_(disp_cp_xindir):
         addu $13, $13, $14
 
         lw $12, 0($13) /* t3 = VG_(tt_fast)[hash] :: ULong* */
-        addi $13, $13, 4
+        addiu $13, $13, 4
         lw $25, 0($13) /* little-endian, so comparing 1st 32bit word */
         nop
 
index 5e5afee060ee3cca3bd3d9617c99d6b81682c8b0..5eec8e5ce8e0739ea524d82a81092373c1e3ad43 100644 (file)
@@ -196,7 +196,7 @@ VG_(disp_cp_xindir):
         daddu $13, $13, $14
 
         ld $12, 0($13) /* t3 = VG_(tt_fast)[hash] :: ULong* */
-        daddi $13, $13, 8
+        daddiu $13, $13, 8
         ld $25, 0($13) /* little-endian, so comparing 1st 32bit word */
         nop
 
index 24ca357324467e4e9f33fc08d6b4127f46f185b5..39d6415dba10cf62f188a584661d0dd0bc97e140 100644 (file)
@@ -594,7 +594,7 @@ __asm__(
 /* Checking whether second argument is zero. */
 "   bnez $a1, 1f                \n\t"
 "   nop                         \n\t"
-"   addi $a1, $a1, 1            \n\t"  /* We must return 1 if val=0. */
+"   addiu $a1, $a1, 1           \n\t"  /* We must return 1 if val=0. */
 "1:                             \n\t"
 "   move $v0, $a1               \n\t"  /* Return value of second argument. */
 "   j    $ra                    \n\t"
index db051541e9d9fb463c79530f693fe2a8aea9c677..ed274954b7af3064f5ca6b1131ae280560cc4186 100644 (file)
@@ -173,7 +173,7 @@ asm(
 "   ld $30, 8($29)\n"
 "   ld $28, 16($29)\n"
 "   jr $31\n"
-"   daddi $29,$29, 32\n"
+"   daddiu $29,$29, 32\n"
 ".previous\n"
 );
 
index 176ea6693c88ae47fdffa0c833e23e4e29cfa9d2..ef7c4e69b3ae0afd0660213b9e0c513f9eebaf2e 100644 (file)
@@ -1278,8 +1278,8 @@ VG_(mips32_linux_REDIR_FOR_strlen):
       //la $a0, string
       j strlen_cond
    strlen_loop:
-      addi $v0, $v0, 1
-      addi $a0, $a0, 1
+      addiu $v0, $v0, 1
+      addiu $a0, $a0, 1
    strlen_cond:
       lbu $t0, ($a0)
       bne $t0, $zero, strlen_loop
index c3ea44c8729ae46862a5d1d1a53cf9e6fb3c5ac7..4913abe2c13e51b7e82a166da6f67e17112d6c9b 100644 (file)
 #  define INC(_lval,_lqual)                         \
      __asm__ __volatile__ (                         \
       "L1xyzzy1" _lqual":\n"                        \
-      "        move $t0, %0\n"                      \
-      "        ll   $t1, 0($t0)\n"                  \
-      "        addi $t1, $t1, 1\n"                  \
-      "        sc   $t1, 0($t0)\n"                  \
-      "        beqz $t1, L1xyzzy1" _lqual           \
+      "        move  $t0, %0\n"                     \
+      "        ll    $t1, 0($t0)\n"                 \
+      "        addiu $t1, $t1, 1\n"                 \
+      "        sc    $t1, 0($t0)\n"                 \
+      "        beqz  $t1, L1xyzzy1" _lqual          \
       : /*out*/ : /*in*/ "r"(&(_lval))              \
       : /*trash*/ "t0", "t1", "memory"              \
         )