Skip to content

Instantly share code, notes, and snippets.

@nomaddo
Created December 12, 2014 13: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 nomaddo/7dd121878820571d310d to your computer and use it in GitHub Desktop.
Save nomaddo/7dd121878820571d310d to your computer and use it in GitHub Desktop.
output of ocamlopt -c -S ./arr.ml. arr.ml includes only "let access arr i = arr.(i)
camlArr__access_1008:
.cfi_startproc
subq $8, %rsp
.cfi_adjust_cfa_offset 8
.L101:
movq %rax, %rdi
movq -8(%rdi), %rax
movq %rax, %rsi
shrq $9, %rsi
cmpq %rbx, %rsi
jbe .L102
andq $255, %rax
cmpq $254, %rax
je .L100
movq -4(%rdi, %rbx, 4), %rax
addq $8, %rsp
.cfi_adjust_cfa_offset -8
ret
.cfi_adjust_cfa_offset 8
.align 4
.L100:
.L103: subq $16, %r15
movq caml_young_limit@GOTPCREL(%rip), %rax
cmpq (%rax), %r15
jb .L104
leaq 8(%r15), %rax
movq $1277, -8(%rax)
movsd -4(%rdi, %rbx, 4), %xmm0
movsd %xmm0, (%rax)
addq $8, %rsp
.cfi_adjust_cfa_offset -8
ret
.cfi_adjust_cfa_offset 8
.L104: call caml_call_gc@PLT
.L105: jmp .L103
.L102: call caml_ml_array_bound_error@PLT
.cfi_endproc
.type camlArr__access_1008,@function
.size camlArr__access_1008,.-camlArr__access_1008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment