Skip to content

Instantly share code, notes, and snippets.

@mbohun
Created August 31, 2012 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbohun/3548525 to your computer and use it in GitHub Desktop.
Save mbohun/3548525 to your computer and use it in GitHub Desktop.
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;
; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment