\doxysection{conv\+\_\+acc\+\_\+sse\+\_\+impl.\+h}
\label{conv__acc__sse__impl_8h_source}\index{src/core/conv\_acc\_sse\_impl.h@{src/core/conv\_acc\_sse\_impl.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{5 \textcolor{comment}{/*}}
\DoxyCodeLine{6 \textcolor{comment}{ * Copyright (C) 2013, 2014 Thomas Tsou <tom@tsou.cc>}}
\DoxyCodeLine{7 \textcolor{comment}{ *}}
\DoxyCodeLine{8 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{9 \textcolor{comment}{ *}}
\DoxyCodeLine{10 \textcolor{comment}{ * SPDX-\/License-\/Identifier: GPL-\/2.0+}}
\DoxyCodeLine{11 \textcolor{comment}{ *}}
\DoxyCodeLine{12 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{13 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}}
\DoxyCodeLine{14 \textcolor{comment}{ * the Free Software Foundation; either version 2 of the License, or}}
\DoxyCodeLine{15 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{16 \textcolor{comment}{ *}}
\DoxyCodeLine{17 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{18 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{19 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{20 \textcolor{comment}{ * GNU General Public License for more details.}}
\DoxyCodeLine{21 \textcolor{comment}{ */}}
\DoxyCodeLine{22 }
\DoxyCodeLine{23 \textcolor{comment}{/* Some distributions (notably Alpine Linux) for some strange reason}}
\DoxyCodeLine{24 \textcolor{comment}{ * don't have this \#define */}}
\DoxyCodeLine{25 \textcolor{preprocessor}{\#ifndef \_\_always\_inline}}
\DoxyCodeLine{26 \textcolor{preprocessor}{\#define \_\_always\_inline         inline \_\_attribute\_\_((always\_inline))}}
\DoxyCodeLine{27 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{28 }
\DoxyCodeLine{29 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} sse41\_supported;}
\DoxyCodeLine{30 }
\DoxyCodeLine{31 \textcolor{comment}{/* Octo-\/Viterbi butterfly}}
\DoxyCodeLine{32 \textcolor{comment}{ * Compute 8-\/wide butterfly generating 16 path decisions and 16 accumulated}}
\DoxyCodeLine{33 \textcolor{comment}{ * sums. Inputs all packed 16-\/bit integers in three 128-\/bit XMM registers.}}
\DoxyCodeLine{34 \textcolor{comment}{ * Two intermediate registers are used and results are set in the upper 4}}
\DoxyCodeLine{35 \textcolor{comment}{ * registers.}}
\DoxyCodeLine{36 \textcolor{comment}{ *}}
\DoxyCodeLine{37 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{38 \textcolor{comment}{ * M0 -\/ Path metrics 0 (packed 16-\/bit integers)}}
\DoxyCodeLine{39 \textcolor{comment}{ * M1 -\/ Path metrics 1 (packed 16-\/bit integers)}}
\DoxyCodeLine{40 \textcolor{comment}{ * M2 -\/ Branch metrics (packed 16-\/bit integers)}}
\DoxyCodeLine{41 \textcolor{comment}{ *}}
\DoxyCodeLine{42 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{43 \textcolor{comment}{ * M2 -\/ Selected and accumulated path metrics 0}}
\DoxyCodeLine{44 \textcolor{comment}{ * M4 -\/ Selected and accumulated path metrics 1}}
\DoxyCodeLine{45 \textcolor{comment}{ * M3 -\/ Path selections 0}}
\DoxyCodeLine{46 \textcolor{comment}{ * M1 -\/ Path selections 1}}
\DoxyCodeLine{47 \textcolor{comment}{ */}}
\DoxyCodeLine{48 \textcolor{preprocessor}{\#define SSE\_BUTTERFLY(M0, M1, M2, M3, M4) \(\backslash\)}}
\DoxyCodeLine{49 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{50 \textcolor{preprocessor}{        M3 = \_mm\_adds\_epi16(M0, M2); \(\backslash\)}}
\DoxyCodeLine{51 \textcolor{preprocessor}{        M4 = \_mm\_subs\_epi16(M1, M2); \(\backslash\)}}
\DoxyCodeLine{52 \textcolor{preprocessor}{        M0 = \_mm\_subs\_epi16(M0, M2); \(\backslash\)}}
\DoxyCodeLine{53 \textcolor{preprocessor}{        M1 = \_mm\_adds\_epi16(M1, M2); \(\backslash\)}}
\DoxyCodeLine{54 \textcolor{preprocessor}{        M2 = \_mm\_max\_epi16(M3, M4); \(\backslash\)}}
\DoxyCodeLine{55 \textcolor{preprocessor}{        M3 = \_mm\_or\_si128(\_mm\_cmpgt\_epi16(M3, M4), \_mm\_cmpeq\_epi16(M3, M4)); \(\backslash\)}}
\DoxyCodeLine{56 \textcolor{preprocessor}{        M4 = \_mm\_max\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{57 \textcolor{preprocessor}{        M1 = \_mm\_or\_si128(\_mm\_cmpgt\_epi16(M0, M1), \_mm\_cmpeq\_epi16(M0, M1)); \(\backslash\)}}
\DoxyCodeLine{58 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{59 }
\DoxyCodeLine{60 \textcolor{comment}{/* Two lane deinterleaving K = 5:}}
\DoxyCodeLine{61 \textcolor{comment}{ * Take 16 interleaved 16-\/bit integers and deinterleave to 2 packed 128-\/bit}}
\DoxyCodeLine{62 \textcolor{comment}{ * registers. The operation summarized below. Four registers are used with}}
\DoxyCodeLine{63 \textcolor{comment}{ * the lower 2 as input and upper 2 as output.}}
\DoxyCodeLine{64 \textcolor{comment}{ *}}
\DoxyCodeLine{65 \textcolor{comment}{ * In   -\/ 10101010 10101010 10101010 10101010}}
\DoxyCodeLine{66 \textcolor{comment}{ * Out  -\/ 00000000 11111111 00000000 11111111}}
\DoxyCodeLine{67 \textcolor{comment}{ *}}
\DoxyCodeLine{68 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{69 \textcolor{comment}{ * M0:1 -\/ Packed 16-\/bit integers}}
\DoxyCodeLine{70 \textcolor{comment}{ *}}
\DoxyCodeLine{71 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{72 \textcolor{comment}{ * M2:3 -\/ Deinterleaved packed 16-\/bit integers}}
\DoxyCodeLine{73 \textcolor{comment}{ */}}
\DoxyCodeLine{74 \textcolor{preprocessor}{\#define \_I8\_SHUFFLE\_MASK 15, 14, 11, 10, 7, 6, 3, 2, 13, 12, 9, 8, 5, 4, 1, 0}}
\DoxyCodeLine{75 }
\DoxyCodeLine{76 \textcolor{preprocessor}{\#define SSE\_DEINTERLEAVE\_K5(M0, M1, M2, M3) \(\backslash\)}}
\DoxyCodeLine{77 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{78 \textcolor{preprocessor}{        M2 = \_mm\_set\_epi8(\_I8\_SHUFFLE\_MASK); \(\backslash\)}}
\DoxyCodeLine{79 \textcolor{preprocessor}{        M0 = \_mm\_shuffle\_epi8(M0, M2); \(\backslash\)}}
\DoxyCodeLine{80 \textcolor{preprocessor}{        M1 = \_mm\_shuffle\_epi8(M1, M2); \(\backslash\)}}
\DoxyCodeLine{81 \textcolor{preprocessor}{        M2 = \_mm\_unpacklo\_epi64(M0, M1); \(\backslash\)}}
\DoxyCodeLine{82 \textcolor{preprocessor}{        M3 = \_mm\_unpackhi\_epi64(M0, M1); \(\backslash\)}}
\DoxyCodeLine{83 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{84 }
\DoxyCodeLine{85 \textcolor{comment}{/* Two lane deinterleaving K = 7:}}
\DoxyCodeLine{86 \textcolor{comment}{ * Take 64 interleaved 16-\/bit integers and deinterleave to 8 packed 128-\/bit}}
\DoxyCodeLine{87 \textcolor{comment}{ * registers. The operation summarized below. 16 registers are used with the}}
\DoxyCodeLine{88 \textcolor{comment}{ * lower 8 as input and upper 8 as output.}}
\DoxyCodeLine{89 \textcolor{comment}{ *}}
\DoxyCodeLine{90 \textcolor{comment}{ * In   -\/ 10101010 10101010 10101010 10101010 ...}}
\DoxyCodeLine{91 \textcolor{comment}{ * Out  -\/ 00000000 11111111 00000000 11111111 ...}}
\DoxyCodeLine{92 \textcolor{comment}{ *}}
\DoxyCodeLine{93 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{94 \textcolor{comment}{ * M0:7 -\/ Packed 16-\/bit integers}}
\DoxyCodeLine{95 \textcolor{comment}{ *}}
\DoxyCodeLine{96 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{97 \textcolor{comment}{ * M8:15 -\/ Deinterleaved packed 16-\/bit integers}}
\DoxyCodeLine{98 \textcolor{comment}{ */}}
\DoxyCodeLine{99 \textcolor{preprocessor}{\#define SSE\_DEINTERLEAVE\_K7(M0, M1, M2, M3, M4, M5, M6, M7, \(\backslash\)}}
\DoxyCodeLine{100 \textcolor{preprocessor}{        M8, M9, M10, M11, M12, M13, M14, M15) \(\backslash\)}}
\DoxyCodeLine{101 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{102 \textcolor{preprocessor}{        M8  = \_mm\_set\_epi8(\_I8\_SHUFFLE\_MASK); \(\backslash\)}}
\DoxyCodeLine{103 \textcolor{preprocessor}{        M0  = \_mm\_shuffle\_epi8(M0, M8); \(\backslash\)}}
\DoxyCodeLine{104 \textcolor{preprocessor}{        M1  = \_mm\_shuffle\_epi8(M1, M8); \(\backslash\)}}
\DoxyCodeLine{105 \textcolor{preprocessor}{        M2  = \_mm\_shuffle\_epi8(M2, M8); \(\backslash\)}}
\DoxyCodeLine{106 \textcolor{preprocessor}{        M3  = \_mm\_shuffle\_epi8(M3, M8); \(\backslash\)}}
\DoxyCodeLine{107 \textcolor{preprocessor}{        M4  = \_mm\_shuffle\_epi8(M4, M8); \(\backslash\)}}
\DoxyCodeLine{108 \textcolor{preprocessor}{        M5  = \_mm\_shuffle\_epi8(M5, M8); \(\backslash\)}}
\DoxyCodeLine{109 \textcolor{preprocessor}{        M6  = \_mm\_shuffle\_epi8(M6, M8); \(\backslash\)}}
\DoxyCodeLine{110 \textcolor{preprocessor}{        M7  = \_mm\_shuffle\_epi8(M7, M8); \(\backslash\)}}
\DoxyCodeLine{111 \textcolor{preprocessor}{        M8  = \_mm\_unpacklo\_epi64(M0, M1); \(\backslash\)}}
\DoxyCodeLine{112 \textcolor{preprocessor}{        M9  = \_mm\_unpackhi\_epi64(M0, M1); \(\backslash\)}}
\DoxyCodeLine{113 \textcolor{preprocessor}{        M10 = \_mm\_unpacklo\_epi64(M2, M3); \(\backslash\)}}
\DoxyCodeLine{114 \textcolor{preprocessor}{        M11 = \_mm\_unpackhi\_epi64(M2, M3); \(\backslash\)}}
\DoxyCodeLine{115 \textcolor{preprocessor}{        M12 = \_mm\_unpacklo\_epi64(M4, M5); \(\backslash\)}}
\DoxyCodeLine{116 \textcolor{preprocessor}{        M13 = \_mm\_unpackhi\_epi64(M4, M5); \(\backslash\)}}
\DoxyCodeLine{117 \textcolor{preprocessor}{        M14 = \_mm\_unpacklo\_epi64(M6, M7); \(\backslash\)}}
\DoxyCodeLine{118 \textcolor{preprocessor}{        M15 = \_mm\_unpackhi\_epi64(M6, M7); \(\backslash\)}}
\DoxyCodeLine{119 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{120 }
\DoxyCodeLine{121 \textcolor{comment}{/* Generate branch metrics N = 2:}}
\DoxyCodeLine{122 \textcolor{comment}{ * Compute 16 branch metrics from trellis outputs and input values.}}
\DoxyCodeLine{123 \textcolor{comment}{ *}}
\DoxyCodeLine{124 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{125 \textcolor{comment}{ * M0:3 -\/ 16 x 2 packed 16-\/bit trellis outputs}}
\DoxyCodeLine{126 \textcolor{comment}{ * M4   -\/ Expanded and packed 16-\/bit input value}}
\DoxyCodeLine{127 \textcolor{comment}{ *}}
\DoxyCodeLine{128 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{129 \textcolor{comment}{ * M6:7 -\/ 16 computed 16-\/bit branch metrics}}
\DoxyCodeLine{130 \textcolor{comment}{ */}}
\DoxyCodeLine{131 \textcolor{preprocessor}{\#define SSE\_BRANCH\_METRIC\_N2(M0, M1, M2, M3, M4, M6, M7) \(\backslash\)}}
\DoxyCodeLine{132 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{133 \textcolor{preprocessor}{        M0 = \_mm\_sign\_epi16(M4, M0); \(\backslash\)}}
\DoxyCodeLine{134 \textcolor{preprocessor}{        M1 = \_mm\_sign\_epi16(M4, M1); \(\backslash\)}}
\DoxyCodeLine{135 \textcolor{preprocessor}{        M2 = \_mm\_sign\_epi16(M4, M2); \(\backslash\)}}
\DoxyCodeLine{136 \textcolor{preprocessor}{        M3 = \_mm\_sign\_epi16(M4, M3); \(\backslash\)}}
\DoxyCodeLine{137 \textcolor{preprocessor}{        M6 = \_mm\_hadds\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{138 \textcolor{preprocessor}{        M7 = \_mm\_hadds\_epi16(M2, M3); \(\backslash\)}}
\DoxyCodeLine{139 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{140 }
\DoxyCodeLine{141 \textcolor{comment}{/* Generate branch metrics N = 4:}}
\DoxyCodeLine{142 \textcolor{comment}{ * Compute 8 branch metrics from trellis outputs and input values. This}}
\DoxyCodeLine{143 \textcolor{comment}{ * macro is reused for N less than 4 where the extra soft input bits are}}
\DoxyCodeLine{144 \textcolor{comment}{ * padded.}}
\DoxyCodeLine{145 \textcolor{comment}{ *}}
\DoxyCodeLine{146 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{147 \textcolor{comment}{ * M0:3 -\/ 8 x 4 packed 16-\/bit trellis outputs}}
\DoxyCodeLine{148 \textcolor{comment}{ * M4   -\/ Expanded and packed 16-\/bit input value}}
\DoxyCodeLine{149 \textcolor{comment}{ *}}
\DoxyCodeLine{150 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{151 \textcolor{comment}{ * M5   -\/ 8 computed 16-\/bit branch metrics}}
\DoxyCodeLine{152 \textcolor{comment}{ */}}
\DoxyCodeLine{153 \textcolor{preprocessor}{\#define SSE\_BRANCH\_METRIC\_N4(M0, M1, M2, M3, M4, M5) \(\backslash\)}}
\DoxyCodeLine{154 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{155 \textcolor{preprocessor}{        M0 = \_mm\_sign\_epi16(M4, M0); \(\backslash\)}}
\DoxyCodeLine{156 \textcolor{preprocessor}{        M1 = \_mm\_sign\_epi16(M4, M1); \(\backslash\)}}
\DoxyCodeLine{157 \textcolor{preprocessor}{        M2 = \_mm\_sign\_epi16(M4, M2); \(\backslash\)}}
\DoxyCodeLine{158 \textcolor{preprocessor}{        M3 = \_mm\_sign\_epi16(M4, M3); \(\backslash\)}}
\DoxyCodeLine{159 \textcolor{preprocessor}{        M0 = \_mm\_hadds\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{160 \textcolor{preprocessor}{        M1 = \_mm\_hadds\_epi16(M2, M3); \(\backslash\)}}
\DoxyCodeLine{161 \textcolor{preprocessor}{        M5 = \_mm\_hadds\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{162 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{163 }
\DoxyCodeLine{164 \textcolor{comment}{/* Horizontal minimum}}
\DoxyCodeLine{165 \textcolor{comment}{ * Compute horizontal minimum of packed unsigned 16-\/bit integers and place}}
\DoxyCodeLine{166 \textcolor{comment}{ * result in the low 16-\/bit element of the source register. Only SSE 4.1}}
\DoxyCodeLine{167 \textcolor{comment}{ * has a dedicated minpos instruction. One intermediate register is used}}
\DoxyCodeLine{168 \textcolor{comment}{ * if SSE 4.1 is not available. This is a destructive operation and the}}
\DoxyCodeLine{169 \textcolor{comment}{ * source register is overwritten.}}
\DoxyCodeLine{170 \textcolor{comment}{ *}}
\DoxyCodeLine{171 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{172 \textcolor{comment}{ * M0 -\/ Packed unsigned 16-\/bit integers}}
\DoxyCodeLine{173 \textcolor{comment}{ *}}
\DoxyCodeLine{174 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{175 \textcolor{comment}{ * M0 -\/ Minimum value placed in low 16-\/bit element}}
\DoxyCodeLine{176 \textcolor{comment}{ */}}
\DoxyCodeLine{177 \textcolor{preprocessor}{\#if defined(HAVE\_SSE4\_1) || defined(HAVE\_SSE41)}}
\DoxyCodeLine{178 \textcolor{preprocessor}{\#define SSE\_MINPOS(M0, M1) \(\backslash\)}}
\DoxyCodeLine{179 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{180 \textcolor{preprocessor}{        if (sse41\_supported) \{ \(\backslash\)}}
\DoxyCodeLine{181 \textcolor{preprocessor}{                M0 = \_mm\_minpos\_epu16(M0); \(\backslash\)}}
\DoxyCodeLine{182 \textcolor{preprocessor}{        \} else \{ \(\backslash\)}}
\DoxyCodeLine{183 \textcolor{preprocessor}{                M1 = \_mm\_shuffle\_epi32(M0, \_MM\_SHUFFLE(0, 0, 3, 2)); \(\backslash\)}}
\DoxyCodeLine{184 \textcolor{preprocessor}{                M0 = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{185 \textcolor{preprocessor}{                M1 = \_mm\_shufflelo\_epi16(M0, \_MM\_SHUFFLE(0, 0, 3, 2)); \(\backslash\)}}
\DoxyCodeLine{186 \textcolor{preprocessor}{                M0 = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{187 \textcolor{preprocessor}{                M1 = \_mm\_shufflelo\_epi16(M0, \_MM\_SHUFFLE(0, 0, 0, 1)); \(\backslash\)}}
\DoxyCodeLine{188 \textcolor{preprocessor}{                M0 = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{189 \textcolor{preprocessor}{        \} \(\backslash\)}}
\DoxyCodeLine{190 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{191 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{192 \textcolor{preprocessor}{\#define SSE\_MINPOS(M0, M1) \(\backslash\)}}
\DoxyCodeLine{193 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{194 \textcolor{preprocessor}{        M1 = \_mm\_shuffle\_epi32(M0, \_MM\_SHUFFLE(0, 0, 3, 2)); \(\backslash\)}}
\DoxyCodeLine{195 \textcolor{preprocessor}{        M0 = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{196 \textcolor{preprocessor}{        M1 = \_mm\_shufflelo\_epi16(M0, \_MM\_SHUFFLE(0, 0, 3, 2)); \(\backslash\)}}
\DoxyCodeLine{197 \textcolor{preprocessor}{        M0 = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{198 \textcolor{preprocessor}{        M1 = \_mm\_shufflelo\_epi16(M0, \_MM\_SHUFFLE(0, 0, 0, 1)); \(\backslash\)}}
\DoxyCodeLine{199 \textcolor{preprocessor}{        M0 = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{200 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{201 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{202 }
\DoxyCodeLine{203 \textcolor{comment}{/* Normalize state metrics K = 5:}}
\DoxyCodeLine{204 \textcolor{comment}{ * Compute 16-\/wide normalization by subtracting the smallest value from}}
\DoxyCodeLine{205 \textcolor{comment}{ * all values. Inputs are 16 packed 16-\/bit integers across 2 XMM registers.}}
\DoxyCodeLine{206 \textcolor{comment}{ * Two intermediate registers are used and normalized results are placed}}
\DoxyCodeLine{207 \textcolor{comment}{ * in the originating locations.}}
\DoxyCodeLine{208 \textcolor{comment}{ *}}
\DoxyCodeLine{209 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{210 \textcolor{comment}{ * M0:1 -\/ Path metrics 0:1 (packed 16-\/bit integers)}}
\DoxyCodeLine{211 \textcolor{comment}{ *}}
\DoxyCodeLine{212 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{213 \textcolor{comment}{ * M0:1 -\/ Normalized path metrics 0:1}}
\DoxyCodeLine{214 \textcolor{comment}{ */}}
\DoxyCodeLine{215 \textcolor{preprocessor}{\#define SSE\_NORMALIZE\_K5(M0, M1, M2, M3) \(\backslash\)}}
\DoxyCodeLine{216 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{217 \textcolor{preprocessor}{        M2 = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{218 \textcolor{preprocessor}{        SSE\_MINPOS(M2, M3) \(\backslash\)}}
\DoxyCodeLine{219 \textcolor{preprocessor}{        SSE\_BROADCAST(M2) \(\backslash\)}}
\DoxyCodeLine{220 \textcolor{preprocessor}{        M0 = \_mm\_subs\_epi16(M0, M2); \(\backslash\)}}
\DoxyCodeLine{221 \textcolor{preprocessor}{        M1 = \_mm\_subs\_epi16(M1, M2); \(\backslash\)}}
\DoxyCodeLine{222 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{223 }
\DoxyCodeLine{224 \textcolor{comment}{/* Normalize state metrics K = 7:}}
\DoxyCodeLine{225 \textcolor{comment}{ * Compute 64-\/wide normalization by subtracting the smallest value from}}
\DoxyCodeLine{226 \textcolor{comment}{ * all values. Inputs are 8 registers of accumulated sums and 4 temporary}}
\DoxyCodeLine{227 \textcolor{comment}{ * registers. Normalized results are returned in the originating locations.}}
\DoxyCodeLine{228 \textcolor{comment}{ *}}
\DoxyCodeLine{229 \textcolor{comment}{ * Input:}}
\DoxyCodeLine{230 \textcolor{comment}{ * M0:7 -\/ Path metrics 0:7 (packed 16-\/bit integers)}}
\DoxyCodeLine{231 \textcolor{comment}{ *}}
\DoxyCodeLine{232 \textcolor{comment}{ * Output:}}
\DoxyCodeLine{233 \textcolor{comment}{ * M0:7 -\/ Normalized path metrics 0:7}}
\DoxyCodeLine{234 \textcolor{comment}{ */}}
\DoxyCodeLine{235 \textcolor{preprocessor}{\#define SSE\_NORMALIZE\_K7(M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11) \(\backslash\)}}
\DoxyCodeLine{236 \textcolor{preprocessor}{\{ \(\backslash\)}}
\DoxyCodeLine{237 \textcolor{preprocessor}{        M8  = \_mm\_min\_epi16(M0, M1); \(\backslash\)}}
\DoxyCodeLine{238 \textcolor{preprocessor}{        M9  = \_mm\_min\_epi16(M2, M3); \(\backslash\)}}
\DoxyCodeLine{239 \textcolor{preprocessor}{        M10 = \_mm\_min\_epi16(M4, M5); \(\backslash\)}}
\DoxyCodeLine{240 \textcolor{preprocessor}{        M11 = \_mm\_min\_epi16(M6, M7); \(\backslash\)}}
\DoxyCodeLine{241 \textcolor{preprocessor}{        M8  = \_mm\_min\_epi16(M8, M9); \(\backslash\)}}
\DoxyCodeLine{242 \textcolor{preprocessor}{        M10 = \_mm\_min\_epi16(M10, M11); \(\backslash\)}}
\DoxyCodeLine{243 \textcolor{preprocessor}{        M8  = \_mm\_min\_epi16(M8, M10); \(\backslash\)}}
\DoxyCodeLine{244 \textcolor{preprocessor}{        SSE\_MINPOS(M8, M9) \(\backslash\)}}
\DoxyCodeLine{245 \textcolor{preprocessor}{        SSE\_BROADCAST(M8) \(\backslash\)}}
\DoxyCodeLine{246 \textcolor{preprocessor}{        M0  = \_mm\_subs\_epi16(M0, M8); \(\backslash\)}}
\DoxyCodeLine{247 \textcolor{preprocessor}{        M1  = \_mm\_subs\_epi16(M1, M8); \(\backslash\)}}
\DoxyCodeLine{248 \textcolor{preprocessor}{        M2  = \_mm\_subs\_epi16(M2, M8); \(\backslash\)}}
\DoxyCodeLine{249 \textcolor{preprocessor}{        M3  = \_mm\_subs\_epi16(M3, M8); \(\backslash\)}}
\DoxyCodeLine{250 \textcolor{preprocessor}{        M4  = \_mm\_subs\_epi16(M4, M8); \(\backslash\)}}
\DoxyCodeLine{251 \textcolor{preprocessor}{        M5  = \_mm\_subs\_epi16(M5, M8); \(\backslash\)}}
\DoxyCodeLine{252 \textcolor{preprocessor}{        M6  = \_mm\_subs\_epi16(M6, M8); \(\backslash\)}}
\DoxyCodeLine{253 \textcolor{preprocessor}{        M7  = \_mm\_subs\_epi16(M7, M8); \(\backslash\)}}
\DoxyCodeLine{254 \textcolor{preprocessor}{\}}}
\DoxyCodeLine{255 }
\DoxyCodeLine{256 \textcolor{comment}{/* Combined BMU/PMU (K=5, N=2)}}
\DoxyCodeLine{257 \textcolor{comment}{ * Compute branch metrics followed by path metrics for half rate 16-\/state}}
\DoxyCodeLine{258 \textcolor{comment}{ * trellis. 8 butterflies are computed. Accumulated path sums are not}}
\DoxyCodeLine{259 \textcolor{comment}{ * preserved and read and written into the same memory location. Normalize}}
\DoxyCodeLine{260 \textcolor{comment}{ * sums if requires.}}
\DoxyCodeLine{261 \textcolor{comment}{ */}}
\DoxyCodeLine{262 \_\_always\_inline \textcolor{keyword}{static} \textcolor{keywordtype}{void} \_sse\_metrics\_k5\_n2(\textcolor{keyword}{const} int16\_t *val,}
\DoxyCodeLine{263         \textcolor{keyword}{const} int16\_t *out, int16\_t *sums, int16\_t *paths, \textcolor{keywordtype}{int} norm)}
\DoxyCodeLine{264 \{}
\DoxyCodeLine{265         \_\_m128i m0, m1, m2, m3, m4, m5, m6;}
\DoxyCodeLine{266 }
\DoxyCodeLine{267         \textcolor{comment}{/* (BMU) Load input sequence */}}
\DoxyCodeLine{268         m2 = \_mm\_castpd\_si128(\_mm\_loaddup\_pd((\textcolor{keywordtype}{double} \textcolor{keyword}{const} *) val));}
\DoxyCodeLine{269 }
\DoxyCodeLine{270         \textcolor{comment}{/* (BMU) Load trellis outputs */}}
\DoxyCodeLine{271         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[0]);}
\DoxyCodeLine{272         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[8]);}
\DoxyCodeLine{273 }
\DoxyCodeLine{274         \textcolor{comment}{/* (BMU) Compute branch metrics */}}
\DoxyCodeLine{275         m0 = \_mm\_sign\_epi16(m2, m0);}
\DoxyCodeLine{276         m1 = \_mm\_sign\_epi16(m2, m1);}
\DoxyCodeLine{277         m2 = \_mm\_hadds\_epi16(m0, m1);}
\DoxyCodeLine{278 }
\DoxyCodeLine{279         \textcolor{comment}{/* (PMU) Load accumulated path metrics */}}
\DoxyCodeLine{280         m0 = \_mm\_load\_si128((\_\_m128i *) \&sums[0]);}
\DoxyCodeLine{281         m1 = \_mm\_load\_si128((\_\_m128i *) \&sums[8]);}
\DoxyCodeLine{282 }
\DoxyCodeLine{283         SSE\_DEINTERLEAVE\_K5(m0, m1, m3, m4)}
\DoxyCodeLine{284 }
\DoxyCodeLine{285         \textcolor{comment}{/* (PMU) Butterflies: 0-\/7 */}}
\DoxyCodeLine{286         SSE\_BUTTERFLY(m3, m4, m2, m5, m6)}
\DoxyCodeLine{287 }
\DoxyCodeLine{288         \textcolor{keywordflow}{if} (norm)}
\DoxyCodeLine{289                 SSE\_NORMALIZE\_K5(m2, m6, m0, m1)}
\DoxyCodeLine{290 }
\DoxyCodeLine{291         \_mm\_store\_si128((\_\_m128i *) \&sums[0], m2);}
\DoxyCodeLine{292         \_mm\_store\_si128((\_\_m128i *) \&sums[8], m6);}
\DoxyCodeLine{293         \_mm\_store\_si128((\_\_m128i *) \&paths[0], m5);}
\DoxyCodeLine{294         \_mm\_store\_si128((\_\_m128i *) \&paths[8], m4);}
\DoxyCodeLine{295 \}}
\DoxyCodeLine{296 }
\DoxyCodeLine{297 \textcolor{comment}{/* Combined BMU/PMU (K=5, N=3 and N=4)}}
\DoxyCodeLine{298 \textcolor{comment}{ * Compute branch metrics followed by path metrics for 16-\/state and rates}}
\DoxyCodeLine{299 \textcolor{comment}{ * to 1/4. 8 butterflies are computed. The input sequence is read four 16-\/bit}}
\DoxyCodeLine{300 \textcolor{comment}{ * values at a time, and extra values should be set to zero for rates other}}
\DoxyCodeLine{301 \textcolor{comment}{ * than 1/4. Normally only rates 1/3 and 1/4 are used as there is a}}
\DoxyCodeLine{302 \textcolor{comment}{ * dedicated implementation of rate 1/2.}}
\DoxyCodeLine{303 \textcolor{comment}{ */}}
\DoxyCodeLine{304 \_\_always\_inline \textcolor{keyword}{static} \textcolor{keywordtype}{void} \_sse\_metrics\_k5\_n4(\textcolor{keyword}{const} int16\_t *val,}
\DoxyCodeLine{305         \textcolor{keyword}{const} int16\_t *out, int16\_t *sums, int16\_t *paths, \textcolor{keywordtype}{int} norm)}
\DoxyCodeLine{306 \{}
\DoxyCodeLine{307         \_\_m128i m0, m1, m2, m3, m4, m5, m6;}
\DoxyCodeLine{308 }
\DoxyCodeLine{309         \textcolor{comment}{/* (BMU) Load input sequence */}}
\DoxyCodeLine{310         m4 = \_mm\_castpd\_si128(\_mm\_loaddup\_pd((\textcolor{keywordtype}{double} \textcolor{keyword}{const} *) val));}
\DoxyCodeLine{311 }
\DoxyCodeLine{312         \textcolor{comment}{/* (BMU) Load trellis outputs */}}
\DoxyCodeLine{313         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[0]);}
\DoxyCodeLine{314         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[8]);}
\DoxyCodeLine{315         m2 = \_mm\_load\_si128((\_\_m128i *) \&out[16]);}
\DoxyCodeLine{316         m3 = \_mm\_load\_si128((\_\_m128i *) \&out[24]);}
\DoxyCodeLine{317 }
\DoxyCodeLine{318         SSE\_BRANCH\_METRIC\_N4(m0, m1, m2, m3, m4, m2)}
\DoxyCodeLine{319 }
\DoxyCodeLine{320         \textcolor{comment}{/* (PMU) Load accumulated path metrics */}}
\DoxyCodeLine{321         m0 = \_mm\_load\_si128((\_\_m128i *) \&sums[0]);}
\DoxyCodeLine{322         m1 = \_mm\_load\_si128((\_\_m128i *) \&sums[8]);}
\DoxyCodeLine{323 }
\DoxyCodeLine{324         SSE\_DEINTERLEAVE\_K5(m0, m1, m3, m4)}
\DoxyCodeLine{325 }
\DoxyCodeLine{326         \textcolor{comment}{/* (PMU) Butterflies: 0-\/7 */}}
\DoxyCodeLine{327         SSE\_BUTTERFLY(m3, m4, m2, m5, m6)}
\DoxyCodeLine{328 }
\DoxyCodeLine{329         \textcolor{keywordflow}{if} (norm)}
\DoxyCodeLine{330                 SSE\_NORMALIZE\_K5(m2, m6, m0, m1)}
\DoxyCodeLine{331 }
\DoxyCodeLine{332         \_mm\_store\_si128((\_\_m128i *) \&sums[0], m2);}
\DoxyCodeLine{333         \_mm\_store\_si128((\_\_m128i *) \&sums[8], m6);}
\DoxyCodeLine{334         \_mm\_store\_si128((\_\_m128i *) \&paths[0], m5);}
\DoxyCodeLine{335         \_mm\_store\_si128((\_\_m128i *) \&paths[8], m4);}
\DoxyCodeLine{336 \}}
\DoxyCodeLine{337 }
\DoxyCodeLine{338 \textcolor{comment}{/* Combined BMU/PMU (K=7, N=2)}}
\DoxyCodeLine{339 \textcolor{comment}{ * Compute branch metrics followed by path metrics for half rate 64-\/state}}
\DoxyCodeLine{340 \textcolor{comment}{ * trellis. 32 butterfly operations are computed. Deinterleaving path}}
\DoxyCodeLine{341 \textcolor{comment}{ * metrics requires usage of the full SSE register file, so separate sums}}
\DoxyCodeLine{342 \textcolor{comment}{ * before computing branch metrics to avoid register spilling.}}
\DoxyCodeLine{343 \textcolor{comment}{ */}}
\DoxyCodeLine{344 \_\_always\_inline \textcolor{keyword}{static} \textcolor{keywordtype}{void} \_sse\_metrics\_k7\_n2(\textcolor{keyword}{const} int16\_t *val,}
\DoxyCodeLine{345         \textcolor{keyword}{const} int16\_t *out, int16\_t *sums, int16\_t *paths, \textcolor{keywordtype}{int} norm)}
\DoxyCodeLine{346 \{}
\DoxyCodeLine{347         \_\_m128i m0, m1, m2, m3, m4, m5, m6, m7, m8,}
\DoxyCodeLine{348                 m9, m10, m11, m12, m13, m14, m15;}
\DoxyCodeLine{349 }
\DoxyCodeLine{350         \textcolor{comment}{/* (PMU) Load accumulated path metrics */}}
\DoxyCodeLine{351         m0 = \_mm\_load\_si128((\_\_m128i *) \&sums[0]);}
\DoxyCodeLine{352         m1 = \_mm\_load\_si128((\_\_m128i *) \&sums[8]);}
\DoxyCodeLine{353         m2 = \_mm\_load\_si128((\_\_m128i *) \&sums[16]);}
\DoxyCodeLine{354         m3 = \_mm\_load\_si128((\_\_m128i *) \&sums[24]);}
\DoxyCodeLine{355         m4 = \_mm\_load\_si128((\_\_m128i *) \&sums[32]);}
\DoxyCodeLine{356         m5 = \_mm\_load\_si128((\_\_m128i *) \&sums[40]);}
\DoxyCodeLine{357         m6 = \_mm\_load\_si128((\_\_m128i *) \&sums[48]);}
\DoxyCodeLine{358         m7 = \_mm\_load\_si128((\_\_m128i *) \&sums[56]);}
\DoxyCodeLine{359 }
\DoxyCodeLine{360         \textcolor{comment}{/* (PMU) Deinterleave to even-\/odd registers */}}
\DoxyCodeLine{361         SSE\_DEINTERLEAVE\_K7(m0, m1, m2, m3 ,m4 ,m5, m6, m7,}
\DoxyCodeLine{362                             m8, m9, m10, m11, m12, m13, m14, m15)}
\DoxyCodeLine{363 }
\DoxyCodeLine{364         \textcolor{comment}{/* (BMU) Load input symbols */}}
\DoxyCodeLine{365         m7 = \_mm\_castpd\_si128(\_mm\_loaddup\_pd((\textcolor{keywordtype}{double} \textcolor{keyword}{const} *) val));}
\DoxyCodeLine{366 }
\DoxyCodeLine{367         \textcolor{comment}{/* (BMU) Load trellis outputs */}}
\DoxyCodeLine{368         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[0]);}
\DoxyCodeLine{369         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[8]);}
\DoxyCodeLine{370         m2 = \_mm\_load\_si128((\_\_m128i *) \&out[16]);}
\DoxyCodeLine{371         m3 = \_mm\_load\_si128((\_\_m128i *) \&out[24]);}
\DoxyCodeLine{372 }
\DoxyCodeLine{373         SSE\_BRANCH\_METRIC\_N2(m0, m1, m2, m3, m7, m4, m5)}
\DoxyCodeLine{374 }
\DoxyCodeLine{375         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[32]);}
\DoxyCodeLine{376         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[40]);}
\DoxyCodeLine{377         m2 = \_mm\_load\_si128((\_\_m128i *) \&out[48]);}
\DoxyCodeLine{378         m3 = \_mm\_load\_si128((\_\_m128i *) \&out[56]);}
\DoxyCodeLine{379 }
\DoxyCodeLine{380         SSE\_BRANCH\_METRIC\_N2(m0, m1, m2, m3, m7, m6, m7)}
\DoxyCodeLine{381 }
\DoxyCodeLine{382         \textcolor{comment}{/* (PMU) Butterflies: 0-\/15 */}}
\DoxyCodeLine{383         SSE\_BUTTERFLY(m8, m9, m4, m0, m1)}
\DoxyCodeLine{384         SSE\_BUTTERFLY(m10, m11, m5, m2, m3)}
\DoxyCodeLine{385 }
\DoxyCodeLine{386         \_mm\_store\_si128((\_\_m128i *) \&paths[0], m0);}
\DoxyCodeLine{387         \_mm\_store\_si128((\_\_m128i *) \&paths[8], m2);}
\DoxyCodeLine{388         \_mm\_store\_si128((\_\_m128i *) \&paths[32], m9);}
\DoxyCodeLine{389         \_mm\_store\_si128((\_\_m128i *) \&paths[40], m11);}
\DoxyCodeLine{390 }
\DoxyCodeLine{391         \textcolor{comment}{/* (PMU) Butterflies: 17-\/31 */}}
\DoxyCodeLine{392         SSE\_BUTTERFLY(m12, m13, m6, m0, m2)}
\DoxyCodeLine{393         SSE\_BUTTERFLY(m14, m15, m7, m9, m11)}
\DoxyCodeLine{394 }
\DoxyCodeLine{395         \_mm\_store\_si128((\_\_m128i *) \&paths[16], m0);}
\DoxyCodeLine{396         \_mm\_store\_si128((\_\_m128i *) \&paths[24], m9);}
\DoxyCodeLine{397         \_mm\_store\_si128((\_\_m128i *) \&paths[48], m13);}
\DoxyCodeLine{398         \_mm\_store\_si128((\_\_m128i *) \&paths[56], m15);}
\DoxyCodeLine{399 }
\DoxyCodeLine{400         \textcolor{keywordflow}{if} (norm)}
\DoxyCodeLine{401                 SSE\_NORMALIZE\_K7(m4, m1, m5, m3, m6, m2,}
\DoxyCodeLine{402                                  m7, m11, m0, m8, m9, m10)}
\DoxyCodeLine{403 }
\DoxyCodeLine{404         \_mm\_store\_si128((\_\_m128i *) \&sums[0], m4);}
\DoxyCodeLine{405         \_mm\_store\_si128((\_\_m128i *) \&sums[8], m5);}
\DoxyCodeLine{406         \_mm\_store\_si128((\_\_m128i *) \&sums[16], m6);}
\DoxyCodeLine{407         \_mm\_store\_si128((\_\_m128i *) \&sums[24], m7);}
\DoxyCodeLine{408         \_mm\_store\_si128((\_\_m128i *) \&sums[32], m1);}
\DoxyCodeLine{409         \_mm\_store\_si128((\_\_m128i *) \&sums[40], m3);}
\DoxyCodeLine{410         \_mm\_store\_si128((\_\_m128i *) \&sums[48], m2);}
\DoxyCodeLine{411         \_mm\_store\_si128((\_\_m128i *) \&sums[56], m11);}
\DoxyCodeLine{412 \}}
\DoxyCodeLine{413 }
\DoxyCodeLine{414 \textcolor{comment}{/* Combined BMU/PMU (K=7, N=3 and N=4)}}
\DoxyCodeLine{415 \textcolor{comment}{ * Compute branch metrics followed by path metrics for half rate 64-\/state}}
\DoxyCodeLine{416 \textcolor{comment}{ * trellis. 32 butterfly operations are computed. Deinterleave path}}
\DoxyCodeLine{417 \textcolor{comment}{ * metrics before computing branch metrics as in the half rate case.}}
\DoxyCodeLine{418 \textcolor{comment}{ */}}
\DoxyCodeLine{419 \_\_always\_inline \textcolor{keyword}{static} \textcolor{keywordtype}{void} \_sse\_metrics\_k7\_n4(\textcolor{keyword}{const} int16\_t *val,}
\DoxyCodeLine{420         \textcolor{keyword}{const} int16\_t *out, int16\_t *sums, int16\_t *paths, \textcolor{keywordtype}{int} norm)}
\DoxyCodeLine{421 \{}
\DoxyCodeLine{422         \_\_m128i m0, m1, m2, m3, m4, m5, m6, m7;}
\DoxyCodeLine{423         \_\_m128i m8, m9, m10, m11, m12, m13, m14, m15;}
\DoxyCodeLine{424 }
\DoxyCodeLine{425         \textcolor{comment}{/* (PMU) Load accumulated path metrics */}}
\DoxyCodeLine{426         m0 = \_mm\_load\_si128((\_\_m128i *) \&sums[0]);}
\DoxyCodeLine{427         m1 = \_mm\_load\_si128((\_\_m128i *) \&sums[8]);}
\DoxyCodeLine{428         m2 = \_mm\_load\_si128((\_\_m128i *) \&sums[16]);}
\DoxyCodeLine{429         m3 = \_mm\_load\_si128((\_\_m128i *) \&sums[24]);}
\DoxyCodeLine{430         m4 = \_mm\_load\_si128((\_\_m128i *) \&sums[32]);}
\DoxyCodeLine{431         m5 = \_mm\_load\_si128((\_\_m128i *) \&sums[40]);}
\DoxyCodeLine{432         m6 = \_mm\_load\_si128((\_\_m128i *) \&sums[48]);}
\DoxyCodeLine{433         m7 = \_mm\_load\_si128((\_\_m128i *) \&sums[56]);}
\DoxyCodeLine{434 }
\DoxyCodeLine{435         \textcolor{comment}{/* (PMU) Deinterleave into even and odd packed registers */}}
\DoxyCodeLine{436         SSE\_DEINTERLEAVE\_K7(m0, m1, m2, m3 ,m4 ,m5, m6, m7,}
\DoxyCodeLine{437                             m8, m9, m10, m11, m12, m13, m14, m15)}
\DoxyCodeLine{438 }
\DoxyCodeLine{439         \textcolor{comment}{/* (BMU) Load and expand 8-\/bit input out to 16-\/bits */}}
\DoxyCodeLine{440         m7 = \_mm\_castpd\_si128(\_mm\_loaddup\_pd((\textcolor{keywordtype}{double} \textcolor{keyword}{const} *) val));}
\DoxyCodeLine{441 }
\DoxyCodeLine{442         \textcolor{comment}{/* (BMU) Load and compute branch metrics */}}
\DoxyCodeLine{443         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[0]);}
\DoxyCodeLine{444         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[8]);}
\DoxyCodeLine{445         m2 = \_mm\_load\_si128((\_\_m128i *) \&out[16]);}
\DoxyCodeLine{446         m3 = \_mm\_load\_si128((\_\_m128i *) \&out[24]);}
\DoxyCodeLine{447 }
\DoxyCodeLine{448         SSE\_BRANCH\_METRIC\_N4(m0, m1, m2, m3, m7, m4)}
\DoxyCodeLine{449 }
\DoxyCodeLine{450         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[32]);}
\DoxyCodeLine{451         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[40]);}
\DoxyCodeLine{452         m2 = \_mm\_load\_si128((\_\_m128i *) \&out[48]);}
\DoxyCodeLine{453         m3 = \_mm\_load\_si128((\_\_m128i *) \&out[56]);}
\DoxyCodeLine{454 }
\DoxyCodeLine{455         SSE\_BRANCH\_METRIC\_N4(m0, m1, m2, m3, m7, m5)}
\DoxyCodeLine{456 }
\DoxyCodeLine{457         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[64]);}
\DoxyCodeLine{458         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[72]);}
\DoxyCodeLine{459         m2 = \_mm\_load\_si128((\_\_m128i *) \&out[80]);}
\DoxyCodeLine{460         m3 = \_mm\_load\_si128((\_\_m128i *) \&out[88]);}
\DoxyCodeLine{461 }
\DoxyCodeLine{462         SSE\_BRANCH\_METRIC\_N4(m0, m1, m2, m3, m7, m6)}
\DoxyCodeLine{463 }
\DoxyCodeLine{464         m0 = \_mm\_load\_si128((\_\_m128i *) \&out[96]);}
\DoxyCodeLine{465         m1 = \_mm\_load\_si128((\_\_m128i *) \&out[104]);}
\DoxyCodeLine{466         m2 = \_mm\_load\_si128((\_\_m128i *) \&out[112]);}
\DoxyCodeLine{467         m3 = \_mm\_load\_si128((\_\_m128i *) \&out[120]);}
\DoxyCodeLine{468 }
\DoxyCodeLine{469         SSE\_BRANCH\_METRIC\_N4(m0, m1, m2, m3, m7, m7)}
\DoxyCodeLine{470 }
\DoxyCodeLine{471         \textcolor{comment}{/* (PMU) Butterflies: 0-\/15 */}}
\DoxyCodeLine{472         SSE\_BUTTERFLY(m8, m9, m4, m0, m1)}
\DoxyCodeLine{473         SSE\_BUTTERFLY(m10, m11, m5, m2, m3)}
\DoxyCodeLine{474 }
\DoxyCodeLine{475         \_mm\_store\_si128((\_\_m128i *) \&paths[0], m0);}
\DoxyCodeLine{476         \_mm\_store\_si128((\_\_m128i *) \&paths[8], m2);}
\DoxyCodeLine{477         \_mm\_store\_si128((\_\_m128i *) \&paths[32], m9);}
\DoxyCodeLine{478         \_mm\_store\_si128((\_\_m128i *) \&paths[40], m11);}
\DoxyCodeLine{479 }
\DoxyCodeLine{480         \textcolor{comment}{/* (PMU) Butterflies: 17-\/31 */}}
\DoxyCodeLine{481         SSE\_BUTTERFLY(m12, m13, m6, m0, m2)}
\DoxyCodeLine{482         SSE\_BUTTERFLY(m14, m15, m7, m9, m11)}
\DoxyCodeLine{483 }
\DoxyCodeLine{484         \_mm\_store\_si128((\_\_m128i *) \&paths[16], m0);}
\DoxyCodeLine{485         \_mm\_store\_si128((\_\_m128i *) \&paths[24], m9);}
\DoxyCodeLine{486         \_mm\_store\_si128((\_\_m128i *) \&paths[48], m13);}
\DoxyCodeLine{487         \_mm\_store\_si128((\_\_m128i *) \&paths[56], m15);}
\DoxyCodeLine{488 }
\DoxyCodeLine{489         \textcolor{keywordflow}{if} (norm)}
\DoxyCodeLine{490                 SSE\_NORMALIZE\_K7(m4, m1, m5, m3, m6, m2,}
\DoxyCodeLine{491                                  m7, m11, m0, m8, m9, m10)}
\DoxyCodeLine{492 }
\DoxyCodeLine{493         \_mm\_store\_si128((\_\_m128i *) \&sums[0], m4);}
\DoxyCodeLine{494         \_mm\_store\_si128((\_\_m128i *) \&sums[8], m5);}
\DoxyCodeLine{495         \_mm\_store\_si128((\_\_m128i *) \&sums[16], m6);}
\DoxyCodeLine{496         \_mm\_store\_si128((\_\_m128i *) \&sums[24], m7);}
\DoxyCodeLine{497         \_mm\_store\_si128((\_\_m128i *) \&sums[32], m1);}
\DoxyCodeLine{498         \_mm\_store\_si128((\_\_m128i *) \&sums[40], m3);}
\DoxyCodeLine{499         \_mm\_store\_si128((\_\_m128i *) \&sums[48], m2);}
\DoxyCodeLine{500         \_mm\_store\_si128((\_\_m128i *) \&sums[56], m11);}
\DoxyCodeLine{501 \}}

\end{DoxyCode}
