diff --git a/src/gallium/drivers/crocus/crocus_program_cache.c b/src/gallium/drivers/crocus/crocus_program_cache.c index a55e469482f..c6b3c23182b 100644 --- a/src/gallium/drivers/crocus/crocus_program_cache.c +++ b/src/gallium/drivers/crocus/crocus_program_cache.c @@ -39,7 +39,7 @@ #include "compiler/nir/nir.h" #include "compiler/nir/nir_builder.h" #include "intel/compiler/brw_compiler.h" -#include "intel/compiler/brw_eu.h" +#include "intel/compiler/brw_disasm.h" #include "intel/compiler/brw_nir.h" #include "crocus_context.h" #include "crocus_resource.h" diff --git a/src/intel/common/intel_disasm.c b/src/intel/common/intel_disasm.c index abf76349c6e..93ce724473a 100644 --- a/src/intel/common/intel_disasm.c +++ b/src/intel/common/intel_disasm.c @@ -24,6 +24,7 @@ #include #include "compiler/brw_inst.h" +#include "compiler/brw_disasm.h" #include "compiler/brw_eu.h" #include "compiler/brw_isa_info.h" diff --git a/src/intel/compiler/brw_compile_clip.c b/src/intel/compiler/brw_compile_clip.c index 843b5ee027a..25f476d4066 100644 --- a/src/intel/compiler/brw_compile_clip.c +++ b/src/intel/compiler/brw_compile_clip.c @@ -22,6 +22,7 @@ */ #include "brw_clip.h" +#include "brw_disasm.h" #include "dev/intel_debug.h" diff --git a/src/intel/compiler/brw_compile_ff_gs.c b/src/intel/compiler/brw_compile_ff_gs.c index 8a1e32d8d0d..200a1dd0415 100644 --- a/src/intel/compiler/brw_compile_ff_gs.c +++ b/src/intel/compiler/brw_compile_ff_gs.c @@ -30,6 +30,7 @@ */ #include "brw_compiler.h" +#include "brw_disasm.h" #include "brw_eu.h" #include "brw_prim.h" diff --git a/src/intel/compiler/brw_compile_sf.c b/src/intel/compiler/brw_compile_sf.c index 3aed8181fd8..f9f23e3d2c9 100644 --- a/src/intel/compiler/brw_compile_sf.c +++ b/src/intel/compiler/brw_compile_sf.c @@ -22,6 +22,7 @@ */ #include "brw_compiler.h" +#include "brw_disasm.h" #include "brw_eu.h" #include "brw_prim.h" diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c index 2309b2b3208..b399a4b3bcb 100644 --- a/src/intel/compiler/brw_disasm.c +++ b/src/intel/compiler/brw_disasm.c @@ -24,6 +24,7 @@ #include #include +#include "brw_disasm.h" #include "brw_eu_defines.h" #include "brw_inst.h" #include "brw_shader.h" diff --git a/src/intel/compiler/brw_disasm.h b/src/intel/compiler/brw_disasm.h new file mode 100644 index 00000000000..4c71b5826f3 --- /dev/null +++ b/src/intel/compiler/brw_disasm.h @@ -0,0 +1,38 @@ +/* + * Copyright 2024 Intel Corporation + * SPDX-License-Identifier: MIT + */ + +#ifndef BRW_DISASM_H +#define BRW_DISASM_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct brw_isa_info; +struct brw_inst; + +const struct brw_label *brw_find_label(const struct brw_label *root, int offset); +void brw_create_label(struct brw_label **labels, int offset, void *mem_ctx); +int brw_disassemble_inst(FILE *file, const struct brw_isa_info *isa, + const struct brw_inst *inst, bool is_compacted, + int offset, const struct brw_label *root_label); +const struct +brw_label *brw_label_assembly(const struct brw_isa_info *isa, + const void *assembly, int start, int end, + void *mem_ctx); +void brw_disassemble_with_labels(const struct brw_isa_info *isa, + const void *assembly, int start, int end, FILE *out); +void brw_disassemble(const struct brw_isa_info *isa, + const void *assembly, int start, int end, + const struct brw_label *root_label, FILE *out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* BRW_DISASM_H */ diff --git a/src/intel/compiler/brw_disasm_info.c b/src/intel/compiler/brw_disasm_info.c index 9ee365f0e60..cb9a2e42233 100644 --- a/src/intel/compiler/brw_disasm_info.c +++ b/src/intel/compiler/brw_disasm_info.c @@ -23,6 +23,7 @@ #include "brw_cfg.h" #include "brw_eu.h" +#include "brw_disasm.h" #include "brw_disasm_info.h" #include "dev/intel_debug.h" #include "compiler/nir/nir.h" diff --git a/src/intel/compiler/brw_eu.c b/src/intel/compiler/brw_eu.c index e2482a48a75..200628afa63 100644 --- a/src/intel/compiler/brw_eu.c +++ b/src/intel/compiler/brw_eu.c @@ -32,6 +32,7 @@ #include #include +#include "brw_disasm.h" #include "brw_eu_defines.h" #include "brw_eu.h" #include "brw_shader.h" diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h index 762a13b2a3b..f69df0216c3 100644 --- a/src/intel/compiler/brw_eu.h +++ b/src/intel/compiler/brw_eu.h @@ -179,20 +179,6 @@ void brw_init_codegen(const struct brw_isa_info *isa, struct brw_codegen *p, void *mem_ctx); bool brw_has_jip(const struct intel_device_info *devinfo, enum opcode opcode); bool brw_has_uip(const struct intel_device_info *devinfo, enum opcode opcode); -const struct brw_label *brw_find_label(const struct brw_label *root, int offset); -void brw_create_label(struct brw_label **labels, int offset, void *mem_ctx); -int brw_disassemble_inst(FILE *file, const struct brw_isa_info *isa, - const struct brw_inst *inst, bool is_compacted, - int offset, const struct brw_label *root_label); -const struct -brw_label *brw_label_assembly(const struct brw_isa_info *isa, - const void *assembly, int start, int end, - void *mem_ctx); -void brw_disassemble_with_labels(const struct brw_isa_info *isa, - const void *assembly, int start, int end, FILE *out); -void brw_disassemble(const struct brw_isa_info *isa, - const void *assembly, int start, int end, - const struct brw_label *root_label, FILE *out); const struct brw_shader_reloc *brw_get_shader_relocs(struct brw_codegen *p, unsigned *num_relocs); const unsigned *brw_get_program( struct brw_codegen *p, unsigned *sz ); diff --git a/src/intel/compiler/brw_eu_compact.c b/src/intel/compiler/brw_eu_compact.c index ac6916402ca..356650ffd20 100644 --- a/src/intel/compiler/brw_eu_compact.c +++ b/src/intel/compiler/brw_eu_compact.c @@ -79,6 +79,7 @@ */ #include "brw_eu.h" +#include "brw_disasm.h" #include "brw_shader.h" #include "brw_disasm_info.h" #include "dev/intel_debug.h" diff --git a/src/intel/compiler/test_eu_compact.cpp b/src/intel/compiler/test_eu_compact.cpp index a5d097104c1..e3e22596028 100644 --- a/src/intel/compiler/test_eu_compact.cpp +++ b/src/intel/compiler/test_eu_compact.cpp @@ -25,6 +25,7 @@ #include #include #include "util/ralloc.h" +#include "brw_disasm.h" #include "brw_eu.h" #include diff --git a/src/intel/tools/i965_disasm.c b/src/intel/tools/i965_disasm.c index e09d8d286a5..1771b2e369c 100644 --- a/src/intel/tools/i965_disasm.c +++ b/src/intel/tools/i965_disasm.c @@ -26,7 +26,8 @@ #include #include -#include "compiler/brw_eu.h" +#include "compiler/brw_disasm.h" +#include "compiler/brw_isa_info.h" #include "dev/intel_device_info.h" #include "util/u_dynarray.h"