caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] How floats are handled in bytecode interpreter? And other questions.
@ 2017-01-22 16:56 Андрей Бергман
  2017-01-22 18:23 ` Evgeny Roubinchtein
  0 siblings, 1 reply; 3+ messages in thread
From: Андрей Бергман @ 2017-01-22 16:56 UTC (permalink / raw)
  To: caml-list

Hello!

1. Is "Caml Virtual Machine — Instruction set, v1.4" by Xavier Clerc - http://cadmium.x9c.fr/distrib/caml-instructions.pdf up to date? He describes virtual machine of 3.12, while current version is 4.04. According to GitHub logs there were some changes in the VM. Did they touch instruction set?

2. How are handled operations on floats in bytecode? In MosML, which uses bytecode machine of CamlLight, they added set of instructions FLOATOFINT, SMLNEGFLOAT, SMLADDFLOAT, SMLSUBFLOAT, SMLMULFLOAT, SMLDIVFLOAT, INTOFFLOAT and etc.

Thanks,
Andrey.

P.S.
For Hendrik Boom - a bit altered very old version of Caml Virtual Machine is used in MoscowML - implementation of SML language, based on CamlLight.

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

* Re: [Caml-list] How floats are handled in bytecode interpreter? And other questions.
  2017-01-22 16:56 [Caml-list] How floats are handled in bytecode interpreter? And other questions Андрей Бергман
@ 2017-01-22 18:23 ` Evgeny Roubinchtein
       [not found]   ` <4669031485116895@web19m.yandex.ru>
  0 siblings, 1 reply; 3+ messages in thread
From: Evgeny Roubinchtein @ 2017-01-22 18:23 UTC (permalink / raw)
  To: Андрей
	Бергман
  Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

> 1. Is "Caml Virtual Machine — Instruction set, v1.4" by Xavier Clerc -
> http://cadmium.x9c.fr/distrib/caml-instructions.pdf up to date? He
> describes virtual machine of 3.12, while current version is 4.04. According
> to GitHub logs there were some changes in the VM. Did they touch
> instruction set?
>

The definitive list of byte codes understood by the "vanila" CAML virtual
machine is in byterun/caml/instruct.h, so one could, in theory compare the
two lists side-by-side, if that is what you are asking.


> 2. How are handled operations on floats in bytecode? In MosML, which uses
> bytecode machine of CamlLight, they added set of instructions FLOATOFINT,
> SMLNEGFLOAT, SMLADDFLOAT, SMLSUBFLOAT, SMLMULFLOAT, SMLDIVFLOAT, INTOFFLOAT
> and etc.
>

They are not handled in the byte code.   They are handled by C code in the
run time.  Look around line 340 of bytecomp/bytegen.ml on Github to see how
those calls are translated.

-- 
Best,
Женя

[-- Attachment #2: Type: text/html, Size: 1630 bytes --]

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

* Re: [Caml-list] How floats are handled in bytecode interpreter? And other questions.
       [not found]   ` <4669031485116895@web19m.yandex.ru>
@ 2017-01-22 20:43     ` Evgeny Roubinchtein
  0 siblings, 0 replies; 3+ messages in thread
From: Evgeny Roubinchtein @ 2017-01-22 20:43 UTC (permalink / raw)
  To: Андрей
	Бергман
  Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

>
> And byterun/caml/instruct.cpp. This is exactly what I would like to avoid.
> :-)
>

Let's wait to hear from people who actually worked on it, then. :-)

 It does not look like this significantly reduces performance compared to
> OP's if the number of computations is not too large (3-4 operations).
>

This comment does beg the question, if you are interested in performance,
wouldn't you be better off using the native-code compiler?  I am guessing
there must be some other factors in play: I am just curious.

-- 
Best,
Женя

[-- Attachment #2: Type: text/html, Size: 1011 bytes --]

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

end of thread, other threads:[~2017-01-22 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-22 16:56 [Caml-list] How floats are handled in bytecode interpreter? And other questions Андрей Бергман
2017-01-22 18:23 ` Evgeny Roubinchtein
     [not found]   ` <4669031485116895@web19m.yandex.ru>
2017-01-22 20:43     ` Evgeny Roubinchtein

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).