Skip to content

Instantly share code, notes, and snippets.

@Cogitri
Created April 13, 2020 18:47
Show Gist options
  • Save Cogitri/89ace38ec5ff5907f61966a63ddae03c to your computer and use it in GitHub Desktop.
Save Cogitri/89ace38ec5ff5907f61966a63ddae03c to your computer and use it in GitHub Desktop.
.text
.file "print.d"
.section .rodata.cst16,"aM",@progbits,16
.p2align 4
.LCPI0_0:
.xword 0
.xword 281474976710656
.section .text.main,"axG",@progbits,main,comdat
.globl main
.p2align 2
.type main,@function
main:
.cfi_startproc
sub sp, sp, #64
stp x29, x30, [sp, #48]
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, .LCPI0_0
ldr q0, [x8, :lo12:.LCPI0_0]
stur q0, [x29, #-16]
bl sqrtl
adrp x0, .L.str
add x0, x0, :lo12:.L.str
ldur q1, [x29, #-16]
str q0, [sp, #16]
mov v0.16b, v1.16b
ldr q1, [sp, #16]
bl printf
ldur q0, [x29, #-16]
str w0, [sp, #12]
bl sqrtl
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl printf
mov w1, wzr
str w0, [sp, #8]
mov w0, w1
ldp x29, x30, [sp, #48]
add sp, sp, #64
ret
.Lfunc_end0:
.size main, .Lfunc_end0-main
.cfi_endproc
.type .L.str,@object
.section .rodata.str1.16,"aMS",@progbits,1
.p2align 4
.L.str:
.asciz "sqrt(%La) = %La\n"
.size .L.str, 17
.type .L.str.1,@object
.p2align 4
.L.str.1:
.asciz "llvm_sqrt = %La\n"
.size .L.str.1, 17
.ident "ldc version 1.20.1"
.section ".note.GNU-stack","",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment