Mail Archives: pgcc/1998/06/09/19:48:04
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 -