Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Nim
Objective-C
Objective-C++
OCaml
OpenCL C
Pascal
Pony
Python
Racket
Ruby
Rust
Snowball
Scala
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Zig
Javascript
GIMPLE
Ygen
assembly source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
AArch64 binutils 2.28
AArch64 binutils 2.31.1
AArch64 binutils 2.33.1
AArch64 binutils 2.35.1
AArch64 binutils 2.38
ARM binutils 2.25
ARM binutils 2.28
ARM binutils 2.31.1
ARM gcc 10.2 (linux)
ARM gcc 9.3 (linux)
ARMhf binutils 2.28
BeebAsm 1.09
NASM 2.12.02
NASM 2.13.02
NASM 2.13.03
NASM 2.14.02
NASM 2.16.01
PTX Assembler 10.0.130
PTX Assembler 10.1.105
PTX Assembler 10.1.168
PTX Assembler 10.1.243
PTX Assembler 10.2.89
PTX Assembler 11.0.2
PTX Assembler 11.0.3
PTX Assembler 11.1.0
PTX Assembler 11.1.1
PTX Assembler 11.2.0
PTX Assembler 11.2.1
PTX Assembler 11.2.2
PTX Assembler 11.3.0
PTX Assembler 11.3.1
PTX Assembler 11.4.0
PTX Assembler 11.4.1
PTX Assembler 11.5.0
PTX Assembler 11.6.1
PTX Assembler 11.6.2
PTX Assembler 11.7.0
PTX Assembler 11.7.1
PTX Assembler 11.8.0
PTX Assembler 12.0.0
PTX Assembler 12.0.1
PTX Assembler 12.1.0
PTX Assembler 12.2.1
PTX Assembler 12.3.1
PTX Assembler 12.4.1
PTX Assembler 12.5.1
PTX Assembler 12.6.1
PTX Assembler 9.1.85
PTX Assembler 9.2.88
RISC-V binutils 2.31.1
RISC-V binutils 2.31.1
RISC-V binutils 2.35.1
RISC-V binutils 2.35.1
RISC-V binutils 2.37.0
RISC-V binutils 2.37.0
RISC-V binutils 2.38.0
RISC-V binutils 2.38.0
x86-64 binutils (trunk)
x86-64 binutils 2.27
x86-64 binutils 2.28
x86-64 binutils 2.29.1
x86-64 binutils 2.34
x86-64 binutils 2.36.1
x86-64 binutils 2.38
x86-64 clang (assertions trunk)
x86-64 clang (trunk)
x86-64 clang 10.0.0
x86-64 clang 10.0.1
x86-64 clang 11.0.0
x86-64 clang 11.0.1
x86-64 clang 12.0.0
x86-64 clang 12.0.1
x86-64 clang 13.0.0
x86-64 clang 14.0.0
x86-64 clang 15.0.0
x86-64 clang 16.0.0
x86-64 clang 17.0.1
x86-64 clang 18.1.0
x86-64 clang 3.0.0
x86-64 clang 3.1
x86-64 clang 3.2
x86-64 clang 3.3
x86-64 clang 3.4.1
x86-64 clang 3.5
x86-64 clang 3.5.1
x86-64 clang 3.5.2
x86-64 clang 3.6
x86-64 clang 3.7
x86-64 clang 3.7.1
x86-64 clang 3.8
x86-64 clang 3.8.1
x86-64 clang 3.9.0
x86-64 clang 3.9.1
x86-64 clang 4.0.0
x86-64 clang 4.0.1
x86-64 clang 5.0.0
x86-64 clang 6.0.0
x86-64 clang 7.0.0
x86-64 clang 8.0.0
x86-64 clang 9.0.0
Options
Source code
;; t=testloop; asm-link "$t.asm" && disas "$t" && taskset -c 3 ocperf.py stat -etask-clock,context-switches,cpu-migrations,page-faults,cycles,instructions,uops_issued.any,uops_executed.thread,lsd.uops ./"$t" ;; nasm -felf64 -Worphan-labels -g -Fdwarf testloop.asm ;; ld -o testloop testloop.o ;; time taskset -c 3 perf stat -etask-clock:u,context-switches,cpu-migrations,page-faults,cycles:u,branches:u,instructions:u,uops_issued.any:u,uops_executed.thread:u,arith.divider_active:u -r2 ./testloop ; or idq.mite_uops default rel %ifdef __YASM_VER__ ; CPU ; CPU intelnop CPU Conroe AMD CPU Skylake AMD %else %use smartalign alignmode p6, 64 %endif %ifdef IACA_MARKS %macro IACA_start 0 mov ebx, 111 db 0x64, 0x67, 0x90 %endmacro %macro IACA_end 0 mov ebx, 222 db 0x64, 0x67, 0x90 %endmacro %else %define IACA_start %define IACA_end %endif global _start _start: %if 1 lea rdi, [buf] lea rsi, [bufsrc] %endif vzeroupper mov ebp, 100000000 xor edx,edx mov ecx, 1234 movsd xmm4, [four] movsd xmm2, [two] movsd xmm9, [nine] ; xorps xmm0, xmm0 ; vbroadcastss xmm1, [one] ; vbroadcastss xmm2, [small_number] align 64 IACA_start .loop: ; sqrtsd xmm4, xmm2 ; 18.0 cycles ; sqrtsd xmm2, xmm4 ; 13.0 cycles sqrtsd xmm2, xmm9 ; 18.0 cycles dec ebp jnz .loop IACA_end .end: ;;NASM-only, not YASM: %if __BITS__ == 32 %ifidn __OUTPUT_FORMAT__, elf32 mov eax,1 xor ebx,ebx int 0x80 ; sys_exit(0) 32-bit ABI %else xor edi,edi mov eax,231 ; __NR_exit_group from /usr/include/asm/unistd_64.h syscall ; sys_exit_group(0) %endif section .rodata align 16 small_number: times 4 dd 0.00000001 one: times 4 dd 1.0 two: times 2 dq 2.0 four: times 2 dq 4.0 nine: times 2 dq 9.0 section .bss align 4096 buf: resb 4096*4096 bufsrc: resb 4096 resb 100
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
About the author
Statistics
Changelog
Version tree