Skip to content

Commit fcedf7c

Browse files
author
Daniel Kroening
committed
added model for FreeBSD __flt_rounds
1 parent da34ceb commit fcedf7c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ansi-c/library/float.c

+15
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,18 @@ inline int __builtin_flt_rounds(void)
8383
__CPROVER_rounding_mode==3?0: // to zero
8484
-1;
8585
}
86+
87+
/* FUNCTION: __flt_rounds */
88+
89+
extern int __CPROVER_rounding_mode;
90+
91+
inline int __flt_rounds(void)
92+
{
93+
// Spotted on FreeBSD
94+
// See __builtin_flt_rounds for the magic numbers.
95+
return __CPROVER_rounding_mode==0?1: // to nearest
96+
__CPROVER_rounding_mode==1?3: // downward
97+
__CPROVER_rounding_mode==2?2: // upward
98+
__CPROVER_rounding_mode==3?0: // to zero
99+
-1;
100+
}

0 commit comments

Comments
 (0)