* [Caml-list] ocaml arm eabi @ 2011-06-28 15:22 SerP 2011-06-28 15:30 ` rixed 0 siblings, 1 reply; 7+ messages in thread From: SerP @ 2011-06-28 15:22 UTC (permalink / raw) To: caml-list [-- Attachment #1: Type: text/plain, Size: 195 bytes --] Has anyone experience for running ocaml native programms on android? My problem in floating point calculations. let x = 255. in int_of_float x Result is always 0. Any suggestions very welcome. [-- Attachment #2: Type: text/html, Size: 277 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] ocaml arm eabi 2011-06-28 15:22 [Caml-list] ocaml arm eabi SerP @ 2011-06-28 15:30 ` rixed 2011-06-28 17:52 ` SerP 0 siblings, 1 reply; 7+ messages in thread From: rixed @ 2011-06-28 15:30 UTC (permalink / raw) To: caml-list -[ Tue, Jun 28, 2011 at 07:22:01PM +0400, SerP ]---- > let x = 255. in > int_of_float x Works for me with ocaml 3.12.0 compiled with GCC 4.2.1 on ARM eabi (not on android, though). ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] ocaml arm eabi 2011-06-28 15:30 ` rixed @ 2011-06-28 17:52 ` SerP [not found] ` <BANLkTinQcixhGm2ZUW01CybUF_6Q_1rGRA@mail.gmail.com> 0 siblings, 1 reply; 7+ messages in thread From: SerP @ 2011-06-28 17:52 UTC (permalink / raw) To: caml-list [-- Attachment #1: Type: text/plain, Size: 583 bytes --] ocaml 3.12.0 On iphone it's work's too. But on android - gcc-4.4 it's not working. On Tue, Jun 28, 2011 at 7:30 PM, <rixed@happyleptic.org> wrote: > -[ Tue, Jun 28, 2011 at 07:22:01PM +0400, SerP ]---- > > let x = 255. in > > int_of_float x > > Works for me with ocaml 3.12.0 compiled with GCC 4.2.1 on ARM eabi > (not on android, though). > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > [-- Attachment #2: Type: text/html, Size: 1164 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <BANLkTinQcixhGm2ZUW01CybUF_6Q_1rGRA@mail.gmail.com>]
* Re: [Caml-list] ocaml arm eabi [not found] ` <BANLkTinQcixhGm2ZUW01CybUF_6Q_1rGRA@mail.gmail.com> @ 2011-06-28 18:02 ` Pierre-Alexandre Voye 2011-06-28 18:11 ` SerP 0 siblings, 1 reply; 7+ messages in thread From: Pierre-Alexandre Voye @ 2011-06-28 18:02 UTC (permalink / raw) To: SerP; +Cc: caml-list [-- Attachment #1: Type: text/plain, Size: 344 bytes --] Maybe an issue with android's libc which manage float in certain circumstance ? Le 28 juin 2011 19:52, "SerP" <serp256@gmail.com> a écrit : ocaml 3.12.0 On iphone it's work's too. But on android - gcc-4.4 it's not working. On Tue, Jun 28, 2011 at 7:30 PM, <rixed@happyleptic.org> wrote: > > -[ Tue, Jun 28, 2011 at 07:22:... [-- Attachment #2: Type: text/html, Size: 580 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] ocaml arm eabi 2011-06-28 18:02 ` Pierre-Alexandre Voye @ 2011-06-28 18:11 ` SerP 2011-06-28 18:40 ` Wojciech Meyer 0 siblings, 1 reply; 7+ messages in thread From: SerP @ 2011-06-28 18:11 UTC (permalink / raw) To: caml-list [-- Attachment #1: Type: text/plain, Size: 547 bytes --] Yes. it seems that the problem in android libc, but it is not clear where exactly On Tue, Jun 28, 2011 at 10:02 PM, Pierre-Alexandre Voye < ontologiae@gmail.com> wrote: > Maybe an issue with android's libc which manage float in certain > circumstance ? > > Le 28 juin 2011 19:52, "SerP" <serp256@gmail.com> a écrit : > > ocaml 3.12.0 > On iphone it's work's too. But on android - gcc-4.4 it's not working. > > > > On Tue, Jun 28, 2011 at 7:30 PM, <rixed@happyleptic.org> wrote: > > > > -[ Tue, Jun 28, 2011 at 07:22:... > > [-- Attachment #2: Type: text/html, Size: 1130 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] ocaml arm eabi 2011-06-28 18:11 ` SerP @ 2011-06-28 18:40 ` Wojciech Meyer 2011-06-29 8:37 ` SerP 0 siblings, 1 reply; 7+ messages in thread From: Wojciech Meyer @ 2011-06-28 18:40 UTC (permalink / raw) To: SerP; +Cc: caml-list SerP <serp256@gmail.com> writes: > Yes. it seems that the problem in android libc, but it is not clear > where exactly Did you try to disassemble/trace the program in the debugger of what possibly from libc is being inlined/called? Maybe it's some initialisation problem or most likely a wrong target. You compile for a none floating point capable hardware, try to write a simple program in gcc and see what happens. You can tell Gcc to compile for Cortex-A8 or ARM7 and that's a big difference the second one has no floating point unit built in. Could you post `gas' compile command line options? Cheers; Wojciech > > On Tue, Jun 28, 2011 at 10:02 PM, Pierre-Alexandre Voye > <ontologiae@gmail.com> wrote: > > Maybe an issue with android's libc which manage float in certain > circumstance ? > > Le 28 juin 2011 19:52, "SerP" <serp256@gmail.com> a écrit : > > ocaml 3.12.0 > > On iphone it's work's too. But on android - gcc-4.4 it's not > working. > > > > > On Tue, Jun 28, 2011 at 7:30 PM, <rixed@happyleptic.org> > wrote: > > > > > -[ Tue, Jun 28, 2011 at 07:22:... > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] ocaml arm eabi 2011-06-28 18:40 ` Wojciech Meyer @ 2011-06-29 8:37 ` SerP 0 siblings, 0 replies; 7+ messages in thread From: SerP @ 2011-06-29 8:37 UTC (permalink / raw) To: caml-list [-- Attachment #1: Type: text/plain, Size: 3059 bytes --] It's very strange. I'am disassembled binary. ocaml "__fixdfsi" call resovled to "__aeabi_d2iz" and this function are the same as in ios binary. But on android floating point does not work! === disassemly code: aeabi_d2iz from android libc 0002da7c <__aeabi_d2iz>: 2da7c: e1a02081 lsl r2, r1, #1 2da80: e2922602 adds r2, r2, #2097152 ; 0x200000 2da84: 2a00000c bcs 2dabc <__aeabi_d2iz+0x40> 2da88: 5a000009 bpl 2dab4 <__aeabi_d2iz+0x38> 2da8c: e3e03e3e mvn r3, #992 ; 0x3e0 2da90: e0532ac2 subs r2, r3, r2, asr #21 2da94: 9a00000a bls 2dac4 <__aeabi_d2iz+0x48> 2da98: e1a03581 lsl r3, r1, #11 2da9c: e3833102 orr r3, r3, #-2147483648 ; 0x80000000 2daa0: e1833aa0 orr r3, r3, r0, lsr #21 2daa4: e3110102 tst r1, #-2147483648 ; 0x80000000 2daa8: e1a00233 lsr r0, r3, r2 2daac: 12600000 rsbne r0, r0, #0 ; 0x0 2dab0: e12fff1e bx lr 2dab4: e3a00000 mov r0, #0 ; 0x0 2dab8: e12fff1e bx lr 2dabc: e1900601 orrs r0, r0, r1, lsl #12 2dac0: 1a000002 bne 2dad0 <__aeabi_d2iz+0x54> 2dac4: e2110102 ands r0, r1, #-2147483648 ; 0x80000000 2dac8: 03e00102 mvneq r0, #-2147483648 ; 0x80000000 2dacc: e12fff1e bx lr 2dad0: e3a00000 mov r0, #0 ; 0x0 2dad4: e12fff1e bx lr ===== On Tue, Jun 28, 2011 at 10:40 PM, Wojciech Meyer < wojciech.meyer@googlemail.com> wrote: > SerP <serp256@gmail.com> writes: > > > Yes. it seems that the problem in android libc, but it is not clear > > where exactly > > Did you try to disassemble/trace the program in the debugger of what > possibly from libc is being inlined/called? Maybe it's some > initialisation problem or most likely a wrong target. You compile for a > none floating point capable hardware, try to write a simple program in > gcc and see what happens. You can tell Gcc to compile for Cortex-A8 or > ARM7 and that's a big difference the second one has no floating point > unit built in. Could you post `gas' compile command line options? > > Cheers; > Wojciech > > > > > On Tue, Jun 28, 2011 at 10:02 PM, Pierre-Alexandre Voye > > <ontologiae@gmail.com> wrote: > > > > Maybe an issue with android's libc which manage float in certain > > circumstance ? > > > > Le 28 juin 2011 19:52, "SerP" <serp256@gmail.com> a écrit : > > > > ocaml 3.12.0 > > > > On iphone it's work's too. But on android - gcc-4.4 it's not > > working. > > > > > > > > > > On Tue, Jun 28, 2011 at 7:30 PM, <rixed@happyleptic.org> > > wrote: > > > > > > > > -[ Tue, Jun 28, 2011 at 07:22:... > > > > > > > [-- Attachment #2: Type: text/html, Size: 4211 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-06-29 8:37 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-06-28 15:22 [Caml-list] ocaml arm eabi SerP 2011-06-28 15:30 ` rixed 2011-06-28 17:52 ` SerP [not found] ` <BANLkTinQcixhGm2ZUW01CybUF_6Q_1rGRA@mail.gmail.com> 2011-06-28 18:02 ` Pierre-Alexandre Voye 2011-06-28 18:11 ` SerP 2011-06-28 18:40 ` Wojciech Meyer 2011-06-29 8:37 ` SerP
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox