From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f8a1,4ad4dd43d4959149,start X-Google-Attributes: gid10f8a1,public X-Google-Thread: 1164f8,4ad4dd43d4959149,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,4ad4dd43d4959149,start X-Google-Attributes: gid102b75,public X-Google-ArrivalTime: 1993-08-10 16:43:09 PST Xref: gmd.de comp.arch:15483 comp.sys.dec:9401 vmsnet.alpha:712 Path: gmd.de!xlink.net!sol.ctr.columbia.edu!usc!sdd.hp.com!nigel.msen.com!yale.edu!newsserver.jvnc.net!newsserver.cshl.org!newsserver.cshl.org!not-for-mail From: wchang@phage.cshl.org ( CSHL) Newsgroups: comp.arch,comp.sys.dec,vmsnet.alpha Subject: Request for help with Alpha OSF C compiler (instruction scheduling) Date: 10 Aug 1993 19:36:14 -0400 Organization: Cold Spring Harbor Lab, NY Distribution: world Message-ID: <249bdeINN98a@phage.cshl.org> NNTP-Posting-Host: phage.cshl.org Summary: cc -O2 ignores pipeline issues? CC: wchang@cshl.org 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