Skip to content

Instantly share code, notes, and snippets.

@y-tag
Created March 12, 2013 21:55
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/5147448 to your computer and use it in GitHub Desktop.
Save y-tag/5147448 to your computer and use it in GitHub Desktop.
$ clang++ -o mixed_entropy.clang.32.O2.s -S mixed_entropy.cc -Wall -m32 -O2
.file "mixed_entropy.cc"
.text
.globl _Z13mixed_entropydd
.align 16, 0x90
.type _Z13mixed_entropydd,@function
_Z13mixed_entropydd: # @_Z13mixed_entropydd
# BB#0:
pushl %ebp
movl %esp, %ebp
subl $56, %esp
movsd 16(%ebp), %xmm0
movsd 8(%ebp), %xmm1
pxor %xmm2, %xmm2
movsd %xmm1, -16(%ebp)
movsd %xmm0, -24(%ebp)
movsd -24(%ebp), %xmm0
ucomisd %xmm2, %xmm0
jne .LBB0_2
jp .LBB0_2
# BB#1:
pxor %xmm0, %xmm0
movsd %xmm0, -8(%ebp)
jmp .LBB0_3
.LBB0_2:
movsd -24(%ebp), %xmm0
movsd %xmm0, (%esp)
calll log
fstpl -32(%ebp)
movsd -32(%ebp), %xmm0
movsd -16(%ebp), %xmm1
divsd -24(%ebp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -8(%ebp)
.LBB0_3:
movsd -8(%ebp), %xmm0
movsd %xmm0, -40(%ebp)
fldl -40(%ebp)
addl $56, %esp
popl %ebp
ret
.Ltmp0:
.size _Z13mixed_entropydd, .Ltmp0-_Z13mixed_entropydd
.section .rodata.cst8,"aM",@progbits,8
.align 8
.LCPI1_0:
.quad 4613937818241073152 # double 3.000000e+00
.section .rodata.cst16,"aM",@progbits,16
.align 16
.LCPI1_1:
.quad -9223372036854775808 # double -0.000000e+00
.quad -9223372036854775808 # double -0.000000e+00
.text
.globl main
.align 16, 0x90
.type main,@function
main: # @main
.Ltmp3:
.cfi_startproc
# BB#0:
pushl %ebp
.Ltmp4:
.cfi_def_cfa_offset 8
.Ltmp5:
.cfi_offset %ebp, -8
movl %esp, %ebp
.Ltmp6:
.cfi_def_cfa_register %ebp
subl $136, %esp
movl 12(%ebp), %eax
movl 8(%ebp), %ecx
movl $3, %edx
cvtsi2sd %edx, %xmm0
movl $0, -4(%ebp)
movl %ecx, -8(%ebp)
movl %eax, -12(%ebp)
movl $1074266112, -20(%ebp) # imm = 0x40080000
movl $0, -24(%ebp)
movl %esp, %eax
movl $3, (%eax)
movsd %xmm0, -88(%ebp) # 8-byte Spill
calll _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
fstpl -64(%ebp)
movsd .LCPI1_0, %xmm0
movsd -64(%ebp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -32(%ebp)
movsd .LCPI1_1, %xmm1
xorpd %xmm0, %xmm1
movsd -88(%ebp), %xmm0 # 8-byte Reload
divsd %xmm0, %xmm1
movl $3, (%esp)
movsd %xmm1, -96(%ebp) # 8-byte Spill
calll _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
fstpl -56(%ebp)
movsd -56(%ebp), %xmm0
leal .L.str, %eax
pxor %xmm1, %xmm1
movsd -96(%ebp), %xmm2 # 8-byte Reload
addsd %xmm2, %xmm0
movsd %xmm0, -40(%ebp)
movsd %xmm1, -48(%ebp)
movsd -40(%ebp), %xmm0
movsd %xmm0, -48(%ebp)
movl stdout, %ecx
movsd -48(%ebp), %xmm0
movl %ecx, (%esp)
movl %eax, 4(%esp)
movsd %xmm0, 8(%esp)
calll fprintf
pxor %xmm0, %xmm0
movsd -24(%ebp), %xmm1
ucomisd %xmm0, %xmm1
movl %eax, -100(%ebp) # 4-byte Spill
jne .LBB1_2
jp .LBB1_2
# BB#1:
pxor %xmm0, %xmm0
movsd %xmm0, -112(%ebp) # 8-byte Spill
jmp .LBB1_3
.LBB1_2:
movsd -24(%ebp), %xmm0
movsd %xmm0, (%esp)
calll log
fstpl -72(%ebp)
movsd -72(%ebp), %xmm0
movsd -32(%ebp), %xmm1
divsd -24(%ebp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -112(%ebp) # 8-byte Spill
.LBB1_3:
movsd -112(%ebp), %xmm0 # 8-byte Reload
leal .L.str, %eax
movsd %xmm0, -48(%ebp)
movl stdout, %ecx
movsd -48(%ebp), %xmm0
movl %ecx, (%esp)
movl %eax, 4(%esp)
movsd %xmm0, 8(%esp)
calll fprintf
movsd -32(%ebp), %xmm0
movsd -24(%ebp), %xmm1
movsd %xmm0, (%esp)
movsd %xmm1, 8(%esp)
movl %eax, -116(%ebp) # 4-byte Spill
calll _Z13mixed_entropydd
fstpl -80(%ebp)
movsd -80(%ebp), %xmm0
leal .L.str, %eax
movsd %xmm0, -48(%ebp)
movl stdout, %ecx
movsd -48(%ebp), %xmm0
movl %ecx, (%esp)
movl %eax, 4(%esp)
movsd %xmm0, 8(%esp)
calll fprintf
movl $0, %ecx
movl %eax, -120(%ebp) # 4-byte Spill
movl %ecx, %eax
addl $136, %esp
popl %ebp
ret
.Ltmp7:
.size main, .Ltmp7-main
.Ltmp8:
.cfi_endproc
.Leh_func_end1:
.section .text._ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_,"axG",@progbits,_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_,comdat
.weak _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
.align 16, 0x90
.type _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_,@function
_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_: # @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
# BB#0:
pushl %ebp
movl %esp, %ebp
subl $40, %esp
movl 8(%ebp), %eax
movl %eax, -4(%ebp)
cvtsi2sd %eax, %xmm0
movl %esp, %eax
movsd %xmm0, (%eax)
calll log
fstl -16(%ebp)
movsd -16(%ebp), %xmm0
movsd %xmm0, -24(%ebp) # 8-byte Spill
addl $40, %esp
popl %ebp
ret
.Ltmp9:
.size _ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_, .Ltmp9-_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "d = %g\n"
.size .L.str, 8
.section ".note.GNU-stack","",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment