Skip to content

Instantly share code, notes, and snippets.

@jenrzzz
Created June 6, 2013 09:13
Show Gist options
  • Select an option

  • Save jenrzzz/5720315 to your computer and use it in GitHub Desktop.

Select an option

Save jenrzzz/5720315 to your computer and use it in GitHub Desktop.
.file "test.c"
.section ".text"
.align 4
.global float_1
.type float_1, #function
.proc 06
float_1:
save %sp, -96, %sp
st %i0, [%fp+68]
st %i1, [%fp+72]
ld [%fp+68], %f9
ld [%fp+72], %f8
fadds %f9, %f8, %f8
fmovs %f8, %f0
return %i7+8
nop
.size float_1, .-float_1
.align 4
.global float2
.type float2, #function
.proc 06
float2:
save %sp, -96, %sp
st %i0, [%fp+68]
st %i1, [%fp+72]
ld [%fp+68], %f9
ld [%fp+72], %f8
fadds %f9, %f8, %f8
fmovs %f8, %f0
return %i7+8
nop
.size float2, .-float2
.align 4
.global float3
.type float3, #function
.proc 06
float3:
save %sp, -96, %sp
st %i0, [%fp+68]
st %i1, [%fp+72]
st %i2, [%fp+76]
ld [%fp+68], %f9
ld [%fp+72], %f8
fadds %f9, %f8, %f9
ld [%fp+76], %f8
fadds %f9, %f8, %f8
fmovs %f8, %f0
return %i7+8
nop
.size float3, .-float3
.section ".rodata"
.align 8
.LLC5:
.asciz "%f\n"
.align 4
.LLC0:
.long 1085276160
.align 4
.LLC1:
.long 1092616192
.align 4
.LLC2:
.long 1093664768
.align 4
.LLC3:
.long 1075838976
.align 4
.LLC4:
.long 1079194419
.section ".text"
.align 4
.global main
.type main, #function
.proc 04
main:
save %sp, -120, %sp
! load 5.5
sethi %hi(.LLC0), %g1
or %g1, %lo(.LLC0), %g1
ld [%g1], %f9
! load 10.0
sethi %hi(.LLC1), %g1
or %g1, %lo(.LLC1), %g1
ld [%g1], %f8
st %f9, [%fp-16]
ld [%fp-16], %o0
st %f8, [%fp-16]
ld [%fp-16], %o1
call float2, 0
nop
st %f0, [%fp-12]
sethi %hi(.LLC2), %g1
or %g1, %lo(.LLC2), %g1
ld [%g1], %f10
sethi %hi(.LLC3), %g1
or %g1, %lo(.LLC3), %g1
ld [%g1], %f9
sethi %hi(.LLC4), %g1
or %g1, %lo(.LLC4), %g1
ld [%g1], %f8
st %f10, [%fp-16]
ld [%fp-16], %o0
st %f9, [%fp-16]
ld [%fp-16], %o1
st %f8, [%fp-16]
ld [%fp-16], %o2
call float3, 0
nop
fmovs %f0, %f8
ld [%fp-12], %o0
st %f8, [%fp-16]
ld [%fp-16], %o1
call float_1, 0
nop
st %f0, [%fp-4]
ld [%fp-4], %f8
fstod %f8, %f8
sethi %hi(.LLC5), %g1
or %g1, %lo(.LLC5), %o0
std %f8, [%fp-24]
ldd [%fp-24], %g2
mov %g2, %o1
mov %g3, %o2
call printf, 0
nop
mov 0, %g1
mov %g1, %i0
return %i7+8
nop
.size main, .-main
.ident "GCC: (GNU) 4.7.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment