> main()
> {
> float foo;
>
> foo = 1.0 * 1.0 * 1.0;
> printf("%f\n", foo);
>
> }
That's not the same thing at all though. The kernel code
was more like this:
main(){
int foo;
foo = (int) 1.0 * 1.0 * 1.0;
printf("%d\n", foo);
}
It makes no sense to leave the floating point in the object file.
All I can figure is something related to IEEE rounding, in which
case there ought to be compiler switch to eliminate such concern.
Here is the above with gcc on the Alpha. I don't see any floating
point, do you?
.verstamp 3 11
.set noreorder
.set volatile
.set noat
.file 1 "flt.c"
gcc2_compiled.:
__gnu_compiled_c:
.rdata
.quad 0
.align 3
$C32:
.ascii "%d\12\0"
.text
.align 3
.globl main
.ent main
main:
ldgp $29,0($27)
main..ng:
lda $30,-32($30)
.frame $15,32,$26,0
stq $26,0($30)
stq $15,8($30)
.mask 0x4008000,-32
bis $30,$30,$15
.prologue 1
bis $31,1,$1
stl $1,16($15)
ldl $1,16($15)
lda $16,$C32
bis $1,$1,$17
jsr $26,printf
ldgp $29,0($26)
$33:
bis $15,$15,$30
ldq $26,0($30)
ldq $15,8($30)
addq $30,32,$30
ret $31,($26),1
.end main
-------- here is i386 code, same thing ------------
.file "flt.c"
.version "01.01"
gcc2_compiled.:
.section .rodata
.LC0:
.string "%d\n"
.text
.align 4
.globl main
.type main,@function
main:
pushl %ebp
movl %esp,%ebp
subl $4,%esp
movl $1,-4(%ebp)
movl -4(%ebp),%eax
pushl %eax
pushl $.LC0
call printf
addl $8,%esp
.L1:
leave
ret
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html