Вопрос

Suppose I have two array-of-structures (the structures have the same type, size, field offsets etc.), and I want to copy the first field of all structures in the first array onto the first field of the structures in the second array.

Do modern Intel, AMD, ARM and other CPUs support such operations other than through a sequence of load and store instructions for every corresponding structure pair?

If the answer is 'Yes', then what about the case in which the target structures do not have the same type, size and fields (i.e. when the source data stride is different that than target data stride, but both are known)?

Нет правильного решения

Другие советы

There are no special strided load/store instructions, but the hardware prefetch mechanism will detect strided accesses and start automatic prefetching once it detects a pattern (and assuming that there is spare bandwidth).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top