caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* What's "advantage of gcc-specific features"?
@ 2006-04-22  1:37 Yu-Hui Liu
  2006-04-22  1:46 ` [Caml-list] " Jonathan Roewen
  2006-04-22  9:47 ` David MENTRE
  0 siblings, 2 replies; 8+ messages in thread
From: Yu-Hui Liu @ 2006-04-22  1:37 UTC (permalink / raw)
  To: caml-list

Hi, there,

I'm reading the INSTALL file and want to know more about the first 
prerequisite. :-)  It says,

* The GNU C compiler gcc is recommended, as the bytecode
  interpreter takes advantage of gcc-specific features to enhance
  performance.

What does the "advantage of gcc-specific features" really mean? Who knows?

Also I want to know if someone knows if there's anything "tricky" on 
Solaris platform for using OCaml?

Thanks.
Calvin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] What's "advantage of gcc-specific features"?
  2006-04-22  1:37 What's "advantage of gcc-specific features"? Yu-Hui Liu
@ 2006-04-22  1:46 ` Jonathan Roewen
  2006-04-22  4:09   ` Michael Benfield
  2006-04-22  9:47 ` David MENTRE
  1 sibling, 1 reply; 8+ messages in thread
From: Jonathan Roewen @ 2006-04-22  1:46 UTC (permalink / raw)
  To: Yu-Hui Liu; +Cc: caml-list

> What does the "advantage of gcc-specific features" really mean? Who knows?

Uses threaded code (labels as first-class values & goto) rather than a
big switch for the interpreter loop.

Jonathan


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] What's "advantage of gcc-specific features"?
  2006-04-22  1:46 ` [Caml-list] " Jonathan Roewen
@ 2006-04-22  4:09   ` Michael Benfield
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Benfield @ 2006-04-22  4:09 UTC (permalink / raw)
  Cc: caml-list

In case Mr. Roewen's reply was too terse or if you don't know much
about virtual machine implementation (not that I do...), here is a
fuller explanation of why the interepreter can be faster in GCC:

In GCC, unlike standard C, you can take the address of a goto label as
described here:

http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/Labels-as-Values.html#Labels-as-Values

So whereas normally in a C implementation you would do something like this:

start:
switch(*ptr) {
  case INSTRUCTION_1:
    do_stuff();
    ptr++;
    goto start;
  case INSTRUCTION_2:
    do_stuff2();
    ptr++;
    goto start;
  /* ... etc ... */
}

That is, each instruction for the virtual machine is represented as an
otherwise meaningless integer and you have to do a switch statement
for each one, and however your C compiler optimizes that, is what you
get. On the other hand, if you can take the address of a label, you
can go through the virtual machine instructions and replace each
arbitrary integer instruction with the address of a goto label
corresponding to that instruction. Then you can do this:

instruction_1:
  do_stuff();
  ptr++;
  goto *ptr;
instruction_2:
  do_stuff2();
  ptr++;
  goto *ptr;
  /* ... etc ... */

Since this provides a speedup for every VM instruction, it's quite a boost.

I think it's rather unfortunate this is not part of standard C.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] What's "advantage of gcc-specific features"?
  2006-04-22  1:37 What's "advantage of gcc-specific features"? Yu-Hui Liu
  2006-04-22  1:46 ` [Caml-list] " Jonathan Roewen
@ 2006-04-22  9:47 ` David MENTRE
  2006-04-22 16:14   ` John Carr
  1 sibling, 1 reply; 8+ messages in thread
From: David MENTRE @ 2006-04-22  9:47 UTC (permalink / raw)
  To: Yu-Hui Liu; +Cc: caml-list

Hello,

Yu-Hui Liu <Calvin.Liu@Sun.COM> writes:

> Also I want to know if someone knows if there's anything "tricky" on
> Solaris platform for using OCaml?

I don't think so. BTW, John Carr, from MIT, is maintaining a port of
native OCaml compiler to Sparc V9 architecture
(http://www.mit.edu/~jfc/) and he is working on Solaris system. As far
as I know, his patches have been contributed back to OCaml official
tree. So I would say that the Solaris is pretty well supported and
performance should be quite acceptable.

But the best way is probably to try it by yourself. 


Best wishes,
d.
-- 
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <dmentre@linux-france.org>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] What's "advantage of gcc-specific features"?
  2006-04-22  9:47 ` David MENTRE
@ 2006-04-22 16:14   ` John Carr
  2006-04-22 23:15     ` Erik de Castro Lopo
  0 siblings, 1 reply; 8+ messages in thread
From: John Carr @ 2006-04-22 16:14 UTC (permalink / raw)
  To: caml-list, Yu-Hui Liu


> BTW, John Carr, from MIT, is maintaining a port of
> native OCaml compiler to Sparc V9 architecture
> (http://www.mit.edu/~jfc/) and he is working on Solaris system. As far
> as I know, his patches have been contributed back to OCaml official
> tree. So I would say that the Solaris is pretty well supported and
> performance should be quite acceptable.

The OCaml maintainers do not have a 64 bit SPARC system to test
on and can not take over my port.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] What's "advantage of gcc-specific features"?
  2006-04-22 16:14   ` John Carr
@ 2006-04-22 23:15     ` Erik de Castro Lopo
  2006-04-23 12:27       ` David MENTRE
  0 siblings, 1 reply; 8+ messages in thread
From: Erik de Castro Lopo @ 2006-04-22 23:15 UTC (permalink / raw)
  To: caml-list

John Carr wrote:

> The OCaml maintainers do not have a 64 bit SPARC system to test
> on and can not take over my port.

People who own 64 bit SPARC systems and want to see the SPARC
port continued should contact SUN and suggest that SUN supply
a machine for the Ocaml developers.

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"Unix, is novice hostile... Windows, is expert hostile."
-- BCS on digitalmars.D


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] What's "advantage of gcc-specific features"?
  2006-04-22 23:15     ` Erik de Castro Lopo
@ 2006-04-23 12:27       ` David MENTRE
  2006-04-23 16:43         ` Xavier Leroy
  0 siblings, 1 reply; 8+ messages in thread
From: David MENTRE @ 2006-04-23 12:27 UTC (permalink / raw)
  To: Erik de Castro Lopo; +Cc: caml-list

Erik de Castro Lopo <ocaml-erikd@mega-nerd.com> writes:

> John Carr wrote:
>
>> The OCaml maintainers do not have a 64 bit SPARC system to test
>> on and can not take over my port.

I'm quite surprised. INRIA had tons of SPARC systems in the past (this
is at least true at INRIA Rennes). Was it impossible for the OCaml team
to get some of these systems when they were changed for PCs?

> People who own 64 bit SPARC systems and want to see the SPARC
> port continued should contact SUN and suggest that SUN supply
> a machine for the Ocaml developers.

That's said, a port of OCaml (and its GC ;-) on a 8 core, 4 threads per
core, latest Niagara processor (aka OpenSparc T1[1]) could be an
interesting task. :-)

Best wishes,
d.

Footnotes: 
[1]  http://opensparc-t1.sunsource.net/index.html

-- 
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <dmentre@linux-france.org>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] What's "advantage of gcc-specific features"?
  2006-04-23 12:27       ` David MENTRE
@ 2006-04-23 16:43         ` Xavier Leroy
  0 siblings, 0 replies; 8+ messages in thread
From: Xavier Leroy @ 2006-04-23 16:43 UTC (permalink / raw)
  To: David MENTRE; +Cc: Erik de Castro Lopo, caml-list

>>>The OCaml maintainers do not have a 64 bit SPARC system to test
>>>on and can not take over my port.
>
> I'm quite surprised. INRIA had tons of SPARC systems in the past (this
> is at least true at INRIA Rennes). Was it impossible for the OCaml team
> to get some of these systems when they were changed for PCs?

My research group and other groups in the vicinity stopped buying Sun
workstations circa 1994, as much better alternatives have been
available since then.  SPARCstations remained popular for a while with
our network administrators, as small servers, but I don't think I
could dumpster-dive and get any SPARCstation built in the 21st century.

Besides, resurrecting old hardware is time-consuming and generally
disappointing.  ("Oh my God, look at the dust cloud it coughed!  Hmmm,
that runs really slow...  The OS is five major versions behind!  Where
is my favorite open source software?  Ah, there's no CDROM in this
beast.  Where did I put my vintage external SCSI 1x CDROM?  (One
hour later.)  Damn, the internal disk is too small."  etc.)

>>People who own 64 bit SPARC systems and want to see the SPARC
>>port continued should contact SUN and suggest that SUN supply
>>a machine for the Ocaml developers.

Good idea.  It would look good in the machine room :-)

- Xavier Leroy


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-04-23 16:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-22  1:37 What's "advantage of gcc-specific features"? Yu-Hui Liu
2006-04-22  1:46 ` [Caml-list] " Jonathan Roewen
2006-04-22  4:09   ` Michael Benfield
2006-04-22  9:47 ` David MENTRE
2006-04-22 16:14   ` John Carr
2006-04-22 23:15     ` Erik de Castro Lopo
2006-04-23 12:27       ` David MENTRE
2006-04-23 16:43         ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).