# Changeset 993

Ignore:
Timestamp:
Mar 24, 2011, 11:31:48 PM (9 years ago)
Message:

section 7

Location:
docs/PACT2011
Files:
 r983 \section{AVX} In this section, we briefly highlight the improvements made in the Advanced Vector Extensions (AVX) extension to the x86 instruction set architecture and discuss the impact of these improvements on Parabix2. As neither Expat nor Xerces-C benefit from AVX, we do not discuss them in this section. In this section, we briefly highlight the improvements made in the Advanced Vector Extensions (AVX) extension to the x86 instruction set architecture and discuss the impact of these improvements on Parabix2. As neither Expat nor Xerces-C benefit from AVX, we do not discuss them in this section. %The results of our experiments with the AVX and Sandy Bridge architecture can be seen in Figure \ref{avx}. \end{figure} \begin{figure} \begin{center} \includegraphics[width=85mm]{plots/InsMix.pdf} \end{center} \caption{Instructions per byte on Sandybridge} \label{insmix} \end{figure} \subsection{Three Operand Form} Originally, SIMD SSE instructions operated using a two-operand form. This meant that given any SIMD instruction $a~\texttt{[op]}~b$ the result of that instruction would replace the value of $a$ or $b$ with the result. Thus whenever the subsequent instructions used the value of both $a$ and $b$, one of them had to be either reconstructed, or an additional store and load operation was required to recover that value. Utilizing the new VEX instruction coding scheme \textbf{[citation needed]}, Intel now allows the use of non-destructive three-operand operations in their SSE and AVX instruction sets. As shown in Figure \ref{avx}, simply enabling three-operand form on the existing 128-bit SSE instructions reduced the overall cycle count by between 11.7\% and 13.5\%. While this is a one-time savings, it provided a significant performance improvement that traditional parsers cannot leverage. Originally, SIMD SSE instructions operated using a two-operand form. This meant that given any SIMD instruction $a~\texttt{[op]}~b$ the result of that instruction would replace the value of $a$ or $b$ with the result. Thus whenever the subsequent instructions used the value of both $a$ and $b$, one of them had to be either reconstructed, or an additional store and load operation was required to recover that value. Utilizing the new VEX instruction coding scheme \textbf{[citation needed]}, Intel now allows the use of non-destructive three-operand operations in their SSE and AVX instruction sets. As shown in Figure \ref{insmix}, the total number of non-bitwise logic SIMD operations, which involve many memory movements is 32\% to 34\% less. Simply enabling three-operand form on the existing 128-bit SSE instructions reduced the overall cycle count by between 11.7\% and 13.5\%, which is shown in Figure \ref{avx}. While this is a one-time savings, it provided a significant performance improvement that traditional parsers cannot leverage since they cannot benefit from the three-operand form designed for SIMD instruction set and as shown in Figure \ref{insmix}, the total number of non-vector instructions does not change. \subsection{256-bit Operations} Although the AVX instruction set provided on the Sandy Bridge allows the use of 256-bit SIMD registers, Intel focused on implementing floating point operations as opposed to the integer based operations. This proved to be a significant challenge when porting Parabix2 from the 128-bit SSE to the 256-bit AVX instruction set. Even though we forsaw a gain in terms of memory throughput, many of the 128-bit SSE instructions used in Parabix2 did not have a corresponding 256-bit AVX instruction. Bitwise logic, which represented $30\%$ of the executed instructions in our test cases \textbf{[need more accurate figures here]}, was directly ported into pure AVX. The remaining $70\%$ of the instructions had to be simulated by breaking the 256-bit register into two 128-bit registers, performing the SSE version of the operation on both registers then combining the results back into the 256-bit register. As Figure \ref{avx} shows, this resulted in only a 0.4\% improvement in the case of dew.xml---which had the lowest markup density and therefore executed the fewest simulated 256-bit instructions---over the three-operand SSE implementation but incurred a performance penalty in the other four test cases. We expect that we could gain a significant performance improvement if future implementations of AVX incorporated integer-based shift and arithmetic operations. %Additionally, if we could efficiently switch between two- and three-operand form The AVX instruction set provided on the Sandy Bridge allows the use of 256-bit SIMD registers. Ideally, we only need half of the SIMD instructions compared with the version that uses SSE instruction set (three-operand form). Therefore, Parabix2 should be able to achieve 50\% performance improvement on SIMD operations, which means 26\% to 38\% improvement of total processing time simply by using AVX intruction set instead of SSE instruction set. However, Intel focused on implementing floating point operations as opposed to the integer based operations, we only gain from bitwise logic operations and SIMD loading operations. As shown in Figure \ref{insmix}, the total number of SIMD instructions executed with AVX instruction set is 71\% to 79\% of the SIMD instructions with SSE instruction set. The number of bitwise logic operations, which is expected to be 50\% less, only goes down by 33\% to 39\% because they are used to simulate some other 256-bit operations that exsit on SSE but is not provided by AVX instruction set. As the total number of instructions goes down by 11\% to 23\%, we should be able to see less processing time and better performance. However, as shown in Figure \ref{avx}, the processing time is longer except the one with 23\% less instructions. The reason is that AVX instruction has longer latency. (cite Agner Fog?)