]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips32/64: Save the value of FCSR register at the beginning and restore it
authorDejan Jevtic <dejan.jevtic@valgrind.org>
Fri, 20 Sep 2013 09:58:16 +0000 (09:58 +0000)
committerDejan Jevtic <dejan.jevtic@valgrind.org>
Fri, 20 Sep 2013 09:58:16 +0000 (09:58 +0000)
back at the end of dirty helper.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2772

VEX/priv/guest_mips_helpers.c

index 8cb41a2c0c1c90c7c5a6d3d7a2deadd8290b65b0..df19d5f70ec038953bf4638257259402ec903201 100644 (file)
@@ -1093,24 +1093,28 @@ ULong mips64_dirtyhelper_rdhwr ( ULong rt, ULong rd )
 #endif
 
 #define ASM_VOLATILE_ROUND32(fs, inst)                              \
-   __asm__ volatile("ctc1    %3,  $31"  "\n\t"                      \
+   __asm__ volatile("cfc1    $t0, $31"  "\n\t"                      \
+                    "ctc1    %3,  $31"  "\n\t"                      \
                     "mtc1    %1,  $f0"  "\n\t"                      \
                     "mtc1    %2,  $f1"  "\n\t"                      \
                     ""#inst" $f0, $f0"  "\n\t"                      \
                     "cfc1    %0,  $31"  "\n\t"                      \
+                    "ctc1    $t0, $31"  "\n\t"                      \
                     : "=r" (ret)                                    \
                     : "r" (addr[fs]), "r" (addr[fs+1]), "r" (fcsr)  \
-                    : "$f0", "$f1"                                  \
+                    : "t0", "$f0", "$f1"                            \
                    );
 
 #define ASM_VOLATILE_ROUND64(fs, inst)                              \
-   __asm__ volatile("ctc1     %2,  $31"  "\n\t"                     \
+   __asm__ volatile("cfc1     $t0, $31"  "\n\t"                     \
+                    "ctc1     %2,  $31"  "\n\t"                     \
                     "dmtc1    %1,  $f0"  "\n\t"                     \
                     ""#inst"  $f0, $f0"  "\n\t"                     \
                     "cfc1     %0,  $31"  "\n\t"                     \
+                    "ctc1     $t0, $31"  "\n\t"                     \
                     : "=r" (ret)                                    \
                     : "r" (addr[fs]), "r" (fcsr)                    \
-                    : "$f0"                                         \
+                    : "t0", "$f0"                                   \
                    );
 
 /* TODO: Add cases for all fpu instructions because all fpu instructions are