Debian Codegraph @

easel/esl_sse.tex

raw
1
2 The \eslmod{sse} module provides a few vectorized functions that use
3 the Intel/AMD SSE (Streaming SIMD Extensions) Intrinsics: most
4 importantly, vectorized \ccode{logf()} and \ccode{expf()} routines.
5
6 The \eslmod{sse} module is only available on platforms that support
7 SSE, SSE2, and SSE4.1 instructions. This includes all modern Intel and
8 AMD processors (since Intel Penryn in 2007, and AMD Bulldozer, Jaguar,
9 and Piledriver processors since 2011), but not PowerPC processors. By
10 default, the Easel configure script enables SSE if it is available on
11 the compilation machine.
12
13
14 \begin{table}[hbp]
15 \begin{center}
16 {\small
17 \begin{tabular}{|ll|}\hline
18 \hyperlink{func:esl_sse_logf()}{\ccode{esl\_sse\_logf()}} & \ccode{r[z] = log x[z]}\\
19 \hyperlink{func:esl_sse_expf()}{\ccode{esl\_sse\_expf()}} & \ccode{r[z] = exp x[z]}\\
20 %\hyperlink{func:esl_sse_select_ps()}{\ccode{esl\_sse\_select\_ps()}} & SSE equivalent of \ccode{vec\_sel()}\\
21 \hline
22 \end{tabular}
23 }
24 \end{center}
25 \caption{The \eslmod{sse} API.}
26 \label{tbl:sse_api}
27 \end{table}
28
29 \subsection{An example of using the sse API}
30
31 Figure~\ref{fig:sse_example} shows an example of calculating
32 \ccode{logf()} and \ccode{expf()} on an SSE \ccode{\_\_m128} vector
33 containing four floats. It also shows a useful \ccode{union} idiom for
34 accessing four floats either as an SSE vector or as individual floats.
35
36 \begin{figure}[ht]
37 \input{cexcerpts/sse_example}
38 \caption{An example of using the \eslmod{sse} module.}
39 \label{fig:sse_example}
40 \end{figure}
41