目前我的代码在 for 循环中的 < 处被截断,因为浏览器将其视为标签,有人对此有修复吗?:
<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>
在渲染页面的源代码中,一切都会出现,直到:
<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;>
谢谢!