intel/elk: Rename C++ namespace

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27563>
This commit is contained in:
Caio Oliveira 2024-01-19 18:13:59 -08:00 committed by Marge Bot
parent ed89a42f7a
commit f677485ad4
69 changed files with 164 additions and 164 deletions

View file

@ -35,7 +35,7 @@
* blocks with successor/predecessor edges connecting them.
*/
using namespace brw;
using namespace elk;
static bblock_t *
pop_stack(exec_list *list)

View file

@ -481,7 +481,7 @@ cfg_t::adjust_block_ips()
}
}
namespace brw {
namespace elk {
/**
* Immediate dominator tree analysis of a shader.
*/

View file

@ -29,7 +29,7 @@
#include "elk_shader.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
/* Look for and eliminate dead control flow:
*

View file

@ -47,7 +47,7 @@
#include <memory>
using namespace brw;
using namespace elk;
static unsigned get_lowered_simd_width(const fs_visitor *shader,
const fs_inst *inst);
@ -2397,7 +2397,7 @@ fs_visitor::opt_algebraic()
assert(!inst->saturate);
assert(!inst->src[0].abs);
assert(!inst->src[0].negate);
const brw::fs_builder ibld(this, block, inst);
const elk::fs_builder ibld(this, block, inst);
if (!inst->is_partial_write())
ibld.emit_undef_for_dst(inst);
@ -2418,7 +2418,7 @@ fs_visitor::opt_algebraic()
assert(!inst->saturate);
assert(!inst->src[0].abs);
assert(!inst->src[0].negate);
const brw::fs_builder ibld(this, block, inst);
const elk::fs_builder ibld(this, block, inst);
if (!inst->is_partial_write())
ibld.emit_undef_for_dst(inst);
@ -2608,7 +2608,7 @@ fs_visitor::opt_algebraic()
assert(!inst->saturate);
assert(!inst->src[0].abs && !inst->src[0].negate);
assert(!inst->src[1].abs && !inst->src[1].negate);
const brw::fs_builder ibld(this, block, inst);
const elk::fs_builder ibld(this, block, inst);
if (!inst->is_partial_write())
ibld.emit_undef_for_dst(inst);
@ -5902,7 +5902,7 @@ fs_visitor::dump_instruction_to_file(const backend_instruction *be_inst, FILE *f
fprintf(file, "\n");
}
brw::register_pressure::register_pressure(const fs_visitor *v)
elk::register_pressure::register_pressure(const fs_visitor *v)
{
const fs_live_variables &live = v->live_analysis.require();
const unsigned num_instructions = v->cfg->num_blocks ?
@ -5928,13 +5928,13 @@ brw::register_pressure::register_pressure(const fs_visitor *v)
delete[] payload_last_use_ip;
}
brw::register_pressure::~register_pressure()
elk::register_pressure::~register_pressure()
{
delete[] regs_live_at_ip;
}
void
fs_visitor::invalidate_analysis(brw::analysis_dependency_class c)
fs_visitor::invalidate_analysis(elk::analysis_dependency_class c)
{
backend_shader::invalidate_analysis(c);
live_analysis.invalidate(c);
@ -8069,9 +8069,9 @@ bool brw_should_print_shader(const nir_shader *shader, uint64_t debug_flag)
return INTEL_DEBUG(debug_flag) && (!shader->info.internal || NIR_DEBUG(PRINT_INTERNAL));
}
namespace brw {
namespace elk {
fs_reg
fetch_payload_reg(const brw::fs_builder &bld, uint8_t regs[2],
fetch_payload_reg(const elk::fs_builder &bld, uint8_t regs[2],
brw_reg_type type, unsigned n)
{
if (!regs[0])
@ -8079,7 +8079,7 @@ namespace brw {
if (bld.dispatch_width() > 16) {
const fs_reg tmp = bld.vgrf(type, n);
const brw::fs_builder hbld = bld.exec_all().group(16, 0);
const elk::fs_builder hbld = bld.exec_all().group(16, 0);
const unsigned m = bld.dispatch_width() / hbld.dispatch_width();
fs_reg *const components = new fs_reg[m * n];
@ -8100,7 +8100,7 @@ namespace brw {
}
fs_reg
fetch_barycentric_reg(const brw::fs_builder &bld, uint8_t regs[2])
fetch_barycentric_reg(const elk::fs_builder &bld, uint8_t regs[2])
{
if (!regs[0])
return fs_reg();
@ -8108,7 +8108,7 @@ namespace brw {
return fetch_payload_reg(bld, regs, BRW_REGISTER_TYPE_F, 2);
const fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_F, 2);
const brw::fs_builder hbld = bld.exec_all().group(8, 0);
const elk::fs_builder hbld = bld.exec_all().group(8, 0);
const unsigned m = bld.dispatch_width() / hbld.dispatch_width();
fs_reg *const components = new fs_reg[2 * m];

View file

@ -41,7 +41,7 @@ namespace {
class fs_visitor;
namespace brw {
namespace elk {
/**
* Register pressure analysis of a shader. Estimates how many registers
* are live at any point of the program in GRF units.
@ -71,7 +71,7 @@ namespace brw {
struct brw_gs_compile;
namespace brw {
namespace elk {
class fs_builder;
}
@ -145,7 +145,7 @@ struct fs_thread_payload : public thread_payload {
struct cs_thread_payload : public thread_payload {
cs_thread_payload(const fs_visitor &v);
void load_subgroup_id(const brw::fs_builder &bld, fs_reg &dest) const;
void load_subgroup_id(const elk::fs_builder &bld, fs_reg &dest) const;
fs_reg local_invocation_id[3];
@ -193,7 +193,7 @@ public:
fs_reg vgrf(const glsl_type *const type);
void import_uniforms(fs_visitor *v);
void VARYING_PULL_CONSTANT_LOAD(const brw::fs_builder &bld,
void VARYING_PULL_CONSTANT_LOAD(const elk::fs_builder &bld,
const fs_reg &dst,
const fs_reg &surface,
const fs_reg &surface_handle,
@ -201,7 +201,7 @@ public:
uint32_t const_offset,
uint8_t alignment,
unsigned components);
void DEP_RESOLVE_MOV(const brw::fs_builder &bld, int grf);
void DEP_RESOLVE_MOV(const elk::fs_builder &bld, int grf);
bool run_fs(bool allow_spilling, bool do_rep_send);
bool run_vs();
@ -234,7 +234,7 @@ public:
bool get_pull_locs(const fs_reg &src, unsigned *out_surf_index,
unsigned *out_pull_index);
bool lower_constant_loads();
virtual void invalidate_analysis(brw::analysis_dependency_class c);
virtual void invalidate_analysis(elk::analysis_dependency_class c);
#ifndef NDEBUG
void validate();
@ -245,7 +245,7 @@ public:
bool opt_algebraic();
bool opt_redundant_halt();
bool opt_cse();
bool opt_cse_local(const brw::fs_live_variables &live, bblock_t *block, int &ip);
bool opt_cse_local(const elk::fs_live_variables &live, bblock_t *block, int &ip);
bool opt_copy_propagation();
bool opt_bank_conflicts();
@ -296,7 +296,7 @@ public:
void set_tcs_invocation_id();
void emit_alpha_test();
fs_inst *emit_single_fb_write(const brw::fs_builder &bld,
fs_inst *emit_single_fb_write(const elk::fs_builder &bld,
fs_reg color1, fs_reg color2,
fs_reg src0_alpha, unsigned components);
void do_emit_fb_writes(int nr_color_regions, bool replicate_alpha);
@ -309,9 +309,9 @@ public:
void emit_urb_fence();
void emit_cs_terminate();
fs_reg interp_reg(const brw::fs_builder &bld, unsigned location,
fs_reg interp_reg(const elk::fs_builder &bld, unsigned location,
unsigned channel, unsigned comp);
fs_reg per_primitive_reg(const brw::fs_builder &bld,
fs_reg per_primitive_reg(const elk::fs_builder &bld,
int location, unsigned comp);
virtual void dump_instruction_to_file(const backend_instruction *inst, FILE *file) const;
@ -324,9 +324,9 @@ public:
struct brw_stage_prog_data *prog_data;
brw_analysis<brw::fs_live_variables, backend_shader> live_analysis;
brw_analysis<brw::register_pressure, fs_visitor> regpressure_analysis;
brw_analysis<brw::performance, fs_visitor> performance_analysis;
brw_analysis<elk::fs_live_variables, backend_shader> live_analysis;
brw_analysis<elk::register_pressure, fs_visitor> regpressure_analysis;
brw_analysis<elk::performance, fs_visitor> performance_analysis;
/** Number of uniform variable components visited. */
unsigned uniforms;
@ -456,7 +456,7 @@ public:
void enable_debug(const char *shader_name);
int generate_code(const cfg_t *cfg, int dispatch_width,
struct shader_stats shader_stats,
const brw::performance &perf,
const elk::performance &perf,
struct brw_compile_stats *stats,
unsigned max_polygons = 0);
void add_const_data(void *data, unsigned size);
@ -539,14 +539,14 @@ private:
void *mem_ctx;
};
namespace brw {
namespace elk {
fs_reg
fetch_payload_reg(const brw::fs_builder &bld, uint8_t regs[2],
fetch_payload_reg(const elk::fs_builder &bld, uint8_t regs[2],
brw_reg_type type = BRW_REGISTER_TYPE_F,
unsigned n = 1);
fs_reg
fetch_barycentric_reg(const brw::fs_builder &bld, uint8_t regs[2]);
fetch_barycentric_reg(const elk::fs_builder &bld, uint8_t regs[2]);
inline fs_reg
dynamic_msaa_flags(const struct brw_wm_prog_data *wm_prog_data)
@ -564,19 +564,19 @@ namespace brw {
lower_src_modifiers(fs_visitor *v, bblock_t *block, fs_inst *inst, unsigned i);
}
void shuffle_from_32bit_read(const brw::fs_builder &bld,
void shuffle_from_32bit_read(const elk::fs_builder &bld,
const fs_reg &dst,
const fs_reg &src,
uint32_t first_component,
uint32_t components);
fs_reg setup_imm_df(const brw::fs_builder &bld,
fs_reg setup_imm_df(const elk::fs_builder &bld,
double v);
fs_reg setup_imm_b(const brw::fs_builder &bld,
fs_reg setup_imm_b(const elk::fs_builder &bld,
int8_t v);
fs_reg setup_imm_ub(const brw::fs_builder &bld,
fs_reg setup_imm_ub(const elk::fs_builder &bld,
uint8_t v);
enum brw_barycentric_mode brw_barycentric_mode(nir_intrinsic_instr *intr);
@ -588,8 +588,8 @@ void brw_compute_urb_setup_index(struct brw_wm_prog_data *wm_prog_data);
bool brw_nir_lower_simd(nir_shader *nir, unsigned dispatch_width);
fs_reg brw_sample_mask_reg(const brw::fs_builder &bld);
void brw_emit_predicate_on_sample_mask(const brw::fs_builder &bld, fs_inst *inst);
fs_reg brw_sample_mask_reg(const elk::fs_builder &bld);
void brw_emit_predicate_on_sample_mask(const elk::fs_builder &bld, fs_inst *inst);
int brw_get_subgroup_id_param_index(const intel_device_info *devinfo,
const brw_stage_prog_data *prog_data);

View file

@ -30,13 +30,13 @@
#include "elk_eu.h"
#include "elk_fs.h"
namespace brw {
namespace elk {
/**
* Toolbox to assemble an FS IR program out of individual instructions.
*
* This object is meant to have an interface consistent with
* brw::vec4_builder. They cannot be fully interchangeable because
* brw::fs_builder generates scalar code while brw::vec4_builder generates
* elk::vec4_builder. They cannot be fully interchangeable because
* elk::fs_builder generates scalar code while elk::vec4_builder generates
* vector code.
*/
class fs_builder {
@ -957,7 +957,7 @@ namespace brw {
}
static inline fs_reg
offset(const fs_reg &reg, const brw::fs_builder &bld, unsigned delta)
offset(const fs_reg &reg, const elk::fs_builder &bld, unsigned delta)
{
return offset(reg, bld.dispatch_width(), delta);
}

View file

@ -48,7 +48,7 @@
* exists and therefore remove the instruction.
*/
using namespace brw;
using namespace elk;
static bool
cmod_propagate_cmp_to_add(const intel_device_info *devinfo, bblock_t *block,

View file

@ -39,7 +39,7 @@
#include "elk_cfg.h"
#include "util/half_float.h"
using namespace brw;
using namespace elk;
static const bool debug = false;
@ -1193,7 +1193,7 @@ struct register_allocation {
static fs_reg
allocate_slots(struct register_allocation *regs, unsigned num_regs,
unsigned bytes, unsigned align_bytes,
brw::simple_allocator &alloc)
elk::simple_allocator &alloc)
{
assert(bytes == 2 || bytes == 4 || bytes == 8);
assert(align_bytes == 2 || align_bytes == 4 || align_bytes == 8);
@ -1248,7 +1248,7 @@ deallocate_slots(struct register_allocation *regs, unsigned num_regs,
static void
parcel_out_registers(struct imm *imm, unsigned len, const bblock_t *cur_block,
struct register_allocation *regs, unsigned num_regs,
brw::simple_allocator &alloc, unsigned ver)
elk::simple_allocator &alloc, unsigned ver)
{
/* Each basic block has two distinct set of constants. There is the set of
* constants that only have uses in that block, and there is the set of
@ -1325,7 +1325,7 @@ fs_visitor::opt_combine_constants()
table.num_boxes = 0;
table.boxes = ralloc_array(const_ctx, fs_inst_box, table.size_boxes);
const brw::idom_tree &idom = idom_analysis.require();
const elk::idom_tree &idom = idom_analysis.require();
unsigned ip = -1;
/* Make a pass through all instructions and count the number of times each

View file

@ -40,7 +40,7 @@
#include "elk_cfg.h"
#include "elk_eu.h"
using namespace brw;
using namespace elk;
namespace { /* avoid conflict with opt_copy_propagation_elements */
struct acp_entry {
@ -660,7 +660,7 @@ instruction_requires_packed_data(fs_inst *inst)
static bool
try_copy_propagate(const brw_compiler *compiler, fs_inst *inst,
acp_entry *entry, int arg,
const brw::simple_allocator &alloc,
const elk::simple_allocator &alloc,
uint8_t max_polygons)
{
if (inst->src[arg].file != VGRF)
@ -1276,7 +1276,7 @@ can_propagate_from(fs_inst *inst)
static bool
opt_copy_propagation_local(const brw_compiler *compiler, linear_ctx *lin_ctx,
bblock_t *block, struct acp &acp,
const brw::simple_allocator &alloc,
const elk::simple_allocator &alloc,
uint8_t max_polygons)
{
bool progress = false;

View file

@ -33,7 +33,7 @@
* 13.1 (p378).
*/
using namespace brw;
using namespace elk;
namespace {
struct aeb_entry : public exec_node {

View file

@ -34,7 +34,7 @@
* yet in the tail end of this block.
*/
using namespace brw;
using namespace elk;
/**
* Is it safe to eliminate the instruction?

View file

@ -1624,7 +1624,7 @@ translate_systolic_depth(unsigned d)
int
fs_generator::generate_code(const cfg_t *cfg, int dispatch_width,
struct shader_stats shader_stats,
const brw::performance &perf,
const elk::performance &perf,
struct brw_compile_stats *stats,
unsigned max_polygons)
{

View file

@ -28,7 +28,7 @@
#include "elk_fs.h"
#include "elk_fs_live_variables.h"
using namespace brw;
using namespace elk;
#define MAX_INSTRUCTION (1 << 30)

View file

@ -35,7 +35,7 @@
struct cfg_t;
struct backend_shader;
namespace brw {
namespace elk {
class fs_live_variables {
public:
@ -143,6 +143,6 @@ protected:
void *mem_ctx;
};
} /* namespace brw */
} /* namespace elk */
#endif /* ELK_FS_LIVE_VARIABLES_H */

View file

@ -26,7 +26,7 @@
#include "elk_cfg.h"
#include "elk_fs_builder.h"
using namespace brw;
using namespace elk;
bool
fs_visitor::lower_pack()

View file

@ -25,7 +25,7 @@
#include "elk_cfg.h"
#include "elk_fs_builder.h"
using namespace brw;
using namespace elk;
namespace {
/* From the SKL PRM Vol 2a, "Move":
@ -404,7 +404,7 @@ namespace {
lower_instruction(fs_visitor *v, bblock_t *block, fs_inst *inst);
}
namespace brw {
namespace elk {
/**
* Remove any modifiers from the \p i-th source region of the instruction,
* including negate, abs and any implicit type conversion to the execution

View file

@ -33,7 +33,7 @@
#include <vector>
using namespace brw;
using namespace elk;
struct brw_fs_bind_info {
bool valid;
@ -4704,7 +4704,7 @@ add_rebuild_src(nir_src *src, void *state)
}
static fs_reg
try_rebuild_resource(nir_to_brw_state &ntb, const brw::fs_builder &bld, nir_def *resource_def)
try_rebuild_resource(nir_to_brw_state &ntb, const elk::fs_builder &bld, nir_def *resource_def)
{
/* Create a build at the location of the resource_intel intrinsic */
fs_builder ubld8 = bld.exec_all().group(8, 0);
@ -4862,7 +4862,7 @@ try_rebuild_resource(nir_to_brw_state &ntb, const brw::fs_builder &bld, nir_def
}
static fs_reg
get_nir_image_intrinsic_image(nir_to_brw_state &ntb, const brw::fs_builder &bld,
get_nir_image_intrinsic_image(nir_to_brw_state &ntb, const elk::fs_builder &bld,
nir_intrinsic_instr *instr)
{
if (is_resource_src(instr->src[0])) {
@ -4878,7 +4878,7 @@ get_nir_image_intrinsic_image(nir_to_brw_state &ntb, const brw::fs_builder &bld,
}
static fs_reg
get_nir_buffer_intrinsic_index(nir_to_brw_state &ntb, const brw::fs_builder &bld,
get_nir_buffer_intrinsic_index(nir_to_brw_state &ntb, const elk::fs_builder &bld,
nir_intrinsic_instr *instr)
{
/* SSBO stores are weird in that their index is in src[1] */
@ -4922,7 +4922,7 @@ get_nir_buffer_intrinsic_index(nir_to_brw_state &ntb, const brw::fs_builder &bld
*/
static fs_reg
swizzle_nir_scratch_addr(nir_to_brw_state &ntb,
const brw::fs_builder &bld,
const elk::fs_builder &bld,
const fs_reg &nir_addr,
bool in_dwords)
{

View file

@ -32,7 +32,7 @@
#include "util/set.h"
#include "util/register_allocate.h"
using namespace brw;
using namespace elk;
#define REG_CLASS_COUNT 20

View file

@ -44,7 +44,7 @@
#include "elk_cfg.h"
#include "elk_fs_live_variables.h"
using namespace brw;
using namespace elk;
static bool
is_nop_mov(const fs_inst *inst)

View file

@ -25,7 +25,7 @@
#include "elk_fs_live_variables.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
/** @file elk_fs_saturate_propagation.cpp
*

View file

@ -38,7 +38,7 @@
*/
#define MAX_MOVS 8 /**< The maximum number of MOVs to attempt to match. */
using namespace brw;
using namespace elk;
/**
* Scans forwards from an IF counting consecutive MOV instructions in the

View file

@ -24,7 +24,7 @@
#include "elk_fs.h"
#include "elk_fs_builder.h"
using namespace brw;
using namespace elk;
vs_thread_payload::vs_thread_payload(const fs_visitor &v)
{

View file

@ -33,7 +33,7 @@
#include "elk_nir.h"
#include "compiler/glsl_types.h"
using namespace brw;
using namespace elk;
/* Input data is organized with first the per-primitive values, followed
* by per-vertex values. The per-vertex will have interpolation information

View file

@ -33,7 +33,7 @@
#include "elk_eu.h"
#include "elk_prim.h"
namespace brw {
namespace elk {
void
gfx6_gs_visitor::emit_prolog()
@ -699,4 +699,4 @@ gfx6_gs_visitor::get_vertex_output_offset_for_varying(int vertex, int varying)
return vertex * (prog_data->vue_map.num_slots + 1) + slot;
}
} /* namespace brw */
} /* namespace elk */

View file

@ -30,7 +30,7 @@
#ifdef __cplusplus
namespace brw {
namespace elk {
class gfx6_gs_visitor : public vec4_gs_visitor
{
@ -77,7 +77,7 @@ private:
src_reg destination_indices;
};
} /* namespace brw */
} /* namespace elk */
#endif /* __cplusplus */

View file

@ -31,7 +31,7 @@
#include "util/rounding.h"
#include "util/u_math.h"
namespace brw {
namespace elk {
/**
* Simple allocator used to keep track of virtual GRFs.
*/

View file

@ -25,7 +25,7 @@
#ifndef ELK_IR_ANALYSIS_H
#define ELK_IR_ANALYSIS_H
namespace brw {
namespace elk {
/**
* Bitset of state categories that can influence the result of IR analysis
* passes.
@ -122,7 +122,7 @@ namespace brw {
* \p C.
*
* - 'x.dependency_class()' on const \p x returns a bitset of
* brw::analysis_dependency_class specifying the set of IR objects that are
* elk::analysis_dependency_class specifying the set of IR objects that are
* required to remain invariant for the cached analysis result to be
* considered valid.
*
@ -176,7 +176,7 @@ public:
* have to be discarded.
*/
void
invalidate(brw::analysis_dependency_class c)
invalidate(elk::analysis_dependency_class c)
{
if (p && (c & p->dependency_class())) {
delete p;

View file

@ -724,7 +724,7 @@ is_multi_copy_payload(const fs_inst *inst) {
* instruction.
*/
inline bool
is_coalescing_payload(const brw::simple_allocator &alloc, const fs_inst *inst)
is_coalescing_payload(const elk::simple_allocator &alloc, const fs_inst *inst)
{
return is_identity_payload(VGRF, inst) &&
inst->src[0].offset == 0 &&

View file

@ -26,7 +26,7 @@
#include "elk_vec4.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
namespace {
/**
@ -1675,19 +1675,19 @@ namespace {
}
}
brw::performance::performance(const fs_visitor *v) :
elk::performance::performance(const fs_visitor *v) :
block_latency(new unsigned[v->cfg->num_blocks])
{
calculate_performance(*this, v, issue_fs_inst, v->dispatch_width);
}
brw::performance::performance(const vec4_visitor *v) :
elk::performance::performance(const vec4_visitor *v) :
block_latency(new unsigned[v->cfg->num_blocks])
{
calculate_performance(*this, v, issue_vec4_instruction, 8);
}
brw::performance::~performance()
elk::performance::~performance()
{
delete[] block_latency;
}

View file

@ -27,7 +27,7 @@
class fs_visitor;
namespace brw {
namespace elk {
class vec4_visitor;
/**

View file

@ -27,7 +27,7 @@
#include "elk_shader.h"
namespace brw {
namespace elk {
class dst_reg;
@ -470,6 +470,6 @@ get_exec_type_size(const vec4_instruction *inst)
return type_sz(get_exec_type(inst));
}
} /* namespace brw */
} /* namespace elk */
#endif

View file

@ -29,7 +29,7 @@
#include "elk_fs.h"
#include "elk_fs_builder.h"
using namespace brw;
using namespace elk;
static void
lower_urb_read_logical_send(const fs_builder &bld, fs_inst *inst)

View file

@ -23,7 +23,7 @@
#include "elk_shader.h"
using namespace brw;
using namespace elk;
/** @file elk_predicated_break.cpp
*

View file

@ -33,7 +33,7 @@
#include "elk_shader.h"
#include <new>
using namespace brw;
using namespace elk;
/** @file elk_fs_schedule_instructions.cpp
*

View file

@ -1273,7 +1273,7 @@ backend_shader::calculate_cfg()
}
void
backend_shader::invalidate_analysis(brw::analysis_dependency_class c)
backend_shader::invalidate_analysis(elk::analysis_dependency_class c)
{
idom_analysis.invalidate(c);
}
@ -1406,7 +1406,7 @@ brw_compile_tes(const struct brw_compiler *compiler,
assembly = g.get_assembly();
} else {
brw::vec4_tes_visitor v(compiler, &params->base, key, prog_data,
elk::vec4_tes_visitor v(compiler, &params->base, key, prog_data,
nir, debug_enabled);
if (!v.run()) {
params->base.error_str =

View file

@ -72,12 +72,12 @@ public:
exec_list instructions;
cfg_t *cfg;
brw_analysis<brw::idom_tree, backend_shader> idom_analysis;
brw_analysis<elk::idom_tree, backend_shader> idom_analysis;
gl_shader_stage stage;
bool debug_enabled;
brw::simple_allocator alloc;
elk::simple_allocator alloc;
virtual void dump_instruction_to_file(const backend_instruction *inst, FILE *file) const = 0;
virtual void dump_instructions_to_file(FILE *file) const;
@ -90,7 +90,7 @@ public:
void calculate_cfg();
virtual void invalidate_analysis(brw::analysis_dependency_class c);
virtual void invalidate_analysis(elk::analysis_dependency_class c);
};
#else

View file

@ -26,7 +26,7 @@
#include "elk_fs_builder.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
class cmod_propagation_test : public ::testing::Test {
protected:

View file

@ -8,7 +8,7 @@
#include "elk_fs_builder.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
struct FSCombineConstantsTest : public ::testing::Test {
FSCombineConstantsTest() {

View file

@ -26,7 +26,7 @@
#include "elk_fs_builder.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
class copy_propagation_test : public ::testing::Test {
protected:

View file

@ -26,7 +26,7 @@
#include "elk_fs_builder.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
class saturate_propagation_test : public ::testing::Test {
protected:

View file

@ -8,7 +8,7 @@
#include "elk_fs_builder.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
class PredicatedBreakTest : public ::testing::Test {
virtual void SetUp();

View file

@ -28,7 +28,7 @@
#include "elk_vec4_builder.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
class cmod_propagation_vec4_test : public ::testing::Test {
virtual void SetUp();

View file

@ -24,7 +24,7 @@
#include <gtest/gtest.h>
#include "elk_vec4.h"
using namespace brw;
using namespace elk;
class copy_propagation_vec4_test : public ::testing::Test {
virtual void SetUp();

View file

@ -24,7 +24,7 @@
#include <gtest/gtest.h>
#include "elk_vec4.h"
using namespace brw;
using namespace elk;
class dead_code_eliminate_vec4_test : public ::testing::Test {
virtual void SetUp();

View file

@ -24,7 +24,7 @@
#include <gtest/gtest.h>
#include "elk_vec4.h"
using namespace brw;
using namespace elk;
#define register_coalesce(v) _register_coalesce(v, __func__)

View file

@ -35,9 +35,9 @@
#define MAX_INSTRUCTION (1 << 30)
using namespace brw;
using namespace elk;
namespace brw {
namespace elk {
void
src_reg::init()
@ -2357,7 +2357,7 @@ vec4_visitor::apply_logical_swizzle(struct brw_reg *hw_reg,
}
void
vec4_visitor::invalidate_analysis(brw::analysis_dependency_class c)
vec4_visitor::invalidate_analysis(elk::analysis_dependency_class c)
{
backend_shader::invalidate_analysis(c);
live_analysis.invalidate(c);
@ -2543,7 +2543,7 @@ vec4_visitor::run()
return !failed;
}
} /* namespace brw */
} /* namespace elk */
extern "C" {

View file

@ -47,13 +47,13 @@ brw_vec4_generate_assembly(const struct brw_compiler *compiler,
const nir_shader *nir,
struct brw_vue_prog_data *prog_data,
const struct cfg_t *cfg,
const brw::performance &perf,
const elk::performance &perf,
bool debug_enabled);
#ifdef __cplusplus
} /* extern "C" */
namespace brw {
namespace elk {
/**
* The vertex shader front-end.
*
@ -107,8 +107,8 @@ public:
unsigned ubo_push_start[4];
unsigned push_length;
unsigned int max_grf;
brw_analysis<brw::vec4_live_variables, backend_shader> live_analysis;
brw_analysis<brw::performance, vec4_visitor> performance_analysis;
brw_analysis<elk::vec4_live_variables, backend_shader> live_analysis;
brw_analysis<elk::performance, vec4_visitor> performance_analysis;
/* Regs for vertex results. Generated at ir_variable visiting time
* for the ir->location's used.
@ -131,7 +131,7 @@ public:
void move_grf_array_access_to_scratch();
void split_uniform_registers();
void setup_push_ranges();
virtual void invalidate_analysis(brw::analysis_dependency_class c);
virtual void invalidate_analysis(elk::analysis_dependency_class c);
void split_virtual_grfs();
bool opt_vector_float();
bool opt_reduce_swizzle();
@ -344,7 +344,7 @@ private:
unsigned last_scratch; /**< measured in 32-byte (register size) units */
};
} /* namespace brw */
} /* namespace elk */
#endif /* __cplusplus */
#endif /* ELK_VEC4_H */

View file

@ -28,22 +28,22 @@
#include "elk_ir_vec4.h"
#include "elk_ir_allocator.h"
namespace brw {
namespace elk {
/**
* Toolbox to assemble a VEC4 IR program out of individual instructions.
*
* This object is meant to have an interface consistent with
* brw::fs_builder. They cannot be fully interchangeable because
* brw::fs_builder generates scalar code while brw::vec4_builder generates
* elk::fs_builder. They cannot be fully interchangeable because
* elk::fs_builder generates scalar code while elk::vec4_builder generates
* vector code.
*/
class vec4_builder {
public:
/** Type used in this IR to represent a source of an instruction. */
typedef brw::src_reg src_reg;
typedef elk::src_reg src_reg;
/** Type used in this IR to represent the destination of an instruction. */
typedef brw::dst_reg dst_reg;
typedef elk::dst_reg dst_reg;
/** Type used in this IR to represent an instruction. */
typedef vec4_instruction instruction;

View file

@ -33,7 +33,7 @@
#include "elk_cfg.h"
#include "elk_eu.h"
namespace brw {
namespace elk {
static bool
writemasks_incompatible(const vec4_instruction *earlier,
@ -362,4 +362,4 @@ vec4_visitor::opt_cmod_propagation()
return progress;
}
} /* namespace brw */
} /* namespace elk */

View file

@ -33,7 +33,7 @@
#include "elk_cfg.h"
#include "elk_eu.h"
namespace brw {
namespace elk {
struct copy_entry {
src_reg *value[4];
@ -553,4 +553,4 @@ vec4_visitor::opt_copy_propagation(bool do_constant_prop)
return progress;
}
} /* namespace brw */
} /* namespace elk */

View file

@ -25,7 +25,7 @@
#include "elk_vec4_live_variables.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
/** @file elk_vec4_cse.cpp
*

View file

@ -34,7 +34,7 @@
* yet in the tail end of this block.
*/
using namespace brw;
using namespace elk;
bool
vec4_visitor::dead_code_eliminate()

View file

@ -27,7 +27,7 @@
#include "dev/intel_debug.h"
#include "util/mesa-sha1.h"
using namespace brw;
using namespace elk;
static void
generate_math1_gfx4(struct brw_codegen *p,

View file

@ -23,7 +23,7 @@
#include "elk_vec4_gs_visitor.h"
namespace brw {
namespace elk {
void
vec4_gs_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)

View file

@ -37,7 +37,7 @@
#include "elk_private.h"
#include "dev/intel_debug.h"
namespace brw {
namespace elk {
vec4_gs_visitor::vec4_gs_visitor(const struct brw_compiler *compiler,
const struct brw_compile_params *params,
@ -579,7 +579,7 @@ static const GLuint gl_prim_to_hw_prim[MESA_PRIM_TRIANGLE_STRIP_ADJACENCY+1] = {
[MESA_PRIM_TRIANGLE_STRIP_ADJACENCY] = _3DPRIM_TRISTRIP_ADJ,
};
} /* namespace brw */
} /* namespace elk */
extern "C" const unsigned *
brw_compile_gs(const struct brw_compiler *compiler,
@ -797,9 +797,9 @@ brw_compile_gs(const struct brw_compiler *compiler,
prog_data->base.urb_entry_size = ALIGN(output_size_bytes, 128) / 128;
}
assert(nir->info.gs.output_primitive < ARRAY_SIZE(brw::gl_prim_to_hw_prim));
assert(nir->info.gs.output_primitive < ARRAY_SIZE(elk::gl_prim_to_hw_prim));
prog_data->output_topology =
brw::gl_prim_to_hw_prim[nir->info.gs.output_primitive];
elk::gl_prim_to_hw_prim[nir->info.gs.output_primitive];
prog_data->vertices_in = nir->info.gs.vertices_in;
@ -858,7 +858,7 @@ brw_compile_gs(const struct brw_compiler *compiler,
!INTEL_DEBUG(DEBUG_NO_DUAL_OBJECT_GS)) {
prog_data->base.dispatch_mode = INTEL_DISPATCH_MODE_4X2_DUAL_OBJECT;
brw::vec4_gs_visitor v(compiler, &params->base, &c, prog_data, nir,
elk::vec4_gs_visitor v(compiler, &params->base, &c, prog_data, nir,
true /* no_spills */,
debug_enabled);
@ -924,15 +924,15 @@ brw_compile_gs(const struct brw_compiler *compiler,
else
prog_data->base.dispatch_mode = INTEL_DISPATCH_MODE_4X2_DUAL_INSTANCE;
brw::vec4_gs_visitor *gs = NULL;
elk::vec4_gs_visitor *gs = NULL;
const unsigned *ret = NULL;
if (compiler->devinfo->ver >= 7)
gs = new brw::vec4_gs_visitor(compiler, &params->base, &c, prog_data,
gs = new elk::vec4_gs_visitor(compiler, &params->base, &c, prog_data,
nir, false /* no_spills */,
debug_enabled);
else
gs = new brw::gfx6_gs_visitor(compiler, &params->base, &c, prog_data,
gs = new elk::gfx6_gs_visitor(compiler, &params->base, &c, prog_data,
nir, false /* no_spills */,
debug_enabled);

View file

@ -35,7 +35,7 @@
#define MAX_GS_INPUT_VERTICES 6
#ifdef __cplusplus
namespace brw {
namespace elk {
class vec4_gs_visitor : public vec4_visitor
{
@ -69,7 +69,7 @@ protected:
struct brw_gs_prog_data * const gs_prog_data;
};
} /* namespace brw */
} /* namespace elk */
#endif /* __cplusplus */
#endif /* ELK_VEC4_GS_VISITOR_H */

View file

@ -28,7 +28,7 @@
#include "elk_vec4.h"
#include "elk_vec4_live_variables.h"
using namespace brw;
using namespace elk;
#define MAX_INSTRUCTION (1 << 30)

View file

@ -34,7 +34,7 @@
struct backend_shader;
namespace brw {
namespace elk {
class vec4_live_variables {
public:
@ -138,6 +138,6 @@ var_from_reg(const simple_allocator &alloc, const dst_reg &reg,
return result;
}
} /* namespace brw */
} /* namespace elk */
#endif /* ELK_VEC4_LIVE_VARIABLES_H */

View file

@ -30,10 +30,10 @@
#include "nir_intrinsics.h"
#include "nir_intrinsics_indices.h"
using namespace brw;
using namespace brw::surface_access;
using namespace elk;
using namespace elk::surface_access;
namespace brw {
namespace elk {
void
vec4_visitor::emit_nir_code()

View file

@ -25,11 +25,11 @@
#include "elk_vec4.h"
#include "elk_cfg.h"
using namespace brw;
using namespace elk;
#define REG_CLASS_COUNT 20
namespace brw {
namespace elk {
static void
assign(unsigned int *reg_hw_locations, backend_reg *reg)
@ -509,4 +509,4 @@ vec4_visitor::spill_reg(unsigned spill_reg_nr)
invalidate_analysis(DEPENDENCY_INSTRUCTIONS | DEPENDENCY_VARIABLES);
}
} /* namespace brw */
} /* namespace elk */

View file

@ -23,7 +23,7 @@
#include "elk_vec4_surface_builder.h"
using namespace brw;
using namespace elk;
namespace {
namespace array_utils {
@ -79,7 +79,7 @@ namespace {
}
}
namespace brw {
namespace elk {
namespace surface_access {
namespace {
using namespace array_utils;

View file

@ -27,7 +27,7 @@
#include "elk_vec4_builder.h"
namespace brw {
namespace elk {
namespace surface_access {
src_reg
emit_untyped_read(const vec4_builder &bld,

View file

@ -34,7 +34,7 @@
#include "elk_private.h"
#include "dev/intel_debug.h"
namespace brw {
namespace elk {
vec4_tcs_visitor::vec4_tcs_visitor(const struct brw_compiler *compiler,
const struct brw_compile_params *params,
@ -349,7 +349,7 @@ get_patch_count_threshold(int input_control_points)
return 1;
}
} /* namespace brw */
} /* namespace elk */
extern "C" const unsigned *
brw_compile_tcs(const struct brw_compiler *compiler,
@ -394,7 +394,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,
bool has_primitive_id =
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_PRIMITIVE_ID);
prog_data->patch_count_threshold = brw::get_patch_count_threshold(key->input_vertices);
prog_data->patch_count_threshold = elk::get_patch_count_threshold(key->input_vertices);
if (compiler->use_tcs_multi_patch) {
vue_prog_data->dispatch_mode = INTEL_DISPATCH_MODE_TCS_MULTI_PATCH;
@ -478,7 +478,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,
assembly = g.get_assembly();
} else {
brw::vec4_tcs_visitor v(compiler, &params->base, key, prog_data,
elk::vec4_tcs_visitor v(compiler, &params->base, key, prog_data,
nir, debug_enabled);
if (!v.run()) {
params->base.error_str =

View file

@ -35,7 +35,7 @@
#include "elk_vec4.h"
#ifdef __cplusplus
namespace brw {
namespace elk {
class vec4_tcs_visitor : public vec4_visitor
{
@ -77,7 +77,7 @@ protected:
src_reg invocation_id;
};
} /* namespace brw */
} /* namespace elk */
#endif /* __cplusplus */
#endif /* ELK_VEC4_TCS_H */

View file

@ -31,7 +31,7 @@
#include "elk_cfg.h"
#include "dev/intel_debug.h"
namespace brw {
namespace elk {
vec4_tes_visitor::vec4_tes_visitor(const struct brw_compiler *compiler,
const struct brw_compile_params *params,
@ -220,4 +220,4 @@ vec4_tes_visitor::emit_thread_end()
emit_vertex();
}
} /* namespace brw */
} /* namespace elk */

View file

@ -33,7 +33,7 @@
#include "elk_vec4.h"
#ifdef __cplusplus
namespace brw {
namespace elk {
class vec4_tes_visitor : public vec4_visitor
{
@ -59,7 +59,7 @@ private:
src_reg input_read_header;
};
} /* namespace brw */
} /* namespace elk */
#endif /* __cplusplus */
#endif /* ELK_VEC4_TES_H */

View file

@ -26,7 +26,7 @@
#include "elk_eu.h"
#include "util/u_math.h"
namespace brw {
namespace elk {
vec4_instruction::vec4_instruction(enum opcode opcode, const dst_reg &dst,
const src_reg &src0, const src_reg &src1,
@ -1426,4 +1426,4 @@ vec4_visitor::fail(const char *format, ...)
}
}
} /* namespace brw */
} /* namespace elk */

View file

@ -26,7 +26,7 @@
#include "elk_vec4.h"
namespace brw {
namespace elk {
class vec4_vs_visitor : public vec4_visitor
{
@ -53,6 +53,6 @@ private:
struct brw_vs_prog_data * const vs_prog_data;
};
} /* namespace brw */
} /* namespace elk */
#endif /* ELK_VEC4_VS_VISITOR_H */

View file

@ -25,7 +25,7 @@
#include "elk_vec4_vs.h"
#include "dev/intel_debug.h"
namespace brw {
namespace elk {
void
vec4_vs_visitor::emit_prolog()
@ -105,4 +105,4 @@ vec4_vs_visitor::vec4_vs_visitor(const struct brw_compiler *compiler,
}
} /* namespace brw */
} /* namespace elk */