views:

31

answers:

2

In x86 GNU Assembler there are different suffixes for memory related operations. E.g.:

movb, movs, movw, movl, movq, movt(?)

Now my question is the following:

Does the suffix has ANY effect on how the processor is getting the data out of main memory or will always be one or more 32-bit (x86) chunks loaded into the cache ?

What are the effects beside the memory access?

+3  A: 

It does not affect how memory accesses are done; the only thing that can affect that is the width of the CPU's data bus. All it affects is the granularity of the operations on the data.

Ignacio Vazquez-Abrams
+3  A: 

Those are not "suffixes". You're looking at six distinct machine instructions. Each of them moves a different amount of data. movb only moves a byte, for instance.


Ok, I see now that you were asking about cache. It will always be the case that only full cache lines are moved into cache. If the cache is 16 bytes wide, for instance, then 16 or 32 bytes is what will be moved from main memory (one or two cache lines).

However, what moves from cache into the registers depends on the instruction.

John Saunders