From: wchang@phage.cshl.org ( CSHL)
Subject: Request for help with Alpha OSF C compiler (instruction scheduling)
Date: 11 Aug 1993 09:11:05 -0400 [thread overview]
Message-ID: <24ar59INNe80@phage.cshl.org> (raw)
I am implementing a very tight innermost loop consisting of six integer
"MAX" operations, 20 instructions altogether. While the C compiler produced
very tight code, using conditional-moves for "MAX", it apparently does
not optimize instruction scheduling. For example, it compiles
if (a>b) b=a;
if (c>d) d=c;
to
cmple a,b,$0
cmoveq $0,a,b
cmple c,d,$0
cmoveq $0,c,d
which disrupts the pipeline (instruction latency plus register $0 bottleneck)
and causes 50% performance degradation. I had to rewrite the C code as
x=(a>b);
y=(c>d);
if (x) b=a;
if (y) d=c;
to get the Alpha to perform near its spec. Even then, the compiler still
improperly rearranged some instructions. I had to undo this in the assembly
output of cc, after the loop was unrolled 4x4 = 16 times! Also, cc -O2
does not seem to use all available registers.
If anyone knows how I can obtain a different compiler (GEM?), or an
instruction scheduler, I would appreciate very much the information.
The program instr-sched.c at gatekeeper.dec.com does not do I/O, otherwise
it might solve my problem. I am using an AXP 4000/610 server running
OSF/1 V1.2 (Rev. 10).
Thanks in advance,
William Chang
Cold Spring Harbor Laboratory
100 Bungtown Road, Cold Spring Harbor, NY 11724
516-367-8866 -4229(fax)
Email: wchang@cshl.org
next reply other threads:[~1993-08-11 13:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-08-11 13:11 CSHL [this message]
-- strict thread matches above, loose matches on Subject: below --
1993-08-10 23:36 Request for help with Alpha OSF C compiler (instruction scheduling) CSHL
1993-08-11 2:13 ` Richard Kenner
1993-08-11 21:42 ` Gail L. Grant
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox