delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/04/02:14:35

Sender: nate AT cartsys DOT com
Message-ID: <36B7A3E8.BD49F3BC@cartsys.com>
Date: Tue, 02 Feb 1999 17:18:32 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.36 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Question about long long math on intel archs
References: <3 DOT 0 DOT 6 DOT 32 DOT 19990202153421 DOT 0091a590 AT pop DOT netaddress DOT com>
Reply-To: djgpp AT delorie DOT com

Paul Derbyshire wrote:
> 
> How does GCC on an intel arch (and therefore, DJGPP) manage long long
> arithmetic? Using software or hardware, and then, using the FPU directly,
> using MMX, or just using regular x86 instructions? Or a mixture?

Regular integer instructions.  So `long long x,y; x += y' will look
something like:

movl y, %eax
addl %eax, x
movl y+4, %eax
adcl %eax, x+4

You could find out much more easily by writing a simple function and
compiling with `-S'.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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