Jump to...
Columns:
Advanced Software and Technologies
BYTE Media Lab
Chaos Manor
Conference Reports
Features
Free Features
Gigglebytes
Letters to BYTE.com
Mr. Computer Language Person
New Products
Op/Ed
Portable Computing
Serving with Linux
The Upgrade Advisor
MMX Misaligned
October
1996
/
Inbox
/ MMX Misaligned
On reading your article on MMX performance optimization ("Programming Strategies for Intel's MMX," August), I find the example stack prologue code on page 64 does nothing to cause 64-b
it alignment, only 32-bit alignment. The alignment mask should be 0FFFFFFF8, not 0FFFFFFFC.
Jan Bottorff
janb@pmatrix.com
You are correct. The assembly code listing in the text box "Maintaining Stack Alignment contained an error and, as a result, aligns the stack to 32 bits. In order to align the stack to 64 bits, the alignment mask should be 0FFFFFFF8, as shown below.--Bev Bachmayer, Intel Corp.
Prologue:
push ebp ;save old frame ptr
mov ebp, esp ;make new frame ptr
sub ebp, 4 ;make room for stack ptr
and ebp, 0FFFFFFF8 ;align to 64-bits
mov
[ebp], esp ;save old stack ptr
mov esp, ebp ;copy alignment ptr
sub esp, FRAMESIZE ;allocate space
Matthew Wilson
My approach to software engineering is far more pragmatic than it
is
theoretical--and no language better exemplifies this than C++.
more...
BYTE Digest editors every month analyze and evaluate the best articles from Information Week , EE Times , Dr. Dobb's Journal , Network Computing , Sys Admin ,
and dozens of other CMP publications—bringing
you critical news and information about wireless communication,
computer security, software development, embedded systems,
and more!
Find out more