Reputation: 20581
currently I have code that is being cut off at the < in the for loop because the browser treats it as a tag, does anyone have a fix for this?:
<pre class="prettyprint">
int count_simd(char *arr, int len, char key) {
int count = 0;
__m128i sixteenValues = _mm_setzero_si128();
__m128i result = _mm_setzero_si128();
__m128i keyV = _mm_set1_epi8(key);
for(int j=0; j < len/16*16; j+=16){
sixteenValues =_mm_load_si128((__m128i*)(arr+j));
result = _mm_sub_epi8(result, _mm_cmpeq_epi8(sixteenValues, keyV));
}
for(int i=len/16*16; i<len; i++){
if(arr[i]==key)
count++;
}
char A[16];
_mm_store_si128((__m128i*)A, result);
for(int k=0; k<16; k++){
count+=*(A+k);
}
return count;
}
</pre>
In the source of the rendered page, everything comes up right until:
<len; i++){="" if(arr[i]="=key)" count++;="" }="" char="" a[16];="" _mm_store_si128((__m128i*)a,="" result);="" for(int="" k="0;" k<16;="" k++){="" count+="*(A+k);" return="" count;="" <="" pre=""><span class="pln">
</span></len;>
Thanks!
Upvotes: 1
Views: 118
Reputation:
Your HTML is invalid. Even inside a <pre>
element, the <
, >
, and &
characters must be encoded as <
, >
, and &
, respectively.
Upvotes: 2