You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(1) |
2
(3) |
3
(1) |
4
(2) |
|
5
|
6
|
7
(4) |
8
|
9
(2) |
10
|
11
(2) |
|
12
|
13
(3) |
14
(7) |
15
(4) |
16
(2) |
17
|
18
|
|
19
|
20
(1) |
21
(2) |
22
|
23
|
24
|
25
|
|
26
|
27
(1) |
28
|
29
|
30
|
|
|
|
From: Petar J. <pe...@so...> - 2017-11-03 18:12:04
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=95038d380d60e7af2d04ffdd8432fdebed1990aa commit 95038d380d60e7af2d04ffdd8432fdebed1990aa Author: Petar Jovanovic <mip...@gm...> Date: Fri Nov 3 19:10:04 2017 +0100 mips: finetune tests that print FCSR Bits 18 (NAN2008) and 19 (ABS2008) in FCSR are preset by hardware and can differ between platforms. Hence, we should clear these bits before printing FCSR value in order to have the same output on different platforms. This fixes several failures (tests modified by this change) that occur on MIPS P5600 board. The P5600 is a core that implements MIPS32 Release 5 arch. Diff: --- none/tests/mips32/round.c | 38 +++++++++++++++---------- none/tests/mips32/round_fpu64.c | 30 ++++++++++++-------- none/tests/mips32/test_fcsr.c | 13 ++++++++- none/tests/mips64/round.c | 62 ++++++++++++++++++++++++----------------- none/tests/mips64/test_fcsr.c | 13 ++++++++- 5 files changed, 103 insertions(+), 53 deletions(-) diff --git a/none/tests/mips32/round.c b/none/tests/mips32/round.c index feba168..052508d 100644 --- a/none/tests/mips32/round.c +++ b/none/tests/mips32/round.c @@ -2,6 +2,16 @@ #include <stdio.h> +/* + * Bits 18 (NAN2008) and 19 (ABS2008) are preset by hardware and may differ + * between platforms. Hence a macro to clear them before printing FCSR + * values. + */ +#define FCSR_NAN2008 1 << 18 +#define FCSR_ABS2008 1 << 19 +#define FLAGS_RM_MASK 0xFFFFFFFF & ~(FCSR_ABS2008 | FCSR_NAN2008) +#define CLEAR_PRESETBITS_FCSR(fcsr) (fcsr & FLAGS_RM_MASK) + typedef enum { CEILWS=0, CEILWD, FLOORWS, FLOORWD, @@ -174,42 +184,42 @@ int directedRoundingMode(flt_dir_op_t op) { case CEILWS: UNOPfw("ceil.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CEILWD: UNOPdw("ceil.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORWS: UNOPfw("floor.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORWD: UNOPdw("floor.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDWS: UNOPfw("round.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDWD: UNOPdw("round.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCWS: UNOPfw("trunc.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCWD: UNOPdw("trunc.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; default: printf("error\n"); @@ -237,32 +247,32 @@ int FCSRRoundingMode(flt_round_op_t op1) case CVTDS: UNOPfd("cvt.d.s"); printf("%s %lf %lf\n", flt_round_op_names[op1], fd_d, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTDW: UNOPwd("cvt.d.w"); printf("%s %lf %d\n", flt_round_op_names[op1], fd_d, fs_w[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTSD: UNOPdf("cvt.s.d"); printf("%s %f %lf\n", flt_round_op_names[op1], fd_f, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTSW: UNOPwf("cvt.s.w"); printf("%s %f %d\n", flt_round_op_names[op1], fd_f, fs_w[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTWS: UNOPfw("cvt.w.s"); printf("%s %d %f\n", flt_round_op_names[op1], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTWD: UNOPdw("cvt.w.d"); printf("%s %d %lf\n", flt_round_op_names[op1], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; default: printf("error\n"); diff --git a/none/tests/mips32/round_fpu64.c b/none/tests/mips32/round_fpu64.c index e35c8b5..970dd05 100644 --- a/none/tests/mips32/round_fpu64.c +++ b/none/tests/mips32/round_fpu64.c @@ -8,7 +8,15 @@ #define MAX_ARR 24 #define PERROR \ printf("This test is testing mips32r2 instructions in fpu64 mode.\n"); -#define FLAGS_RM_MASK 0xFFFFFFFF +/* + * Bits 18 (NAN2008) and 19 (ABS2008) are preset by hardware and may differ + * between platforms. Hence a macro to clear them before printing FCSR + * values. + */ +#define FCSR_NAN2008 1 << 18 +#define FCSR_ABS2008 1 << 19 +#define FLAGS_RM_MASK 0xFFFFFFFF & ~(FCSR_ABS2008 | FCSR_NAN2008) +#define CLEAR_PRESETBITS_FCSR(fcsr) (fcsr & FLAGS_RM_MASK) typedef enum { CVTLS, CVTLD, ROUNDLS, ROUNDLD, @@ -122,61 +130,61 @@ int FCSRRoundingMode(flt_round_op_t op) UNOPsl("cvt.l.s"); printf("%s %lld %f\n", flt_round_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTLD: UNOPdl("cvt.l.d"); printf("%s %lld %lf\n", flt_round_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDLS: UNOPsl("round.l.s"); printf("%s %lld %f\n", flt_round_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDLD: UNOPdl("round.l.d"); printf("%s %lld %lf\n", flt_round_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCLS: UNOPsl("trunc.l.s"); printf("%s %lld %f\n", flt_round_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCLD: UNOPdl("trunc.l.d"); printf("%s %lld %lf\n", flt_round_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORLS: UNOPsl("floor.l.s"); printf("%s %lld %f\n", flt_round_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORLD: UNOPdl("floor.l.d"); printf("%s %lld %lf\n", flt_round_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CEILLS: UNOPsl("ceil.l.s"); printf("%s %lld %f\n", flt_round_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CEILLD: UNOPdl("ceil.l.d"); printf("%s %lld %lf\n", flt_round_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr & FLAGS_RM_MASK); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; default: printf("error\n"); diff --git a/none/tests/mips32/test_fcsr.c b/none/tests/mips32/test_fcsr.c index 6bb03a0..c422482 100644 --- a/none/tests/mips32/test_fcsr.c +++ b/none/tests/mips32/test_fcsr.c @@ -2,6 +2,16 @@ #include <stdio.h> +/* + * Bits 18 (NAN2008) and 19 (ABS2008) are preset by hardware and may differ + * between platforms. Hence a macro to clear them before printing FCSR + * values. + */ +#define FCSR_NAN2008 1 << 18 +#define FCSR_ABS2008 1 << 19 +#define FLAGS_RM_MASK 0xFFFFFFFF & ~(FCSR_ABS2008 | FCSR_NAN2008) +#define CLEAR_PRESETBITS_FCSR(fcsr) (fcsr & FLAGS_RM_MASK) + int main () { int out [] = {0, 0}; @@ -22,7 +32,8 @@ int main () : "r" (in), "r" (out) : "a1", "a2", "t0", "$f0", "$f1" ); - printf("FCSR::1: 0x%x, 2: 0x%x\n", out[0], out[1]); + printf("FCSR::1: 0x%x, 2: 0x%x\n", CLEAR_PRESETBITS_FCSR(out[0]), + CLEAR_PRESETBITS_FCSR(out[1])); return 0; } #else diff --git a/none/tests/mips64/round.c b/none/tests/mips64/round.c index 4634057..1894de1 100644 --- a/none/tests/mips64/round.c +++ b/none/tests/mips64/round.c @@ -2,6 +2,16 @@ #include "rounding_mode.h" #include "macro_fpu.h" +/* + * Bits 18 (NAN2008) and 19 (ABS2008) are preset by hardware and may differ + * between platforms. Hence a macro to clear them before printing FCSR + * values. + */ +#define FCSR_NAN2008 1 << 18 +#define FCSR_ABS2008 1 << 19 +#define FLAGS_RM_MASK 0xFFFFFFFF & ~(FCSR_ABS2008 | FCSR_NAN2008) +#define CLEAR_PRESETBITS_FCSR(fcsr) (fcsr & FLAGS_RM_MASK) + #if defined(__mips_hard_float) int directedRoundingMode(flt_dir_op_t op) { int fd_w = 0; @@ -14,82 +24,82 @@ int directedRoundingMode(flt_dir_op_t op) { case CEILWS: UNOPfw("ceil.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CEILWD: UNOPdw("ceil.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORWS: UNOPfw("floor.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORWD: UNOPdw("floor.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDWS: UNOPfw("round.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDWD: UNOPdw("round.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCWS: UNOPfw("trunc.w.s"); printf("%s %d %f\n", flt_dir_op_names[op], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCWD: UNOPdw("trunc.w.d"); printf("%s %d %lf\n", flt_dir_op_names[op], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CEILLS: UNOPsl("ceil.l.s"); printf("%s %lld %f\n", flt_dir_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CEILLD: UNOPdl("ceil.l.d"); printf("%s %lld %lf\n", flt_dir_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORLS: UNOPsl("floor.l.s"); printf("%s %lld %f\n", flt_dir_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case FLOORLD: UNOPdl("floor.l.d"); printf("%s %lld %lf\n", flt_dir_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDLS: UNOPsl("round.l.s"); printf("%s %lld %f\n", flt_dir_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case ROUNDLD: UNOPdl("round.l.d"); printf("%s %lld %lf\n", flt_dir_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCLS: UNOPsl("trunc.l.s"); printf("%s %lld %f\n", flt_dir_op_names[op], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case TRUNCLD: UNOPdl("trunc.l.d"); printf("%s %lld %lf\n", flt_dir_op_names[op], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; default: printf("error\n"); @@ -118,52 +128,52 @@ int FCSRRoundingMode(flt_round_op_t op1) case CVTDS: UNOPfd("cvt.d.s"); printf("%s %lf %lf\n", flt_round_op_names[op1], fd_d, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTDW: UNOPwd("cvt.d.w"); printf("%s %lf %d\n", flt_round_op_names[op1], fd_d, fs_w[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTSD: UNOPdf("cvt.s.d"); printf("%s %f %lf\n", flt_round_op_names[op1], fd_f, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTSW: UNOPwf("cvt.s.w"); printf("%s %f %d\n", flt_round_op_names[op1], fd_f, fs_w[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTWS: UNOPfw("cvt.w.s"); printf("%s %d %f\n", flt_round_op_names[op1], fd_w, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTWD: UNOPdw("cvt.w.d"); printf("%s %d %lf\n", flt_round_op_names[op1], fd_w, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTDL: UNOPld("cvt.d.l"); printf("%s %lf %ld\n", flt_round_op_names[op1], fd_d, fs_l[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTLS: UNOPsl("cvt.l.s"); printf("%s %lld %f\n", flt_round_op_names[op1], fd_l, fs_f[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTLD: UNOPdl("cvt.l.d"); printf("%s %lld %lf\n", flt_round_op_names[op1], fd_l, fs_d[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; case CVTSL: UNOPls("cvt.s.l"); printf("%s %f %ld\n", flt_round_op_names[op1], fd_f, fs_l[i]); - printf("fcsr: 0x%x\n", fcsr); + printf("fcsr: 0x%x\n", CLEAR_PRESETBITS_FCSR(fcsr)); break; default: printf("error\n"); diff --git a/none/tests/mips64/test_fcsr.c b/none/tests/mips64/test_fcsr.c index 742bb83..07e5e8c 100644 --- a/none/tests/mips64/test_fcsr.c +++ b/none/tests/mips64/test_fcsr.c @@ -1,5 +1,15 @@ #include <stdio.h> +/* + * Bits 18 (NAN2008) and 19 (ABS2008) are preset by hardware and may differ + * between platforms. Hence a macro to clear them before printing FCSR + * values. + */ +#define FCSR_NAN2008 1 << 18 +#define FCSR_ABS2008 1 << 19 +#define FLAGS_RM_MASK 0xFFFFFFFF & ~(FCSR_ABS2008 | FCSR_NAN2008) +#define CLEAR_PRESETBITS_FCSR(fcsr) (fcsr & FLAGS_RM_MASK) + int main () { #if defined(__mips_hard_float) @@ -22,7 +32,8 @@ int main () : "r" (out) : "a1", "a2", "t0", "$f0" ); - printf("FCSR::1: 0x%lx, 2: 0x%lx\n", out[0], out[1]); + printf("FCSR::1: 0x%lx, 2: 0x%lx\n", CLEAR_PRESETBITS_FCSR(out[0]), + CLEAR_PRESETBITS_FCSR(out[1])); #endif return 0; } |