Browse thread
Estimating the size of the ocaml community
-
Yaron Minsky
-
Christopher A. Watford
-
Frédéric_Gava
-
skaller
-
Erik de Castro Lopo
- Olivier_Pérès
-
Thomas Fischbacher
-
Frédéric_Gava
-
Thomas Fischbacher
- Paul Snively
- josh
- Richard Jones
-
Jon Harrop
-
Michael Walter
-
Jon Harrop
- Damien Doligez
- Thomas Fischbacher
- Michael Walter
-
Radu Grigore
- Gerd Stolpmann
- Jon
-
Jon Harrop
- Thomas Fischbacher
- Richard Jones
-
Michael Walter
- Ville-Pertti Keinonen
- Oliver Bandel
- Basile STARYNKEVITCH
-
Thomas Fischbacher
- ronniec95@l...
- skaller
- chris.danx
-
Frédéric_Gava
-
Erik de Castro Lopo
- sejourne_kevin
- Stefano Zacchiroli
-
skaller
-
Frédéric_Gava
- Kenneth Knowles
- Michael Jeffrey Tucker
- Richard Jones
- Nicolas Cannasse
- Evan Martin
- Eric Stokes
- chris.danx
- Sylvain LE GALL
- sejourne_kevin
- Sven Luther
- Johann Spies
-
Christopher A. Watford
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2005-02-07 (13:07) |
From: | Marcin 'Qrczak' Kowalczyk <qrczak@k...> |
Subject: | Re: [Caml-list] The boon of static type checking |
Brian Hurt <bhurt@spnz.org> writes: > Hint: I've yet to meet a compiler that couldn't turn x/32 into > x >> 5. Actually this is incorrect when x is a signed type (and might be negative). Strictly speaking, the sign of the quotient when either argument is negative is implementation-defined in C++, but GCC prefers to be consistent (it's the sign of the dividend when idiv is used, but shifting would yield the sign of the divisor). This means that when I care about performance and perform division of a number that I know is non-negative by a number which might be a constant power of 2, I cast the divisor to an unsigned type. The same applies to remainder. > Actually, g++ does do tail call optimization (in the 3.x tree). It's > actually not that hard to do, just not that beneficial (for C++). It is hard: - With the default C/C++ calling convention it's impossible if parameters of the callee take more space than parameters of the caller. - On x86 in PIC it would make calls from extern functions to some static functions slower. Because the callee assumes that %ebx allows to find data of our module, yet *our* caller in general assumes that we will restore %ebx. Instead of making these functions slower for all calls (by setting up and restoring %ebx in the callee too), GCC doesn't perform tail call optimization in this case. - It requires from the compiler to infer that addresses of our local variables don't leak to code which might use them while the tail-called function is running. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/