Answer the question
In order to leave comments, you need to log in
How to implement asynchronous fetching from RAM on c or assembler?
1 CPU is accessing ram
2 while fetching CPU is doing something else, like accessing other ram cells
Answer the question
In order to leave comments, you need to log in
How to implement asynchronous fetching from RAM on c or assembler?
memcpy
for MIPS. This code does not look asynchronous, but it is written exactly this way (first group loading into different registers, then changing the base load address, then group saving, then changing the base storage address) with the expectation that the processor can, among other things, overlap in time load, arithmetic and save operations.
reordering execution (out of order execution) the processor performs and so, that is, he himself will, if possible, do something else while loading data from memory. writing code in such a way that it is optimal for this is a separate skill that few people have now, because compilers have mastered it to perfection.
but if you interpret your question literally, then x86 (more precisely, in the sse and avx command sets) has a whole family of commands for prefetching data into different cache levels:
PREFETCHT0 - prefetch data into all levels of the cache hierarchy
PREFETCHT1 - prefetch data into level 2 cache and higher
PREFETCHT2 - prefetch data into level 2 cache and higher
and similar avx VPREFETCH(0-2) for reading and VPREFETCHE(0-2) for writing.
in the sish code, this is done through the intrinsic function _mm_prefetch;
in some thread of the cycle, you can order data loading for the next iteration, but for now, process the current iteration. there is practically no chance that you can do it better than the compiler, but for those who are capable of this, it can be useful.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question