1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=0.4"/>
<meta name="description" content="SLEEF implements vectorized C99 math functions. It utilizes vector extensions including SSE2, AVX, AVX2, AVX512F for x86, and Advanced SIMD for ARM processors." />
<meta name="google" content="notranslate" />
<link rel="canonical" href="https://sleef.org/" />
<link rel="icon" href="favicon.png" />
<link rel="stylesheet" type="text/css" href="texlike.css"/>
<link rel="stylesheet" type="text/css" href="sleef.css"/>
<title>SLEEF Vectorized Math Library</title>
</head>
<body translate="no" class="notranslate">
<h1>SLEEF Vectorized Math Library<img src="sleeflogo3.png" alt="logo" width="25%" height="25%" style="float: right" /></h1>
<ul class="none" style="font-family: arial, sansserif; margin-top: 1.0cm;">
<li><a class="underlined" style="color:#a00000;" href="https://github.com/shibatch/sleef/releases">Download the latest version</a></li>
<li><a class="underlined" href="https://sleef.org/">Latest documentation on the web</a></li>
<li><a class="underlined" href="https://github.com/shibatch/sleef">GitHub repository</a></li>
<li><a class="underlined" href="https://sourceforge.net/p/sleef/mailman/">Mailing list</a></li>
<li><a class="underlined" href="https://sourceforge.net/p/sleef/discussion/general/">Discussion forum</a></li>
</ul>
<h2>Table of contents</h2>
<ul class="none" style="font-family: arial, sansserif; padding-left: 0.5cm;">
<li><a class="underlined" href="index.xhtml">Introduction</a>
<ul class="disc">
<li><a href="index.xhtml#overview">Overview</a></li>
<li><a href="index.xhtml#environment">Supported environments</a></li>
<!--<li><a href="index.xhtml#compatibility">Compatibility with other libraries</a></li>-->
<!--<li><a href="index.xhtml#porting">Porting</a></li>-->
<li><a href="index.xhtml#credit">Credit</a></li>
<li><a href="index.xhtml#partners">Partners</a></li>
<li><a href="index.xhtml#license">License</a></li>
<li><a href="index.xhtml#history">History of this software</a></li>
<li><a href="index.xhtml#related">Related projects</a></li>
</ul>
</li>
<li> </li>
<li><a class="underlined" href="compile.xhtml">Compiling and installing the library</a></li>
<li><a class="underlined" href="purec.xhtml">Math library reference</a></li>
<li><a class="underlined" href="dft.xhtml">DFT library reference</a></li>
<li><a class="underlined" href="misc.xhtml">Other tools included in the package</a></li>
<li><a class="underlined" href="benchmark.xhtml">Benchmark results</a></li>
<li><a class="underlined" href="additional.xhtml">Additional notes</a></li>
</ul>
<h2 id="overview">Overview</h2>
<p class="noindent">
SLEEF stands for SIMD Library for Evaluating Elementary
Functions. It implements vectorized versions of all C99 real
floating point math functions. It can utilize SIMD instructions of
modern processors. SLEEF is designed to fully utilize SIMD
computation by reducing the use of conditional branches and
scatter/gather memory access. Our <a class="underlined"
href="benchmark.xhtml">benchmarks</a> show that the performance of
SLEEF is comparable to that of the best commercial library. Unlike
vendor-tuned libraries, SLEEF is portable : it can be easily ported
to other architectures by writing a helper file, which is a thin
abstraction layer of SIMD intrinsics. SLEEF is also designed to work
with various operating systems and compilers.
</p>
<p>
The library contains subroutines for all C99 real FP math functions
in double precision and single precision. Different accuracy of the
results can be chosen for a subset of the elementary functions; for
this subset there are versions with up to 1 ulp error (which is the
maximum error, not the average) and versions with a few ulp
error. Obviously, less accurate versions are faster. For non-finite
inputs and outputs, the library should return the same results as
libm as specified in the C99 standard. The library is rigorously
tested if the evaluation error is within the designed limit. The
library is tested against high-precision evaluation
using <a class="underlined" href="http://www.mpfr.org/">the libmpfr
library</a>. Especially, we carefully checked the error of the
trigonometric functions when the arguments are close to an integral
multiple of <i class="math">π</i>/2.
</p>
<p>
SLEEF also includes subroutines for discrete Fourier
transform(DFT). These subroutines are fully vectorized, heavily
unrolled, and parallelized so that modern SIMD instructions and
multiple cores can be utilized for efficient computation. It has
an API similar to that of FFTW for easy migration, and distributed under
<a class="underlined"
href="http://www.boost.org/users/license.html">BSL</a>, which is a
permissive open source license. The subroutines can utilize long
vectors up to 2048 bits, and even longer vectors can be utilized by
a small modification. The helper files for abstracting SIMD
intrinsics are shared with SLEEF libm, and thus it is easy to port
DFT subroutines to other architectures. <a class="underlined"
href="https://github.com/shibatch/sleef/wiki/DFT-Performance">Preliminary
results of benchmark</a> are now available.
</p>
<h2 id="environment">Supported environments</h2>
<p class="noindent">
This library currently supports several SIMD architectures :
</p>
<div><br/></div>
<ul class="disc">
<li><a href="x86.xhtml">x86 - SSE2, SSE4.1, AVX, FMA4, AVX2+FMA3, AVX512F</a></li>
<li><a href="aarch64.xhtml">AArch64 - Advanced SIMD, SVE</a></li>
<li><a href="aarch32.xhtml">AArch32 - NEON</a></li>
<li><a href="ppc64.xhtml">PowerPC64 - VSX</a></li>
</ul>
<div><br/></div>
<p>
In addition to the SIMD implementation, Pure C (scalar) version is
provided. For x86 architecture, the library provides dispatchers
that automatically choose the best subroutines for the computer the
library is run. The supported combinations of the architecture,
operating system and compiler are shown in Table 1.1.
</p>
<div style="margin-top: 1.0cm;"></div>
<table style="text-align:center;" align="center">
<tr align="center">
<td class="caption">Table 1.1: Environment support matrix</td>
</tr>
<tr align="center">
<td>
<table class="lt">
<tr>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
</tr>
<tr>
<td class="lt-br"></td>
<td class="lt-hl"></td>
<td class="lt-blr" align="center">GCC</td>
<td class="lt-br" align="center">Clang</td>
<td class="lt-br" align="center">Intel Compiler</td>
<td class="lt-b" align="center">MSVC</td>
</tr>
<tr>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
<td class="lt-hl"></td>
</tr>
<tr>
<td class="lt-r" align="left">x86 (64bit), Linux</td>
<td></td>
<td class="lt-lr" align="center">Supported</td>
<td class="lt-r" align="center">Supported</td>
<td class="lt-r" align="center">Supported(*1)</td>
<td class="lt-" align="center">N/A</td>
</tr>
<tr>
<td class="lt-r" align="left">x86 (32bit), Linux</td>
<td></td>
<td class="lt-lr" align="center">Supported(*2)</td>
<td class="lt-r" align="center">Supported(*2)</td>
<td class="lt-r" align="center"></td>
<td class="lt-" align="center">N/A</td>
</tr>
<tr>
<td class="lt-r" align="left">AArch64, Linux</td>
<td></td>
<td class="lt-lr" align="center">Supported</td>
<td class="lt-r" align="center">Supported</td>
<td class="lt-r" align="center">N/A</td>
<td class="lt-" align="center">N/A</td>
</tr>
<tr>
<td class="lt-r" align="left">AArch32, Linux</td>
<td></td>
<td class="lt-lr" align="center">Supported(*3)</td>
<td class="lt-r" align="center">Supported(*3)</td>
<td class="lt-r" align="center">N/A</td>
<td class="lt-" align="center">N/A</td>
</tr>
<tr>
<td class="lt-r" align="left">PowerPC, Linux</td>
<td></td>
<td class="lt-lr" align="center"></td>
<td class="lt-r" align="center">Supported(*4)</td>
<td class="lt-r" align="center">N/A</td>
<td class="lt-" align="center">N/A</td>
</tr>
<tr>
<td class="lt-r" align="left">x86 (64bit), OS X</td>
<td></td>
<td class="lt-lr" align="center">Supported</td>
<td class="lt-r" align="center">Supported</td>
<td class="lt-r" align="center"></td>
<td class="lt-" align="center">N/A</td>
</tr>
<tr>
<td class="lt-br" align="left">x86 (64bit), Windows</td>
<td class="lt-hl"></td>
<td class="lt-blr" align="center">Supported(Cygwin)(*5)</td>
<td class="lt-br" align="center">Supported(Cygwin)(*5)</td>
<td class="lt-br" align="center"></td>
<td class="lt-b" align="center">Supported</td>
</tr>
</table>
</td>
</tr>
</table>
<div style="margin-top: 2.0cm;"></div>
<p>
The supported compiler versions are as follows.
</p>
<div><br/></div>
<ul class="disc">
<li>GCC : version 5 and later</li>
<li>Clang : version 3.9 and later</li>
<li>Intel Compiler : ICC version 17</li>
<li>MSVC : Visual Studio 2017</li>
</ul>
<div><br/></div>
<p>
*1 FMA4 is not supported by Intel Compiler.
</p>
<p>
*2 SSE2 is required to run the scalar functions on 32-bit x86
architecture. x87 is not supported.
</p>
<p>
*3 NEON has only single precision support. The computation results
are not in full accuracy since NEON is not IEEE 754-compliant.
</p>
<p>
*4 Clang-5.0 and later are supported.
</p>
<p>
*5 AVX functions are not supported for Cygwin, since AVX is not
supported by Cygwin ABI.
</p>
<div style="margin-top: 1.0cm;"></div>
<p>
All functions in the library are thread safe unless otherwise noted.
</p>
<h2 id="credit">Credit</h2>
<ul class="disc">
<li>The main developer is <a class="underlined"
href="https://github.com/shibatch">Naoki Shibata</a>
( <a href="mailto:shibatch@users.sourceforge.net">shibatch@users.sourceforge.net</a> )
at Nara Institute of Science and Technology.</li>
<li><a class="underlined"
href="https://github.com/fpetrogalli-arm">Francesco Petrogalli</a>
at ARM Ltd. contributed the helper for AArch64 (helperadvsimd.h,
helpersve.h) and GNUABI interface of the library. He also worked on
migrating the build system to cmake, and reviewed the code, gave
precious comments and suggestions.</li>
<li><a class="underlined" href="https://github.com/hfinkel">Hal Finkel</a> at Argonne
Leadership Computing Facility is now working
on <a class="underlined"
href="https://reviews.llvm.org/D24951">importing and adapting SLEEF
as an LLVM runtime</a>. He also gave precious comments.</li>
<li><a class="underlined" href="https://github.com/diaena">Diana
Bite</a> at University of Manchester and <a class="underlined"
href="https://github.com/xoofx">Alexandre Mutel</a> at Unity
Technologies worked on migrating the build system to
cmake.</li>
<li><a class="underlined" href="https://github.com/blu">Martin
Krastev</a> at Chaos Group contributed faster implementation of fmin
and fmax functions.</li>
</ul>
<h2 id="partners">Partner institutes and corporations</h2>
<table style="margin-top:1cm;">
<tr><td> </td></tr>
<tr>
<td style="text-align:center;"><a href="https://www.naist.jp/en/"><img src="naistlogo.svg"
height="135px" alt="NAIST logo"/></a></td>
<td style="vertical-align: top;">
<p class="noindent" style="margin-left:2em;">
The <a class="underlined" href="http://ito-lab.naist.jp/">Mobile
Computing Lab</a> at Division of Information Science of Nara Institute
of Science and Technology participates through Naoki Shibata.
</p>
</td>
</tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr>
<td style="text-align:center;"><a href="https://www.arm.com/"><img src="https://sleef.org/Arm-logo-blue-pms313.svg" alt="ARM logo"
height="60px" /></a></td>
<td style="vertical-align: top;">
<p class="noindent" style="margin-left:2em;">
As the leading IP company in semiconductors
design, <a class="underlined" href="https://www.arm.com/">ARM</a>
participates through Francesco Petrogalli.
</p>
</td>
</tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr>
<td style="text-align:center;"><a href="https://unity3d.com/"><img src="https://sleef.org/Unity_Technologies_logo.svg" alt="Unity Technologies logo"
height="92px" /></a></td>
<td style="vertical-align: top;">
<p class="noindent" style="margin-left:2em;">As the leading
company in developing a video game engine, <a class="underlined"
href="https://unity3d.com/">Unity Technologies</a> participates
through Alexandre Mutel.
</p>
</td>
</tr>
<tr><td> </td></tr>
</table>
<h2 id="license">License</h2>
<p class="noindent">
SLEEF is distributed under <a class="underlined"
href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License
Version 1.0</a>.
</p>
<p class="noindent" style="margin-top: 0.8cm;">
<a class="nothing" href="https://opensource.org/">
<img src="osi_logo.png" width="90" height="103" alt="open source logo" style="position:relative; top:3px;"/>
</a>
Boost Software License is <a class="underlined"
href="https://opensource.org/licenses/BSL-1.0">OSI-certified</a>.
See <a class="underlined"
href="http://www.boost.org/users/license.html">this page</a> for more
information about Boost Software License.
</p>
<h2 id="history">History</h2>
<h4>3.3.1 (Released on Aug 21, 2018)</h4>
<ul class="disc">
<li>i386 build problem is fixed</li>
<li>FreeBSD support is added</li>
<li>Trigonometric functions now evaluate correctly with full FP
domain. (PR <a class="underlined"
href="https://github.com/shibatch/sleef/pull/197">#210</a>)</li>
</ul>
<h4>3.3 (Released on July 6, 2018)</h4>
<ul class="disc">
<li>AArch64 SVE target support is added (PR <a class="underlined"
href="https://github.com/shibatch/sleef/pull/180">#180</a>, <a class="underlined"
href="https://github.com/shibatch/sleef/pull/182">#182</a>)</li>
<li>DFT is now faster (PR <a class="underlined"
href="https://github.com/shibatch/sleef/pull/186">#186</a>)</li>
<li>3.5-ULP hyperbolic functions are added (PR <a class="underlined"
href="https://github.com/shibatch/sleef/pull/192">#192</a>)</li>
<li>PowerPC VSX target support is added (PR <a class="underlined"
href="https://github.com/shibatch/sleef/pull/195">#195</a>)</li>
<li>Modified Payne-Hanek argument reduction is added to the
trigonometric functions in libsleef (PR <a class="underlined"
href="https://github.com/shibatch/sleef/pull/197">#197</a>)</li>
</ul>
<h4>3.2 (Released on Feb 26, 2018)</h4>
<ul class="disc">
<li>The whole build system of the project migrated from makefiles to
cmake. The makefile build system is now removed.</li>
<li>GNUABI version of the library with compatibility tests is
added.</li>
<li>Benchmarks that compare `libsleef` vs `SVML` on X86 Linux are
available in the project tree under src/libm-benchmarks
directory.</li>
<li>Extensive upstream testing via Travis CI and Appveyor</li>
<li>log2 is added.</li>
<li>The library can be compiled to an LLVM bitcode object</li>
<li>Added masked interface to the library to support AVX512F masked
vectorization.</li>
<li>Use native instructions if available for `sqrt`.</li>
<li>Removed `libm` dependency.</li>
<li>fmod(FP remainder), asin, acos, log, pow, log10, exp2, exp10 and
log1p functions are now faster.</li>
<li>Fixed a bug that was making the error of sinpi, cospi, sincospi,
and tgamma functions larger than the specifications on very rare
occasions.</li>
<li>Fixed a bug that was preventing the dispatcher from choosing the
FMA4 implementation.</li>
</ul>
<h4>3.1 (Released on July 19, 2017)</h4>
<ul class="disc">
<li>Added AArch64 support</li>
<li>Implemented the remaining C99 math functions : lgamma, tgamma,
erf, erfc, fabs, copysign, fmax, fmin, fdim, trunc, floor, ceil,
round, rint, modf, ldexp, nextafter, frexp, hypot, and fmod.</li>
<li>Added dispatcher for x86 functions</li>
<li>Improved reduction of trigonometric functions</li>
<li>Added support for 32-bit x86, Cygwin, etc.</li>
<li>Improved tester</li>
<li>Etc.</li>
</ul>
<h4>3.0 (Released on Feb. 7, 2017)</h4>
<ul class="disc">
<li>New API is defined</li>
<li>Functions for DFT are added</li>
<li>sincospi functions are added</li>
<li>gencoef now supports single, extended and quad precision in addition to double precision</li>
<li>Linux, Windows and Mac OS X are supported</li>
<li>GCC, Clang, Intel Compiler, Microsoft Visual C++ are supported</li>
<li>The library can be compiled as DLLs</li>
<li>Files needed for creating a debian package are now included</li>
</ul>
<h4>2.120 (Released on Jan. 30, 2017)</h4>
<ul class="disc">
<li>Relicensed to Boost Software License Version 1.0</li>
</ul>
<h4>2.110 (Released on Dec. 11, 2016)</h4>
<ul class="disc">
<li>The valid range of argument is extended for trig functions</li>
<li>Specification of each functions regarding to the domain and accuracy is added</li>
<li>A coefficient generation tool is added</li>
<li>New testing tools are introduced</li>
<li>Following functions returned incorrect values when the argument is very large or small : exp, pow, asinh, acosh</li>
<li>SIMD xsin and xcos returned values more than 1 when FMA is enabled</li>
<li>Pure C cbrt returned incorrect values when the argument is negative</li>
<li>tan_u1 returned values with more than 1 ulp of error on rare occasions</li>
<li>Removed support for Java language(because no one seems using this)</li>
</ul>
<h2 id="related">Related projects and links</h2>
<ul class="disc">
<li>SLEEF is now included in <a class="underlined"
href="https://developer.arm.com/products/software-development-tools/hpc/documentation/vector-math-routines">
Arm Compiler for HPC</a>.</li>
<li>Mustafa A. Mohamad is developing <a class="underlined"
href="https://github.com/musm/SLEEF.jl">a pure Julia port of the
SLEEF math library</a>.</li>
<li>Hal Finkel has <a class="underlined"
href="https://github.com/hfinkel/sleef-bgq">adapted SLEEF to
PowerPC/QPX</a>. SLEEF is running on Mira IBM BG/Q supercomputer at
Argonne National Laboratory.</li>
<li>SLEEF is adopted in the following projects.
<ul class="circle">
<li><a href="http://www.menuetos.net/sc151.html">MenuetOS</a></li>
<li><a href="https://github.com/Beep6581/RawTherapee/tree/dev/rtengine">RawTherapee</a></li>
<li><a href="http://buraphakit.sourceforge.net/BASIC.shtml">John's ECMA-55 Minimal BASIC Compiler</a></li>
<li><a href="https://github.com/pocl/pocl/tree/master/lib/kernel/sleef">Portable Computing Language(pocl)</a></li>
<li><a href="https://github.com/pytorch/pytorch/pull/6725">PyTorch</a></li>
</ul>
</li>
<li style="margin-top: 1em;"><a class="underlined"
href="https://software.intel.com/en-us/node/524289">Intel Short
Vector Math Library (SVML)</a> is a commercial library of vectorized
math functions, which provides similar functionality to
SLEEF. Recently, some of the codes are published as free software,
and it is now <a class="underlined"
href="https://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/x86_64/fpu/multiarch">
a part of glibc</a>.</li>
</ul>
<p class="footer">
Copyright © 2018 SLEEF Project.<br/>
SLEEF is open-source software and is distributed under the Boost Software License, Version 1.0.
</p>
<!--TEST-->
</body>
</html>
|