delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/03/08/20:07:54

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Date: Mon, 8 Mar 1999 20:07:00 -0500
Message-Id: <199903090107.UAA19534@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: earnie_boyd AT yahoo DOT com
CC: cygwin AT sourceware DOT cygnus DOT com
In-reply-to: <19990309005620.2525.rocketmail@send102.yahoomail.com> (message
from Earnie Boyd on Mon, 8 Mar 1999 16:56:20 -0800 (PST))
Subject: Re: problem with cygwin version of egcs
References: <19990309005620 DOT 2525 DOT rocketmail AT send102 DOT yahoomail DOT com>

> Showing my ignorance here, can you explain in more detail?

To make up an example, consider the JCXZ instruction - jump if CX is
zero.  On older CPUs, it was faster than the corresponding risc-like
options.  This chart shows the number of clocks used if the jump is
taken:

			8086	80486
	JCXZ foo	 16	  8

	CMP CX,0	  4	  1
	JZ foo		 16	  3

	OR CX,CX	  3	  1
	JZ foo		 16	  3

As you can see, on the 8086 it's faster to use JCXZ but on the 80486,
it's faster to use separate compare and jump instructions.

Newer processors optimized the common instructions (mov, or, cmp, jz)
so much that it's now faster to use them than the single JCXZ
instruction.  So, if you're planning on running on an old machine,
you'd want one set of instructions, but if you're running on a newer
machine, you'd want a different set.  Both sets will work perfectly
well on either machine, but different ones are optimal depending on
the machine chosen.  The gcc switch to select 386 vs 486 vs 586 does
exactly that - it chooses among equally functional alternatives based
on which is expected to perform better on the indicated platform.

Note that this does *not* mean that gcc can't choose to use
instructions that won't run on older machines - it certainly has that
option if the gcc programmers have added it.  For example, the 486 has
added various bit test instructions that gcc may know about (I don't
know).  However, the option to enable these extra opcodes is not the
one that we're talking about here, if such an option exists at all.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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