Skip to content

Instantly share code, notes, and snippets.

@cod3monk
Created February 14, 2020 15:42
Show Gist options
  • Save cod3monk/ff7db50f53af3cdadf87d579af69d1a5 to your computer and use it in GitHub Desktop.
Save cod3monk/ff7db50f53af3cdadf87d579af69d1a5 to your computer and use it in GitHub Desktop.
# asmbench -p 32 -t 1 -vvv 'add {src:i64:r}, {dstsrc:i64:r}'
# Throughput Benchmark
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 14
.globl _test
.p2align 4, 0x90
_test:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
pushq %r15
.cfi_def_cfa_offset 24
pushq %r14
.cfi_def_cfa_offset 32
pushq %r13
.cfi_def_cfa_offset 40
pushq %r12
.cfi_def_cfa_offset 48
pushq %rbx
.cfi_def_cfa_offset 56
subq $32, %rsp
.cfi_def_cfa_offset 88
.cfi_offset %rbx, -56
.cfi_offset %r12, -48
.cfi_offset %r13, -40
.cfi_offset %r14, -32
.cfi_offset %r15, -24
.cfi_offset %rbp, -16
testq %rdi, %rdi
jle LBB0_1
movq $-1, %rcx
movl $3, %eax
movq %rax, 16(%rsp)
movl $3, %eax
movq %rax, 8(%rsp)
movl $3, %eax
movq %rax, (%rsp)
movl $3, %eax
movq %rax, -8(%rsp)
movl $3, %eax
movq %rax, -16(%rsp)
movl $3, %eax
movq %rax, -24(%rsp)
movl $3, %eax
movq %rax, -32(%rsp)
movl $3, %eax
movq %rax, -40(%rsp)
movl $3, %eax
movq %rax, -48(%rsp)
movl $3, %eax
movq %rax, -56(%rsp)
movl $3, %eax
movq %rax, -64(%rsp)
movl $3, %eax
movq %rax, -72(%rsp)
movl $3, %eax
movq %rax, -80(%rsp)
movl $3, %eax
movq %rax, -88(%rsp)
movl $3, %eax
movq %rax, -96(%rsp)
movl $3, %eax
movq %rax, -104(%rsp)
movl $3, %eax
movq %rax, -112(%rsp)
movl $3, %eax
movq %rax, -120(%rsp)
movl $3, %eax
movq %rax, -128(%rsp)
movl $3, %r12d
movl $3, %r13d
movl $3, %esi
movl $3, %ebx
movl $3, %edx
movl $3, %ebp
movl $3, %r8d
movq %rdi, 24(%rsp)
movl $3, %edi
movl $3, %r9d
movl $3, %r10d
movl $3, %r11d
movl $3, %r14d
movl $3, %r15d
.p2align 4, 0x90
LBB0_3:
movq 16(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, 16(%rsp)
movq 8(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, 8(%rsp)
movq (%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, (%rsp)
movq -8(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -8(%rsp)
movq -16(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -16(%rsp)
movq -24(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -24(%rsp)
movq -32(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -32(%rsp)
movq -40(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -40(%rsp)
movq -48(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -48(%rsp)
movq -56(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -56(%rsp)
movq -64(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -64(%rsp)
movq -72(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -72(%rsp)
movq -80(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -80(%rsp)
movq -88(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -88(%rsp)
movq -96(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -96(%rsp)
movq -104(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -104(%rsp)
movq -112(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -112(%rsp)
movq -120(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -120(%rsp)
movq -128(%rsp), %rax
## InlineAsm Start
addq %rax, %rax
## InlineAsm End
movq %rax, -128(%rsp)
## InlineAsm Start
addq %r12, %r12
addq %r13, %r13
addq %rsi, %rsi
addq %rbx, %rbx
addq %rdx, %rdx
addq %rbp, %rbp
addq %r8, %r8
addq %rdi, %rdi
addq %r9, %r9
addq %r10, %r10
addq %r11, %r11
addq %r14, %r14
addq %r15, %r15
## InlineAsm End
leaq 1(%rcx), %rax
addq $2, %rcx
cmpq 24(%rsp), %rcx
movq %rax, %rcx
jl LBB0_3
jmp LBB0_4
LBB0_1:
xorl %eax, %eax
LBB0_4:
addq $32, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
.cfi_endproc
.subsections_via_symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment