www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1998/06/09/19:48:04

X-pop3-spooler: POP3MAIL 2.1.0 b 4 980420 -bs-
Message-ID: <19980609213504.45507@cerebro.laendle>
Date: Tue, 9 Jun 1998 21:35:04 +0200
From: Marc Lehmann <pcg AT goof DOT com>
To: beastium <beastium-list AT Desk DOT nl>
Subject: Re: gcc-2.8.1, pgcc-2.90.29 980515, and cmovb
Mail-Followup-To: beastium <beastium-list AT desk DOT nl>
References: <199806091550 DOT KAA05661 AT mail DOT mankato DOT msus DOT edu>
Mime-Version: 1.0
In-Reply-To: <199806091550.KAA05661@mail.mankato.msus.edu>; from Jeffrey Hundstad on Tue, Jun 09, 1998 at 10:50:17AM -0500
X-Operating-System: Linux version 2.1.105 (root AT cerebro) (gcc version pgcc-2.91.34 19980530 (gcc2 ss-980502 experimental))
Status: RO
Lines: 46

On Tue, Jun 09, 1998 at 10:50:17AM -0500, Jeffrey Hundstad wrote:
> I'm just currious... I've taken a look at the tetrary operator with
> trivial selector and trivial conditional operations, and dumped the
> assembly code from both 2.8.1 and pgcc-980515.
> 
> pgcc does:
>         cmpl %eax,%edx
>         jbe .L2
>         movl %edx,%eax
> ..L2:
> 
> while 2.8.1 does:
>         cmpl %edx,%eax
>         cmovb %edx,%eax

The 2.8.1 implementation of cmov is buggy, therefore, it is disabled in egcs
and pgcc. 980608 has them enabled again.

> It seems like 2.8.1 would cause less pain an anguish to the cpu...
> aren't jumps bad... and avoided at all cost?

Yes.

> I wrapped a clock couter around the tetrary op. and it appears to cost
> the same either way...

As long as it is correctly predicted, yes. Still cache-effects make the
first version slower.

>   c = (a > b) ? a : b;

        cmpl %edx,%eax
        cmovb %edx,%eax

gcc version pgcc-2.91.37 19980608 (gcc2 ss-980502 experimental)

I probably won't be able to make a 0608 snapshot (either tomorrow or never),
so either expect 0608 on thursday, or next weeks snapshot.

      -----==-                                              |
      ----==-- _                                            |
      ---==---(_)__  __ ____  __       Marc Lehmann       +--
      --==---/ / _ \/ // /\ \/ /       pcg AT goof DOT com       |e|
      -=====/_/_//_/\_,_/ /_/\_\                          --+
    The choice of a GNU generation                        |
                                                          |

- Raw text -


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