<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/msun, branch stable/8</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r352710:</title>
<updated>2019-09-28T08:57:29+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2019-09-28T08:57:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bc4f7cabbe20fbc3ca6bff0daaca1dcba4bc72ac'/>
<id>bc4f7cabbe20fbc3ca6bff0daaca1dcba4bc72ac</id>
<content type='text'>
Do not left-shift a negative number (inducing undefined behavior in
C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate
computations that compute the IEEE-754 bit pattern for |2**k| for
integer |k|.

The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to
compute IEEE-754 bit patterns for 2**k in certain places.  (k is an
integer and 2**k is exactly representable in IEEE-754.)

Currently they do things like 0x3FF0'0000+(k&lt;&lt;20), which is to say they
take the bit pattern representing 1 and then add directly to the
exponent field to get the desired power of two.  This is fine when k is
non-negative.

But when k&lt;0 (and certain classes of input trigger this), this
left-shifts a negative number -- an operation with undefined behavior in
C and C++.

The desired semantics can be achieved by instead adding the
possibly-negative k to the IEEE-754 exponent bias to get the desired
exponent field, _then_ shifting that into its proper overall position.

(Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD
and SET_FLOAT_WORD uses further down in each of these files that perform
shift operations involving k, but by these points k's range has been
restricted to 2 &lt; k &lt;= 56, and the shift operations under those
circumstances can't do anything that would be UB.)

Submitted by:	Jeff Walden, https://github.com/jswalden
Obtained from:	https://github.com/freebsd/freebsd/pull/411
Obtained from:	https://github.com/freebsd/freebsd/pull/412
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not left-shift a negative number (inducing undefined behavior in
C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate
computations that compute the IEEE-754 bit pattern for |2**k| for
integer |k|.

The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to
compute IEEE-754 bit patterns for 2**k in certain places.  (k is an
integer and 2**k is exactly representable in IEEE-754.)

Currently they do things like 0x3FF0'0000+(k&lt;&lt;20), which is to say they
take the bit pattern representing 1 and then add directly to the
exponent field to get the desired power of two.  This is fine when k is
non-negative.

But when k&lt;0 (and certain classes of input trigger this), this
left-shifts a negative number -- an operation with undefined behavior in
C and C++.

The desired semantics can be achieved by instead adding the
possibly-negative k to the IEEE-754 exponent bias to get the desired
exponent field, _then_ shifting that into its proper overall position.

(Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD
and SET_FLOAT_WORD uses further down in each of these files that perform
shift operations involving k, but by these points k's range has been
restricted to 2 &lt; k &lt;= 56, and the shift operations under those
circumstances can't do anything that would be UB.)

Submitted by:	Jeff Walden, https://github.com/jswalden
Obtained from:	https://github.com/freebsd/freebsd/pull/411
Obtained from:	https://github.com/freebsd/freebsd/pull/412
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r286515:</title>
<updated>2015-08-12T19:06:35+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2015-08-12T19:06:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=66f64dc478deb50628a32acc19e48a69ec42f1cf'/>
<id>66f64dc478deb50628a32acc19e48a69ec42f1cf</id>
<content type='text'>
In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined.  Replace it with the intended value, in a defined way.

Reviewed by:	bde
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined.  Replace it with the intended value, in a defined way.

Reviewed by:	bde
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r235286:</title>
<updated>2012-05-18T00:32:29+00:00</updated>
<author>
<name>Glen Barber</name>
<email>gjb@FreeBSD.org</email>
</author>
<published>2012-05-18T00:32:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=84c3e87e1c04082f23653ce1c5baed9a418df242'/>
<id>84c3e87e1c04082f23653ce1c5baed9a418df242</id>
<content type='text'>
General mdoc(7) and typo fixes.

PR:		167734
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
General mdoc(7) and typo fixes.

PR:		167734
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r233973:</title>
<updated>2012-04-21T07:00:00+00:00</updated>
<author>
<name>David Schultz</name>
<email>das@FreeBSD.org</email>
</author>
<published>2012-04-21T07:00:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=91ff3edaa8b7a548f814fa2e4ed7b9ffc16371a2'/>
<id>91ff3edaa8b7a548f814fa2e4ed7b9ffc16371a2</id>
<content type='text'>
  Fix bugs in remquo{,f,l}.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  Fix bugs in remquo{,f,l}.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r226595:</title>
<updated>2012-01-09T04:58:02+00:00</updated>
<author>
<name>David Schultz</name>
<email>das@FreeBSD.org</email>
</author>
<published>2012-01-09T04:58:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d10d713d376b17a1d743ea66a0971a9ef004e2b9'/>
<id>d10d713d376b17a1d743ea66a0971a9ef004e2b9</id>
<content type='text'>
  Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r226594:</title>
<updated>2012-01-09T04:57:09+00:00</updated>
<author>
<name>David Schultz</name>
<email>das@FreeBSD.org</email>
</author>
<published>2012-01-09T04:57:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=98bf016c98f94144d09da0bed1fae4fb521fd00b'/>
<id>98bf016c98f94144d09da0bed1fae4fb521fd00b</id>
<content type='text'>
  Bugfix: feenableexcept() and fedisableexcept() should just return the
  old exception mask, not mask | ~FE_ALL_EXCEPT.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  Bugfix: feenableexcept() and fedisableexcept() should just return the
  old exception mask, not mask | ~FE_ALL_EXCEPT.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC various fma{,f,l} improvements:</title>
<updated>2012-01-09T04:55:55+00:00</updated>
<author>
<name>David Schultz</name>
<email>das@FreeBSD.org</email>
</author>
<published>2012-01-09T04:55:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bd982e7683c9f7a9770fb45790e21b2c6b4abc3f'/>
<id>bd982e7683c9f7a9770fb45790e21b2c6b4abc3f</id>
<content type='text'>
r226245 - refactoring
r226371 - fix double-rounding bug
r226373 - new math_private.h macros
r226601 - fix nit in r226371
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r226245 - refactoring
r226371 - fix double-rounding bug
r226373 - new math_private.h macros
r226601 - fix nit in r226371
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r227458, r226436:</title>
<updated>2012-01-05T04:50:28+00:00</updated>
<author>
<name>Eitan Adler</name>
<email>eadler@FreeBSD.org</email>
</author>
<published>2012-01-05T04:50:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7dfd61f0e0aff3f500e3ab5dd8462e5f6685b8e6'/>
<id>7dfd61f0e0aff3f500e3ab5dd8462e5f6685b8e6</id>
<content type='text'>
- change "is is" to "is" or "it is"
- change "the the" to "the"
- other typo fixes

Approved by:	lstewart
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- change "is is" to "is" or "it is"
- change "the the" to "the"
- other typo fixes

Approved by:	lstewart
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC various log* improvements.</title>
<updated>2011-10-17T05:38:07+00:00</updated>
<author>
<name>David Schultz</name>
<email>das@FreeBSD.org</email>
</author>
<published>2011-10-17T05:38:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=65750c796a5d00326fd6072fbf8323cab7689bf8'/>
<id>65750c796a5d00326fd6072fbf8323cab7689bf8</id>
<content type='text'>
r216247 - log2f style
r216248 - log2f insignificant bug
r219360 - log10 converted to use k_log
r219361 - log10f converted to use k_log
r226375 - log2/log10 style
r226376 - log2/log10 bde's improvements; fix log(1) with FE_DOWNWARD rounding
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r216247 - log2f style
r216248 - log2f insignificant bug
r219360 - log10 converted to use k_log
r219361 - log10f converted to use k_log
r226375 - log2/log10 style
r226376 - log2/log10 bde's improvements; fix log(1) with FE_DOWNWARD rounding
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r218877 from head:  Document our complex(3) support in libm.</title>
<updated>2011-04-05T04:23:08+00:00</updated>
<author>
<name>Murray Stokely</name>
<email>murray@FreeBSD.org</email>
</author>
<published>2011-04-05T04:23:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9a97f2d37bb9ef42bdb6fd3a4a9d1ff6fe50e4be'/>
<id>9a97f2d37bb9ef42bdb6fd3a4a9d1ff6fe50e4be</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
