www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1998/06/16/20:54:37

X-pop3-spooler: POP3MAIL 2.1.0 b 4 980420 -bs-
Date: Tue, 16 Jun 1998 13:47:53 -0700
Message-Id: <199806162047.NAA22579@hermes.astro.washington.edu>
From: Tom Quinn <trq AT hermes DOT astro DOT washington DOT edu>
To: beastium-list AT Desk DOT nl
Subject: Alignment and floating point performance on PII
Sender: Marc Lehmann <pcg AT goof DOT com>
Status: RO
X-Status: A
Lines: 26

I have a "C" application that is heavy on double precision floating
point.  When I run it on a Pentium II processor I noticed that the
speed of the floating point in my "inner loop" can differ by nearly a
factor of two between different calls to the function (with the same
data).

I finally tracked it down to the value of the stack pointer when
entering the function.  If the stack pointer is aligned on an 8 byte
boundary, the function runs fast; if it is not aligned on an 8 byte
boundary, it runs slow.  I've tried varies versions of egcs with and
with out the Pentium patches, and the "-malign-double" and
"-mstack-align-double" options, to no avail.

I think there is a basic problem with alignment and the i386 CALL
instruction: CALL pushes the return address (4 bytes) onto the stack,
so that a function that starts with an aligned stack will present a
misaligned stack to any function it calls. 

Has anybody else had this experience?  Any suggestions?

This is all done on a 333Mhz PII on an Intel AL440LX motherboard.

-- 
Tom Quinn	Astronomy, University of Washington
Internet:	trq AT astro DOT washington DOT edu
Phone:		206-685-9009

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019