New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
float and bytecode #3199
Comments
Comment author: administrator
Ah, you didn't say you were cross-compiling. This is a known problem
little-endian 00 00 00 00 00 00 f0 3f The Caml bytecode interpreter can convert between little-endian and So, I'm afraid you have to compile on the ARM itself if your program
|
Comment author: administrator Hi,
Cordialement, -- |
Comment author: administrator Fixed 2002-02-19 by XL |
Original bug ID: 883
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Christian Gillot
Version: 3.04
OS: Linux
Submission from: 80-24-20-121.uc.nombres.ttd.es (80.24.20.121)
This bug is related to the "not a bug/881".
I had the problem that floats got corrupted using the bytecode
runtime on the ARM :
ie. the following program :
let main () =
let x = 5.2 in
let y = 6.3 in
let z = x +. y in
print_float x;
print_string " + ";
print_float y;
print_string "=";
print_float z;
print_string "\n";;
main();;
generated the following output :
-9.25596534328e+61 + 4.66726164528e-62=-9.25596534328e+61
Not what was expected.
Later Xavier Leroy that it tested this on the skiffcluster (handhelds.org).
After some investigation I discovered that yes the skiffcluster5.handhelds.org
ocamlc compiler from Xavier worked on the foo.ml. But at the very same
time "float", the same program but compiled on my machine don't work as I put
it before.
So the point is that a x86 ocamlc-compiled bytecode program has corrupted
floats on the arm, and that it work in the other way ie. arm ocamlc-compiled
bytecode has corrupted floats executed on the x86.
Note that if you strip out the first line (#!....)
you get a different size for the same program :
float (x86 compiled) : 9110
foo (arm compiled) : 9108
So for 2 bytes I hope that it's trivial to fix, but I don't have the
expertise to fix it though.
Note that both x86 ocamlc and arm ocamlc are from version ocaml-3.04
Thanks a lot for your time,
Regards
The text was updated successfully, but these errors were encountered: