comp.lang.ada
 help / color / mirror / Atom feed
From: "Stefano M." <stefano.m@nospam.tin.it>
Subject: Re: Gnat's Ada.Float_Text_IO.Put problem
Date: Thu, 15 Jan 2004 12:02:57 +0100
Date: 2004-01-15T12:02:57+01:00	[thread overview]
Message-ID: <bu5rvs$8ki$1@grillo.cs.interbusiness.it> (raw)
In-Reply-To: <bu4rue$q8s$1@a1-hrz.uni-duisburg.de>

Georg Bauhaus wrote:

> Maybe there are two questions to answer:
> Is there a way to switch floating point modes of your hardware?
> What do you get for the sample_float value in your object code?
> The second question can be answered with a simpler program:
[...]
> sonnenregen:/tmp$ objdump --disassemble main.o
> 
> main.o:     file format elf32-i386
> 
> Disassembly of section .text:
> 
> 00000000 <_ada_main>:
>    0:   55                      push   %ebp
>    1:   89 e5                   mov    %esp,%ebp
>    3:   83 ec 04                sub    $0x4,%esp
>    6:   b8 cf f7 21 41          mov    $0x4121f7cf,%eax         <<----
>    b:   89 45 fc                mov    %eax,0xfffffffc(%ebp)
>    e:   c9                      leave  
>    f:   c3                      ret    
> 
> What do you get at <<----? Does it change when you add a few tenths?

I suddenly recalled there was a -S switch somewhere, here's what I get:

ste@sim:~/prove$ cat main.adb
procedure Main is
     Sample_Float : Float := 10.123;
begin
    null;
end Main;
ste@sim:~/prove$ gcc -c -S -fomit-frame-pointer -gnatp main.adb
ste@sim:~/prove$ cat main.s
      .verstamp 3 11
      .set noreorder
      .set volatile
      .set noat
      .arch ev4
      .file 1 "main.adb"
      .rdata
      .align 2
$LC0:
      .long 1092745167
      .text
      .align 2
      .globl _ada_main
      .ent _ada_main
_ada_main:
      .frame $30,16,$26,0
      ldgp $29,0($27)
$_ada_main..ng:
      lda $30,-16($30)
      .prologue 1
      lda $1,$LC0
      lds $f10,0($1)
      sts $f10,0($30)
      lda $30,16($30)
      ret $31,($26),1
      .end _ada_main

Anything interesting for you?

Stefano



  parent reply	other threads:[~2004-01-15 11:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 13:39 Gnat's Ada.Float_Text_IO.Put problem Stefano M.
2004-01-14 14:58 ` Adrian Knoth
     [not found] ` <8c4gd1-ifb.ln1@beastie.ix.netcom.com>
2004-01-14 16:11   ` Stefano M.
2004-01-14 16:44     ` Adrian Knoth
2004-01-15  8:14       ` Stefano M.
2004-01-15  8:39         ` Adrian Knoth
2004-01-15 18:50         ` tmoran
2004-01-16  8:23           ` Duncan Sands
2004-01-16  8:48             ` tmoran
2004-01-16  9:45               ` Duncan Sands
2004-01-16 13:18                 ` Jeff C,
2004-01-16 13:52                   ` Duncan Sands
2004-01-15  1:55     ` Georg Bauhaus
2004-01-15  8:46       ` Stefano M.
2004-01-15 11:56         ` Georg Bauhaus
2004-01-15 11:02       ` Stefano M. [this message]
2004-01-15 14:20         ` Georg Bauhaus
2004-01-15  1:50 ` Jeff C,
2004-01-15  8:18   ` Stefano M.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox