Article View: gnu.gcc.help
Article #50926Re: Branch prediction pragma
From: Will Athanasiou
Date: Tue, 27 Jul 1993 21:03
Date: Tue, 27 Jul 1993 21:03
46 lines
2802 bytes
2802 bytes
While a pragma would be a nice idea.. There are a lot of times
that the compiler should be able to determine (or at least make a
good guess) if a conditional branch will be taken more often than
not.
For instance, loops with constant limits (for (i=0;i <10;i++))
would be a prime example of where a pragma shouldn't be needed.
The optimizer should provide enough information to allow the
MD file to choose between branches that win on fall through, or
taken.
On machines like the i860, where branch delay slots are useful
only if the branch is taken more often than not, this type of
information would be a huge win! Is there a way to even
determine the direction of the branch (up or down the instruction
stream.)?
I think the loop optimization code could use some improvements in
other areas as well. More and more, chips are coming out with
`repeat block' instructions. For example the TI C40 chip has a
repeat instruction n times, as well as a repeat block n times
instruction. I think the powerPC has one as well (somebody
correct me if I'm wrong). Right now, it would be very hard to
write a pattern for those instructions.
In effect, the DBRA instruction on the 680x0 processors is a
repeat block instruction as well. Even the BLA instruction on
the I860 could be used as a repeat block instruction, if enough
information was known about the contents of the loop (no function
calls, no other BLA loops...).
Maybe what is needed is a new type of loop_block pattern, with a
sequence of instructions as one of its arguments.
Just a thought..
Will.
----------------------------------------------------------------------
___________ William Athanasiou, Software Engineer
/ ________/__ ...!{harvard,decvax,uunet}!masscomp!will
/__/_______/ / will@westford.ccur.com
Concurrent /__________/ Phone: (508) 392-2647
Computer Corporation FAX: Fax? We don't need no stinkin Faxes!
----------------------------------------------------------------------
Technical Details
Message-ID:
<WILL.93Jul27170322@fred.usenet>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!noc.near.net!usenet.ccur.com!usenet!willReferences:
<JTSILLA.93Jul24111624@dec5200b.ccs.northeastern.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,4e9ca1c0df4c621f X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-07-27 18:48:57 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!noc.near.net!usenet.ccur.com!usenet!will From: will@fred.usenet (Will Athanasiou) Subject: Re: Branch prediction pragma In-Reply-To: jtsilla@dec5200b.ccs.northeastern.edu's message of Sat, 24 Jul 1993 16:16:24 GMT Message-ID: <WILL.93Jul27170322@fred.usenet> Sender: usenet@westford.ccur.com (UNIX News) Organization: Concurrent Computer Corporation References: <JTSILLA.93Jul24111624@dec5200b.ccs.northeastern.edu> Distribution: gnu Date: Tue, 27 Jul 1993 21:03:22 GMT Lines: 48