public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: DJ Delorie <dj@delorie.com>
To: earnie_boyd@yahoo.com
Cc: cygwin@sourceware.cygnus.com
Subject: Re: problem with cygwin version of egcs
Date: Wed, 31 Mar 1999 19:45:00 -0000	[thread overview]
Message-ID: <199903090107.UAA19534@envy.delorie.com> (raw)
Message-ID: <19990331194500.TvoasnLqPe34dO3vqTgZS8P57mbzcq4QvRDZC1l_zt8@z> (raw)
In-Reply-To: <19990309005620.2525.rocketmail@send102.yahoomail.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@sourceware.cygnus.com


  reply	other threads:[~1999-03-31 19:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-08 16:55 Earnie Boyd
     [not found] ` < 19990309005620.2525.rocketmail@send102.yahoomail.com >
1999-03-08 17:07   ` DJ Delorie [this message]
1999-03-31 19:45     ` DJ Delorie
1999-03-31 19:45 ` Earnie Boyd
  -- strict thread matches above, loose matches on Subject: below --
1999-03-08 11:36 Earnie Boyd
     [not found] ` < 19990308193738.13807.rocketmail@send102.yahoomail.com >
1999-03-08 12:06   ` DJ Delorie
1999-03-31 19:45     ` DJ Delorie
1999-03-31 19:45 ` Earnie Boyd
1999-03-08 11:26 John McNally
1999-03-31 19:45 ` John McNally

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199903090107.UAA19534@envy.delorie.com \
    --to=dj@delorie.com \
    --cc=cygwin@sourceware.cygnus.com \
    --cc=earnie_boyd@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).