-
- if(mode == SoA) {
- const unsigned stride = type.length*type.width/8;
- PIPE_ALIGN_VAR(16) uint8_t src[4*LP_NATIVE_VECTOR_WIDTH/8];
- PIPE_ALIGN_VAR(16) uint8_t dst[4*LP_NATIVE_VECTOR_WIDTH/8];
- PIPE_ALIGN_VAR(16) uint8_t con[4*LP_NATIVE_VECTOR_WIDTH/8];
- PIPE_ALIGN_VAR(16) uint8_t res[4*LP_NATIVE_VECTOR_WIDTH/8];
- PIPE_ALIGN_VAR(16) uint8_t ref[4*LP_NATIVE_VECTOR_WIDTH/8];
- int64_t start_counter = 0;
- int64_t end_counter = 0;
- boolean mismatch;
-
- for(j = 0; j < 4; ++j) {
- random_vec(type, src + j*stride);
- random_vec(type, dst + j*stride);
- random_vec(type, con + j*stride);
- }
-
- {
- double fsrc[4];
- double fdst[4];
- double fcon[4];
- double fref[4];
- unsigned k;
-
- for(k = 0; k < type.length; ++k) {
- for(j = 0; j < 4; ++j) {
- fsrc[j] = read_elem(type, src + j*stride, k);
- fdst[j] = read_elem(type, dst + j*stride, k);
- fcon[j] = read_elem(type, con + j*stride, k);
- }
-
- compute_blend_ref(blend, fsrc, fdst, fcon, fref);
-
- for(j = 0; j < 4; ++j)
- write_elem(type, ref + j*stride, k, fref[j]);
- }
- }
-
- start_counter = rdtsc();
- blend_test_ptr(src, dst, con, res);
- end_counter = rdtsc();
-
- cycles[i] = end_counter - start_counter;
-
- mismatch = FALSE;
- for (j = 0; j < 4; ++j)
- if(!compare_vec(type, res + j*stride, ref + j*stride))
- mismatch = TRUE;
-
- if (mismatch) {
- success = FALSE;
-
- if(verbose < 1)
- dump_blend_type(stderr, blend, mode, type);
- fprintf(stderr, "MISMATCH\n");
- for(j = 0; j < 4; ++j) {
- char channel = "RGBA"[j];
- fprintf(stderr, " Src%c: ", channel);
- dump_vec(stderr, type, src + j*stride);
- fprintf(stderr, "\n");
-
- fprintf(stderr, " Dst%c: ", channel);
- dump_vec(stderr, type, dst + j*stride);
- fprintf(stderr, "\n");
-
- fprintf(stderr, " Con%c: ", channel);
- dump_vec(stderr, type, con + j*stride);
- fprintf(stderr, "\n");
-
- fprintf(stderr, " Res%c: ", channel);
- dump_vec(stderr, type, res + j*stride);
- fprintf(stderr, "\n");
-
- fprintf(stderr, " Ref%c: ", channel);
- dump_vec(stderr, type, ref + j*stride);
- fprintf(stderr, "\n");
- }
- }
- }