Skip to content

Instantly share code, notes, and snippets.

@chriseth
Created December 13, 2024 14:18
Show Gist options
  • Save chriseth/de8cf64f6c575aaed16579dfb1dd73f7 to your computer and use it in GitHub Desktop.
Save chriseth/de8cf64f6c575aaed16579dfb1dd73f7 to your computer and use it in GitHub Desktop.
submachine to perform a single field multiplication
.text
.file "powdr_jit_compiled.ab9faed63bb29514-cgu.0"
.section .text.witgen,"ax",@progbits
.globl witgen
.p2align 4, 0x90
.type witgen,@function
witgen:
.Lfunc_begin0:
.cfi_startproc
.cfi_personality 155, DW.ref.rust_eh_personality
.cfi_lsda 27, .Lexception0
pushq %r15
.cfi_def_cfa_offset 16
pushq %r14
.cfi_def_cfa_offset 24
pushq %r13
.cfi_def_cfa_offset 32
pushq %r12
.cfi_def_cfa_offset 40
pushq %rbx
.cfi_def_cfa_offset 48
.cfi_offset %rbx, -48
.cfi_offset %r12, -40
.cfi_offset %r13, -32
.cfi_offset %r14, -24
.cfi_offset %r15, -16
movq 64(%rsp), %rdx
movq 72(%rsp), %r14
movabsq $-6148914691236517205, %rax
mulxq %rax, %r15, %r15
leaq (%r14,%r14,2), %rbx
incq %rbx
leaq .L__unnamed_1(%rip), %rax
cmpq %rdx, %rbx
jae .LBB0_8
leaq (%r14,%r14,2), %rbx
leaq 2(%rbx), %rcx
cmpq %rdx, %rcx
jae .LBB0_2
cmpq %rdx, %rbx
jae .LBB0_5
movq 48(%rsp), %r13
movq 56(%rsp), %r12
shrq %r15
movq 16(%r13,%rbx,8), %rdx
mulxq 8(%r13,%rbx,8), %rdi, %rsi
movabsq $-4294967295, %rdx
xorl %ecx, %ecx
callq *__umodti3@GOTPCREL(%rip)
movq %rax, (%r13,%rbx,8)
cmpq %r15, %r14
jae .LBB0_7
orb $1, (%r12,%r14,4)
popq %rbx
.cfi_def_cfa_offset 40
popq %r12
.cfi_def_cfa_offset 32
popq %r13
.cfi_def_cfa_offset 24
popq %r14
.cfi_def_cfa_offset 16
popq %r15
.cfi_def_cfa_offset 8
retq
.LBB0_2:
.cfi_def_cfa_offset 48
movq %rcx, %rbx
jmp .LBB0_8
.LBB0_5:
leaq .L__unnamed_2(%rip), %rax
jmp .LBB0_8
.LBB0_7:
leaq .L__unnamed_3(%rip), %rax
movq %r14, %rbx
movq %r15, %rdx
.LBB0_8:
.Ltmp0:
movq %rbx, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq *_ZN4core9panicking18panic_bounds_check17h9d0a0d0497b70633E@GOTPCREL(%rip)
.Ltmp1:
ud2
.LBB0_3:
.Ltmp2:
callq *_ZN4core9panicking19panic_cannot_unwind17he025594bb8b2f787E@GOTPCREL(%rip)
.Lfunc_end0:
.size witgen, .Lfunc_end0-witgen
.cfi_endproc
.section .gcc_except_table.witgen,"a",@progbits
.p2align 2, 0x0
GCC_except_table0:
.Lexception0:
.byte 255
.byte 155
.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
.byte 1
.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
.uleb128 .Lfunc_begin0-.Lfunc_begin0
.uleb128 .Ltmp0-.Lfunc_begin0
.byte 0
.byte 0
.uleb128 .Ltmp0-.Lfunc_begin0
.uleb128 .Ltmp1-.Ltmp0
.uleb128 .Ltmp2-.Lfunc_begin0
.byte 1
.Lcst_end0:
.byte 127
.byte 0
.p2align 2, 0x0
.Lttbase0:
.byte 0
.p2align 2, 0x0
.type .L__unnamed_4,@object
.section .rodata..L__unnamed_4,"a",@progbits
.L__unnamed_4:
.ascii "src/lib.rs"
.size .L__unnamed_4, 10
.type .L__unnamed_1,@object
.section .data.rel.ro..L__unnamed_1,"aw",@progbits
.p2align 3, 0x0
.L__unnamed_1:
.quad .L__unnamed_4
.asciz "\n\000\000\000\000\000\000\000{\000\000\000\005\000\000"
.size .L__unnamed_1, 24
.type .L__unnamed_2,@object
.section .data.rel.ro..L__unnamed_2,"aw",@progbits
.p2align 3, 0x0
.L__unnamed_2:
.quad .L__unnamed_4
.asciz "\n\000\000\000\000\000\000\000\201\000\000\000\005\000\000"
.size .L__unnamed_2, 24
.type .L__unnamed_3,@object
.section .data.rel.ro..L__unnamed_3,"aw",@progbits
.p2align 3, 0x0
.L__unnamed_3:
.quad .L__unnamed_4
.asciz "\n\000\000\000\000\000\000\000\207\000\000\000\005\000\000"
.size .L__unnamed_3, 24
.hidden DW.ref.rust_eh_personality
.weak DW.ref.rust_eh_personality
.section .data.DW.ref.rust_eh_personality,"awG",@progbits,DW.ref.rust_eh_personality,comdat
.p2align 3, 0x0
.type DW.ref.rust_eh_personality,@object
.size DW.ref.rust_eh_personality, 8
DW.ref.rust_eh_personality:
.quad rust_eh_personality
.ident "rustc version 1.83.0-nightly (da889684c 2024-09-20)"
.section ".note.GNU-stack","",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment