|
From: <sv...@va...> - 2016-10-18 05:14:41
|
Author: sewardj
Date: Tue Oct 18 06:14:29 2016
New Revision: 16064
Log:
Merge from trunk:
16038 mips: clear fcc bits in fcsr after calling printf()
Modified:
branches/VALGRIND_3_12_BRANCH/ (props changed)
branches/VALGRIND_3_12_BRANCH/none/tests/mips32/round.c
branches/VALGRIND_3_12_BRANCH/none/tests/mips64/round.c
branches/VALGRIND_3_12_BRANCH/none/tests/mips64/rounding_mode.h
Modified: branches/VALGRIND_3_12_BRANCH/none/tests/mips32/round.c
==============================================================================
--- branches/VALGRIND_3_12_BRANCH/none/tests/mips32/round.c (original)
+++ branches/VALGRIND_3_12_BRANCH/none/tests/mips32/round.c Tue Oct 18 06:14:29 2016
@@ -149,12 +149,24 @@
}
}
+void clear_fcc(){
+ __asm__ __volatile__(
+ "cfc1 $t0, $31" "\n\t"
+ "and $t0, $t0, 0x17FFFFF" "\n\t"
+ "ctc1 $t0, $31" "\n\t"
+ :
+ :
+ : "t0"
+ );
+}
+
int directedRoundingMode(flt_dir_op_t op) {
int fd_w = 0;
int i;
int fcsr = 0;
round_mode_t rm = TO_NEAREST;
for (i = 0; i < 24; i++) {
+ clear_fcc();
set_rounding_mode(rm);
switch(op) {
case CEILWS:
@@ -217,6 +229,7 @@
set_rounding_mode(rm);
printf("roundig mode: %s\n", round_mode_name[rm]);
for (i = 0; i < 24; i++) {
+ clear_fcc();
set_rounding_mode(rm);
switch(op1) {
case CVTDS:
Modified: branches/VALGRIND_3_12_BRANCH/none/tests/mips64/round.c
==============================================================================
--- branches/VALGRIND_3_12_BRANCH/none/tests/mips64/round.c (original)
+++ branches/VALGRIND_3_12_BRANCH/none/tests/mips64/round.c Tue Oct 18 06:14:29 2016
@@ -9,6 +9,7 @@
int i;
int fcsr = 0;
for (i = 0; i < MAX_ARR; i++) {
+ clear_fcc();
switch(op) {
case CEILWS:
UNOPfw("ceil.w.s");
@@ -111,6 +112,7 @@
set_rounding_mode(rm);
printf("roundig mode: %s\n", round_mode_name[rm]);
for (i = 0; i < MAX_ARR; i++) {
+ clear_fcc();
set_rounding_mode(rm);
switch(op1) {
case CVTDS:
Modified: branches/VALGRIND_3_12_BRANCH/none/tests/mips64/rounding_mode.h
==============================================================================
--- branches/VALGRIND_3_12_BRANCH/none/tests/mips64/rounding_mode.h (original)
+++ branches/VALGRIND_3_12_BRANCH/none/tests/mips64/rounding_mode.h Tue Oct 18 06:14:29 2016
@@ -60,4 +60,15 @@
break;
}
}
+
+void clear_fcc(){
+ __asm__ __volatile__(
+ "cfc1 $t0, $31" "\n\t"
+ "and $t0, $t0, 0x17FFFFF" "\n\t"
+ "ctc1 $t0, $31" "\n\t"
+ :
+ :
+ : "t0"
+ );
+}
#endif
|