Re: Architectural support for programming languages
- From: anton@xxxxxxxxxxxxxxxxxxxxxxxxxx (Anton Ertl)
- Date: Sat, 11 Feb 2006 15:27:16 GMT
"Mayank Kaushik" <prehistorictoad2k@xxxxxxxxx> writes:
In an introductory class i also heard about processors being optimized
for particular languages. This has me confused, what would be a
microarchitectural feature that would make a, say, C compiler`s job
easier?
It's not just about making the compiler's job easier, it's mainly
about making programming language idioms run faster (especially if you
are discussing the microarchitecture).
E.g., C has more and harder-to-predict conditional branches than some
other languages (partly due to the short-circuit evaluation of flags),
so if you want to have a microarchitecture that flies on C code, you
will invest more in the branch predictor than with other languages.
Concerning architectural features: For C, which is a relatively
machine-oriented language, there are not that many such features as
for other languages, but there still are some:
- Comparison instructions on MIPS and Alpha and SETcc on the IA-32 and
AMD64 architectures produce 1 for true and 0 for false, rather than,
e.g., all-bits-set and all-bits clear (which would be better support
for Forth).
- Alpha has string support instructions for C's zero-terminated
strings.
and how would it not (possibly) be of much use to another
language?
If you don't have zero-terminated strings, the corresponding
instructions are useless. If you don't call and return much (like
many Fortran programs), you won't profit much from a return stack. If
you don't do many conditional branches (e.g., Forth), a
conditional-branch predictor will not be of much benefit.
Additionally, would object oriented languages like C++ or
Java perform better with support in a microarchitecture? could you give
an example of any such support feature?
An indirect-branch predictor.
- anton
--
M. Anton Ertl Some things have to be seen to be believed
anton@xxxxxxxxxxxxxxxxxxxxxxxxxx Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
.
- References:
- Architectural support for programming languages
- From: Mayank Kaushik
- Architectural support for programming languages
- Prev by Date: Re: Any motherboards that support ONLY latest technologies?
- Next by Date: Re: Architectural support for programming languages
- Previous by thread: Re: Architectural support for programming languages
- Next by thread: Re: Architectural support for programming languages
- Index(es):
Relevant Pages
|