mbohun
8/31/2012 - 3:14 AM

gcc sse/sse2 fpu x387 'gcc -msse2 -mfpmath=sse'

gcc sse/sse2 fpu x387 'gcc -msse2 -mfpmath=sse'

; gcc sse/sse2 fpu x387 'gcc -msse2 -mfpmath=sse'
;
; bash-3.1$ gcc -fomit-frame-pointer -msse2 -mfpmath=sse -S test_c_asm-float-or-mmx.c
; bash-3.1$ cat test_c_asm-float-or-mmx.s
        .file   "test_c_asm-float-or-mmx.c"
        .text
.globl test
        .type   test, @function
test:
        subl    $4, %esp
        movss   8(%esp), %xmm0
        addss   %xmm0, %xmm0
        movss   %xmm0, (%esp)
        flds    (%esp)
        addl    $4, %esp
        ret
        .size   test, .-test
        .ident  "GCC: (GNU) 4.4.2"
        .section        .note.GNU-stack,"",@progbits

; bash-3.1$ gcc -fomit-frame-pointer -msse2 -S test_c_asm-float-or-mmx.c
; bash-3.1$ cat test_c_asm-float-or-mmx.s
        .file   "test_c_asm-float-or-mmx.c"
        .text
.globl test
        .type   test, @function
test:
        flds    4(%esp)
        fadd    %st(0), %st
        ret
        .size   test, .-test
        .ident  "GCC: (GNU) 4.4.2"
        .section        .note.GNU-stack,"",@progbits

; martin@yobbo:~/src$ cat test_c_asm-float-or-mmx.c
; float test(float f)
; {
;     return f * 2.0f;
; }