Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to load a sliding diagonal vector from data stored column-wise with SSE
    primarykey
    data
    text
    <p>The sliding diagonal vector contains 16 elements, each one an 8-bit unsigned integer.</p> <p>Without SSE and a bit simplified it would have looked like this in C:</p> <pre class="lang-c prettyprint-override"><code>int width=1000000; // a big number uint8_t matrix[width][16]; fill_matrix_with_interesting_values(&amp;matrix); for (int i=0; i &lt; width - 16; ++i) { uint8_t diagonal_vector[16]; for (int j=0; j&lt;16; ++j) { diagonal_vector[j] = matrix[i+j][j]; } do_something(&amp;diagonal_vector); } </code></pre> <p>but in my case I can only load column-wise (vertically) from the matrix with the <code>_mm_load_si128</code> intrinsics function. The sliding diagonal vector is moving horizontally so I need to load 16 column vectors in advance and use one element from each of those column vectors to create the diagonal vector.</p> <p>Is it possible to make a fast low-memory implementation for this with SSE?</p> <p><strong>Update Nov 14 2016:</strong> Providing some more details. In my case I read single-letter codes from a text file in <a href="https://en.wikipedia.org/wiki/FASTA_format" rel="nofollow noreferrer">FASTA format</a>. Each letter represents a certain amino acid. Each amino acid has a specific column vector associated with it. That column vector is looked up from a constant table (a <a href="https://en.wikipedia.org/wiki/BLOSUM" rel="nofollow noreferrer">BLOSUM</a> matrix). In C code it would look like this</p> <pre class="lang-c prettyprint-override"><code>while (uint8_t c = read_next_letter_from_file()) { column_vector = lookup_from_const_table(c) uint8_t diagonal_vector[16]; ... rearrange the values from the latest column vectors into the diagonal_vector ... do_something(&amp;diagonal_vector) } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload