void combine5(vec_ptr v,data_t *dest) {
long i;
long length = vec_length(v);
long limit = length-4; //changed
data_t *data = get_vec_start(v);
data_t acc = IDENT;
/* Combine 5 elements at a time */
for (i =0; i< limit; i+=5) { //changed
acc = (acc OP data[i]) OP data[i+1]; //changed
acc = (acc OP data[i+2]) OP data[i+3]; //changed
acc = acc OP data[i+4]; //changed
/* Finish any remaining elements */
for (; i < length; i++) {
acc = acc OP data[i];
}
*dest = acc;
}
深入理解计算机系统 CSAPP 练习题5.7
于 2024-06-03 15:14:01 首次发布