Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesMMX 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


Up to the Inbox section contentsGo to previous article: Free PCs!Go to next article: FixesSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
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

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

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network