CPU学习笔记(2)[2]

[入库:2005年9月19日] [更新:2007年3月24日]

本文简介:

> to stack space usage, such as embedded systems and operating system kernels,
> may want to reduce the preferred alignment to
> @samp.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Who has to align the stack for calls to a function - the caller or the
> callee? In other words: Does this mean that the stack has to be
> aligned before calling a function? Or does it have to be aligned when
> entering a function?
>
> Andreas
> --
> Andreas Jaeger
> SuSE Labs aj@suse.de
> private aj@arthur.inka.de
> http://www.suse.de/~aj
I believe the preferred alignment for long double is a 16 byte boundary, and
the stack (and instruction) alignments must be so set before entering a function.
Pentium 4 increases preferred data alignments to 32 bytes in some situations,
as well as increasing the number of situations (SSE2 instructions) where 16 byte
alignment is needed.


从这里可以看到,栈对齐是在调用函数之前就必须保证的:

the stack (and instruction) alignments must be so set before entering a function


相关文档:

X86汇编语言学习手记(1)
CPU学习笔记(1)
Cache Cohernce with Multi-Processor

本文关键:CPU学习笔记(2)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top