0

I'm new in Halide. I am trying to compile camera_pipe application from the source code (https://github.com/halide/Halide/tree/master/apps/camera_pipe). I have successfully compiled camera_pipe.cpp. It generates "curved.s" assembly code.

# Lfunc_begin0:
    .loc    3 12 0                 
#/data/nfs_home/akafi/Halide_CoreIR/src/runtime/posix_allocator.cpp:12:0
    .cfi_startproc
#BB#0:
    pushq   %rbp
.Ltmp0:
    .cfi_def_cfa_offset 16
.Ltmp1:
    .cfi_offset %rbp, -16
    movq    %rsp, %rbp
.Ltmp2:
    .cfi_def_cfa_register %rbp
    #DEBUG_VALUE: default_malloc:user_context <- %RDI
    #DEBUG_VALUE: default_malloc:x <- %RSI
.Ltmp3:
    #DEBUG_VALUE: default_malloc:alignment <- 128
    .loc    3 15 27 prologue_end   
#/data/nfs_home/akafi/Halide_CoreIR/src/runtime/posix_allocator.cpp:15:27
    subq    $-128, %rsi
.Ltmp4:
    .loc    3 15 18 is_stmt 0       
# /data/nfs_home/akafi/Halide_CoreIR/src/runtime/posix_allocator.cpp:15:18
    movq    %rsi, %rdi
.Ltmp5:
    callq   malloc@PLT
    movq    %rax, %rcx
.Ltmp6:
    #DEBUG_VALUE: default_malloc:orig <- %RCX
    xorl    %eax, %eax
    .loc    3 16 14 is_stmt 1       
# /data/nfs_home/akafi/Halide_CoreIR/src/runtime/posix_allocator.cpp:16:14
.Ltmp7:
    testq   %rcx, %rcx
    je  .LBB0_2
.Ltmp8:
# BB#1:
    #DEBUG_VALUE: default_malloc:orig <- %RCX
    .loc    3 21 68                 
# data/nfs_home/akafi/Halide_CoreIR/src/runtime/posix_allocator.cpp:21:68
    movq    %rcx, %rax
    addq    $135, %rax

......
......

I have tried to debug the source code. I found that he "camera_pipe.cpp" called the "/Halide_CoreIR/src/CodeGen_X86.cpp".

The generated assembly doesn't look like X86 assembly. Then what is the fuction of "CodeGen_X86.cpp"?

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56

1 Answers1

0

It sounds like you may be building using a very old Halide tree—for quite a while there has not any file camera_pipe.cpp, the generated output is not called curved.*, etc.

That said, the x86 backend in CodeGen_X86.cpp does generate x86 code. The curved.s you posted is x86_64 assembly.

jrk
  • 2,896
  • 1
  • 22
  • 35