#include <gtest/gtest.h>
#include "brw_vec4.h"
+#include "brw_vs.h"
using namespace brw;
public:
struct brw_context *brw;
- struct intel_context *intel;
struct gl_context *ctx;
struct gl_shader_program *shader_prog;
struct brw_vertex_program *vp;
public:
register_coalesce_vec4_visitor(struct brw_context *brw,
struct gl_shader_program *shader_prog)
- : vec4_visitor(brw, NULL, NULL, NULL, NULL, shader_prog, NULL, NULL,
- false)
+ : vec4_visitor(brw, NULL, NULL, NULL, NULL, shader_prog,
+ MESA_SHADER_VERTEX, NULL,
+ false /* no_spills */,
+ ST_NONE, ST_NONE, ST_NONE)
{
}
protected:
virtual dst_reg *make_reg_for_system_value(ir_variable *ir)
{
- assert(!"Not reached");
- return NULL;
+ unreachable("Not reached");
}
- virtual int setup_attributes(int payload_reg)
+ virtual void setup_payload()
{
- assert(!"Not reached");
- return 0;
+ unreachable("Not reached");
}
virtual void emit_prolog()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_program_code()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_thread_end()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_urb_write_header(int mrf)
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual vec4_instruction *emit_urb_write_opcode(bool complete)
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
};
void register_coalesce_test::SetUp()
{
brw = (struct brw_context *)calloc(1, sizeof(*brw));
- intel = &brw->intel;
- ctx = &intel->ctx;
+ ctx = &brw->ctx;
vp = ralloc(NULL, struct brw_vertex_program);
v->dump_instructions();
}
+ v->calculate_cfg();
v->opt_register_coalesce();
if (print) {
register_coalesce(v);
- /* This path isn't supported yet in the reswizzling code, so we're checking
- * that we haven't done anything bad to scalar non-DP[234]s.
- */
- EXPECT_NE(mul->dst.reg, to.reg);
+ EXPECT_EQ(mul->dst.reg, to.reg);
}