Skip to content

Instantly share code, notes, and snippets.

@y-tag
Created March 12, 2013 21:39
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 y-tag/5147320 to your computer and use it in GitHub Desktop.
Save y-tag/5147320 to your computer and use it in GitHub Desktop.
$ g++ -o mixed_entropy.64.s -S mixed_entropy.cc -Wall
.file "mixed_entropy.cc"
.text
.globl _Z13mixed_entropydd
.type _Z13mixed_entropydd, @function
_Z13mixed_entropydd:
.LFB85:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movsd %xmm0, -8(%rbp)
movsd %xmm1, -16(%rbp)
xorpd %xmm0, %xmm0
ucomisd -16(%rbp), %xmm0
jp .L2
xorpd %xmm0, %xmm0
ucomisd -16(%rbp), %xmm0
jne .L2
.L5:
xorpd %xmm0, %xmm0
jmp .L4
.L2:
movsd -16(%rbp), %xmm0
call log
movsd -8(%rbp), %xmm1
divsd -16(%rbp), %xmm1
subsd %xmm1, %xmm0
.L4:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE85:
.size _Z13mixed_entropydd, .-_Z13mixed_entropydd
.section .rodata
.LC3:
.string "d = %g\n"
.text
.globl main
.type main, @function
main:
.LFB86:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $64, %rsp
movl %edi, -36(%rbp)
movq %rsi, -48(%rbp)
movabsq $4613937818241073152, %rax
movq %rax, -32(%rbp)
movl $3, %edi
call _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
movsd .LC1(%rip), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -24(%rbp)
movsd -24(%rbp), %xmm1
movsd .LC2(%rip), %xmm0
xorpd %xmm1, %xmm0
movsd .LC1(%rip), %xmm1
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, -56(%rbp)
movl $3, %edi
call _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
addsd -56(%rbp), %xmm0
movsd %xmm0, -16(%rbp)
movl $0, %eax
movq %rax, -8(%rbp)
movq -16(%rbp), %rax
movq %rax, -8(%rbp)
movq stdout(%rip), %rax
movsd -8(%rbp), %xmm0
movl $.LC3, %esi
movq %rax, %rdi
movl $1, %eax
call fprintf
xorpd %xmm0, %xmm0
ucomisd -32(%rbp), %xmm0
jp .L7
xorpd %xmm0, %xmm0
ucomisd -32(%rbp), %xmm0
jne .L7
.L10:
xorpd %xmm0, %xmm0
jmp .L9
.L7:
movsd -32(%rbp), %xmm0
call log
movsd -24(%rbp), %xmm1
divsd -32(%rbp), %xmm1
subsd %xmm1, %xmm0
.L9:
movsd %xmm0, -8(%rbp)
movq stdout(%rip), %rax
movsd -8(%rbp), %xmm0
movl $.LC3, %esi
movq %rax, %rdi
movl $1, %eax
call fprintf
movsd -32(%rbp), %xmm1
movsd -24(%rbp), %xmm0
call _Z13mixed_entropydd
movsd %xmm0, -8(%rbp)
movq stdout(%rip), %rax
movsd -8(%rbp), %xmm0
movl $.LC3, %esi
movq %rax, %rdi
movl $1, %eax
call fprintf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE86:
.size main, .-main
.section .text._ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_,"axG",@progbits,_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_,comdat
.weak _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
.type _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_, @function
_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_:
.LFB87:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
cvtsi2sd -4(%rbp), %xmm0
call log
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE87:
.size _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_, .-_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
.section .rodata
.align 8
.LC1:
.long 0
.long 1074266112
.align 16
.LC2:
.long 0
.long -2147483648
.long 0
.long 0
.ident "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3"
.section .note.GNU-stack,"",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment