Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Rust playpen shows IR and ASM output

Name: Anonymous 2014-06-03 6:03

http://playtest.rust-lang.org/

I know you guys are sick of Rust, but this is pretty cool stuff.

Name: Anonymous 2014-06-03 6:39

>>79

fuck off, genderless kike

Name: Anonymous 2014-06-03 6:41

>>2

lelelelelele

ggty, firefox

Name: Anonymous 2014-06-03 12:46

* C++ style name mangling
* unrolls loops

kek top hat confirmed based anime jejeje i tole u i was hardcore

Name: Anonymous 2014-06-03 19:01

>>4
Try adding #[no_mangle] immidiately before the function.

0.15 Can C code call Rust code?
Yes. The Rust code has to be exposed via an extern declaration, which makes it C-ABI compatible. Such a function can be passed to C code as a function pointer or, if given the #[no_mangle] attribute to disable symbol mangling, can be called directly from C code.
http://doc.rust-lang.org/complement-lang-faq.html#can-c-code-call-rust-code?

no_mangle - on any item, do not apply the standard name mangling. Set the symbol for this item to its identifier.
http://doc.rust-lang.org/rust.html#miscellaneous-attributes

What's this about unrolling loops?

Name: Anonymous 2014-06-03 19:51

.text
.file "-.rs"
.section .text._ZN4main20h8859abb726761ddceaa4v0.0E,"ax",@progbits
.align 16, 0x90
.type _ZN4main20h8859abb726761ddceaa4v0.0E,@function
_ZN4main20h8859abb726761ddceaa4v0.0E:
.cfi_startproc
cmpq %fs:112, %rsp
ja .LBB0_2
movabsq $104, %r10
movabsq $0, %r11
callq __morestack
retq
.LBB0_2:
pushq %r15
.Ltmp0:
.cfi_def_cfa_offset 16
pushq %r14
.Ltmp1:
.cfi_def_cfa_offset 24
pushq %r13
.Ltmp2:
.cfi_def_cfa_offset 32
pushq %r12
.Ltmp3:
.cfi_def_cfa_offset 40
pushq %rbx
.Ltmp4:
.cfi_def_cfa_offset 48
subq $64, %rsp
.Ltmp5:
.cfi_def_cfa_offset 112
.Ltmp6:
.cfi_offset %rbx, -48
.Ltmp7:
.cfi_offset %r12, -40
.Ltmp8:
.cfi_offset %r13, -32
.Ltmp9:
.cfi_offset %r14, -24
.Ltmp10:
.cfi_offset %r15, -16
movq $0, 56(%rsp)
leaq _ZN3fmt11secret_show20h65913581929639517154v0.0E(%rip), %r14
movq %r14, 40(%rsp)
leaq 56(%rsp), %r15
movq %r15, 48(%rsp)
leaq _ZN4main15__STATIC_FMTSTR20hc3a9a65871716609Paa4v0.0E(%rip), %r12
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
leaq 40(%rsp), %r13
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
leaq 8(%rsp), %rbx
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $1, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $2, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $3, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $4, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $5, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $6, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $7, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $8, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
movq $9, 56(%rsp)
movq %r14, 40(%rsp)
movq %r15, 48(%rsp)
movq %r12, 8(%rsp)
movq $1, 16(%rsp)
movq %r13, 24(%rsp)
movq $1, 32(%rsp)
movq %rbx, %rdi
callq _ZN2io5stdio12println_args20hdddc9185a6eb8db8RQp11v0.11.0.preE@PLT
addq $64, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
.Ltmp11:
.size _ZN4main20h8859abb726761ddceaa4v0.0E, .Ltmp11-_ZN4main20h8859abb726761ddceaa4v0.0E
.cfi_endproc

.section .text.main,"ax",@progbits
.globl main
.align 16, 0x90
.type main,@function
main:
.cfi_startproc
cmpq %fs:112, %rsp
ja .LBB1_2
movabsq $0, %r10
movabsq $0, %r11
callq __morestack
retq
.LBB1_2:
movq %rsi, %rax
movq %rdi, %rcx
leaq _ZN4main20h8859abb726761ddceaa4v0.0E(%rip), %rdi
movq %rcx, %rsi
movq %rax, %rdx
jmp _ZN10lang_start20ha10fbdb7203503f3Kpe11v0.11.0.preE@PLT
.Ltmp12:
.size main, .Ltmp12-main
.cfi_endproc

.section .text._ZN3fmt11secret_show20h65913581929639517154v0.0E,"ax",@progbits
.align 16, 0x90
.type _ZN3fmt11secret_show20h65913581929639517154v0.0E,@function
_ZN3fmt11secret_show20h65913581929639517154v0.0E:
.cfi_startproc
cmpq %fs:112, %rsp
ja .LBB2_2
movabsq $0, %r10
movabsq $0, %r11
callq __morestack
retq
.LBB2_2:
jmp _ZN3fmt3num13int.fmt..Show3fmt20hc53daf9faf4a2310OLI11v0.11.0.preE@PLT
.Ltmp13:
.size _ZN3fmt11secret_show20h65913581929639517154v0.0E, .Ltmp13-_ZN3fmt11secret_show20h65913581929639517154v0.0E
.cfi_endproc

.type _ZN4main15__STATIC_FMTSTR20hc3a9a65871716609Paa4v0.0E,@object
.section .rodata._ZN4main15__STATIC_FMTSTR20hc3a9a65871716609Paa4v0.0E,"a",@progbits
.align 16
_ZN4main15__STATIC_FMTSTR20hc3a9a65871716609Paa4v0.0E:
.byte 2
.zero 7
.byte 0
.zero 15
.long 32
.byte 2
.zero 3
.quad 0
.byte 3
.zero 15
.byte 3
.zero 15
.quad 0
.size _ZN4main15__STATIC_FMTSTR20hc3a9a65871716609Paa4v0.0E, 80

.section ".note.GNU-stack","",@progbits

Name: Anonymous 2014-06-03 19:58

Name: Anonymous 2014-06-03 20:24

>>7
EPIC xD

Name: Anonymous 2014-06-03 21:18

>>7

Yolo is a character from Ultima 7.

Name: Anonymous 2014-06-03 21:40

>>5
C-ABI
DA STANDARD
READ IT

Name: Anonymous 2014-06-03 22:55

>>10
Yes, we all know C defines no ABI. What are you telling me for?

Note, every C program still has an ABI. Unlike C++ it's remarkably consistent per platform.

Don't change these.
Name: Email:
Entire Thread Thread List