3 ms·
Nice introduction to data prefetching. I don't fully agree with this statement, though: Second, programmers have very little control over instruction placement
by zwieback 15y ago
Nice introduction to data prefetching. I don't fully agree with this statement, though:
Second, programmers have very little control over instruction placement in memory.
Depending on your platform and type of application you may have full control over instruction placement and it might be extremely important to know how to sequence instructions to get maximum performance.
- keeperofdakeys 15y agoAssuming he is talking about languages like C, and you don't use inline assembly, I don't see how you can have any control. For anything complex, your compiler will probably do a much better job then you in creating fast assembly.In the case you can do better, you would just inline the code, so you only have control over that small part.
- deleted 15y ago[deleted]
- zwieback 15y agoI was talking about assembly. In DSP applications it's common to worry about the precise sequence of assembly instructions. Compilers are very, very good in general but for new and exotic architectures it's not uncommon to have inner loops in hand-coded assembly. The examples in the article were in a HLL but the site is about chips, the next article about mixing HDLs and HLLs so I thought it was fair pointing out that there's something at the lower levels.
- Hoff 15y agoIt's certainly possible to have that control via assembler, where folks are programming in that. So strictly speaking, yes, your "may" can be true. For C or another language, here's some related reading on that topic, and where you can get into deep trouble with this: http://www.hpl.hp.com/personal/Hans_Boehm/misc_slides/pldi05_threads.pdf http://www.hpl.hp.com/personal/Hans_Boehm/misc_slides/pldi05... http://www.hpl.hp.com/personal/Hans_Boehm/misc_slides/reordering.pdf http://www.hpl.hp.com/personal/Hans_Boehm/misc_slides/reorde... http://www.hpl.hp.com/techreports/2005/HPL-2005-217R1.pdf http://www.hpl.hp.com/techreports/2005/HPL-2005-217R1.pdf http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf