This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC


Hi,

Martin wrote:

It strikes me this is part of a larger problem. It seems there is (in many companies / institutions there is a large divide between the people who design processors and the people who write compilers.

Well it's going a little off-topic, but this doesn't always happen. The gcc port I've been optimizing for the Ubicom IP3000 series has been part of a joint development effort that has been optimizing the instruction set, the compiler and the operating system and protocol stacks that will be its primary function. It's not perfect but we've learned from a few mistakes in the first ISA definition and the before we finish the second version we'll make sure we have a working compiler and simulator first :-)


I would note though that good as our gcc port is we have still ended up adopting several machine-specific optimizations where we can make opportunistic gains within the machine-dependent reorg pass. Attempting to target these earlier pessimizes the code quite badly, but we have to use customized RTL-level optimizations because we may be replacing say 2 or 3 instructions spread over perhaps 4 or 5 instructions in total. While this is at the more acceptable end of processor-specific optimization I do have some sympathy with folks who find that gcc can't quite do what they want at times.

There will always be situations where for very good reasons specific instructions will be added to an ISA but that may be hard to utilize well within gcc. There may well be very good reasons why these instructions make sense though and arguing that a more pure-RISC strategy (one that makes it easy to target with compilers) will solve all of the world's problems isn't the right answer either ;-)

FWIW though I'd note that I've generally found that the most bizarre instructions do not originate with the processor designers but from operating system and application developers who demand magic instructions to save cycles in critical places. These are usually also the same people who complain when the compiler can't use their magic instructions very well :-)


Regards, Dave


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]